private async Task ShowUI() { var currentPage = Window.Current.Content as Frame; if (currentPage == null) { return; } var root = currentPage.FindDescendant <Grid>(); if (root == null) { return; } CreateUI(); _view.Text = ""; try { root.Children.Add(_view); } catch (Exception) { _view = null; CreateUI(); root.Children.Add(_view); } await _view.Show(); }
private AdventureWorksAideView CreateUI() { if (_view != null) { return(_view); } _view = new AdventureWorksAideView() { VerticalAlignment = VerticalAlignment.Top, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Thickness(20), Opacity = 0, }; return(_view); }