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; }
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); }
private void SubmitClicked(object sender, RoutedEventArgs e) { var r = new FeedbackResult(); Results(r); }