コード例 #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);
        }