예제 #1
0
파일: Feedback.cs 프로젝트: rudimk/HAMMER
        public static async Task<FeedbackResult> ShowFeedback()
        {
            var result = new FeedbackResult();
            var tcs = new TaskCompletionSource<int>();
            var p = new Popup
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Stretch,
                Width = Window.Current.Bounds.Width,
                Height = Window.Current.Bounds.Height,
                
            };

            var f = new FeedbackView
                        {
                            VerticalAlignment = VerticalAlignment.Bottom,
                            HorizontalAlignment = HorizontalAlignment.Left,
                            Results = (r) =>
                                          {

                                              result = r;
                                              tcs.TrySetResult(1);
                                              p.IsOpen = false;
                                          }
                        };
            var g = new Grid
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Stretch,
                Width = Window.Current.Bounds.Width,
                Height = Window.Current.Bounds.Height,
            };
            g.Children.Add(f);
            p.Child = g;
            p.IsOpen = true;
            await tcs.Task;
            return result;
        }
예제 #2
0
        public static async Task <FeedbackResult> ShowFeedback()
        {
            var result = new FeedbackResult();
            var tcs    = new TaskCompletionSource <int>();
            var p      = new Popup
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch,
                Width  = Window.Current.Bounds.Width,
                Height = Window.Current.Bounds.Height,
            };

            var f = new FeedbackView
            {
                VerticalAlignment   = VerticalAlignment.Bottom,
                HorizontalAlignment = HorizontalAlignment.Left,
                Results             = (r) =>
                {
                    result = r;
                    tcs.TrySetResult(1);
                    p.IsOpen = false;
                }
            };
            var g = new Grid
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment   = VerticalAlignment.Stretch,
                Width  = Window.Current.Bounds.Width,
                Height = Window.Current.Bounds.Height,
            };

            g.Children.Add(f);
            p.Child  = g;
            p.IsOpen = true;
            await tcs.Task;

            return(result);
        }
예제 #3
0
        private void SubmitClicked(object sender, RoutedEventArgs e)
        {
            var r = new FeedbackResult();

            Results(r);
        }