protected override void OnNavigatedTo(NavigationEventArgs e) { var args = e.Parameter as DocumentLayoutArgs; ApplicationView.GetForCurrentView().FullScreenSystemOverlayMode = FullScreenSystemOverlayMode.Minimal; ApplicationView.GetForCurrentView().TryEnterFullScreenMode(); Background = new SolidColorBrush(args.BackColor); // Populate the columns with translations and rows with stanzas foreach (Doc doc in Common.Docs) { Grid MainGrid = DocumentUIFactory.CreateGridFromDoc(doc, args.ForeColor); MainPanel.Children.Add(MainGrid); } base.OnNavigatedTo(e); }
private void DocumentEditorView_Loaded(object sender, RoutedEventArgs e) { InitEnglish(); Grid docGrid = DocumentUIFactory.CreateGridFromDoc(Document); DocPresenter.Children.Clear(); DocPresenter.Children.Add(docGrid); lastFocusedTextBox = (TextBox)docGrid.Children.First(c => c is TextBox); docGrid.Children.ToList().ForEach(element => { if (element is TextBox box) { box.TextChanged += lastFocusedTextBox_TextChanged; box.GotFocus += (o, args) => lastFocusedTextBox = (TextBox)o; } }); }