protected override void OnNavigatedTo(NavigationEventArgs e) { var args = e.Parameter as SinglePanelArgs; ApplicationView.GetForCurrentView().FullScreenSystemOverlayMode = FullScreenSystemOverlayMode.Minimal; ApplicationView.GetForCurrentView().TryEnterFullScreenMode(); MainGrid.Background = new SolidColorBrush(args.BackColor); // Populate the column foreach (Doc doc in Common.Docs) { foreach (Translation translation in doc.Translations) { if (translation.Language == args.Language) { foreach (UIElement element in DocumentUIFactory.CreateBlocksFromTranslation(translation, args.ForeColor)) { ContentPanel.Children.Add(element); } } } } 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; } }); }
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); }
protected override void OnNavigatedTo(NavigationEventArgs e) { var args = e.Parameter as DoublePanelArgs; ApplicationView.GetForCurrentView().FullScreenSystemOverlayMode = FullScreenSystemOverlayMode.Minimal; ApplicationView.GetForCurrentView().TryEnterFullScreenMode(); MainGrid.Background = new SolidColorBrush(args.BackColor); // Populate the left and right columns foreach (Doc doc in Common.Docs) { foreach (Translation translation in doc.Translations) { if (translation.Language == args.Language1) { foreach (UIElement element in DocumentUIFactory.CreateBlocksFromTranslation(translation, args.ForeColor)) { ContentPanelLeft.Children.Add(element); } } else if (translation.Language == args.Language2) { foreach (UIElement element in DocumentUIFactory.CreateBlocksFromTranslation(translation, args.ForeColor)) { ContentPanelRight.Children.Add(element); } } } } #region Right //switch (args.Language2) //{ // #region English // case Language.English: // foreach (CoptLib.XML.Doc doc in Common.Docs.Where(d => d.Language == Language.English)) // { // foreach (string content in doc.Content) // { // var contentBlockE = new TextBlock // { // Text = content, // FontFamily = Common.Segoe, // FontSize = Common.GetEnglishFontSize(), // TextWrapping = TextWrapping.Wrap, // Foreground = new SolidColorBrush(args.ForeColor.ToUiColor()) // }; // ContentPanelRight.Children.Add(contentBlockE); // } // } // break; // #endregion // #region Coptic // case Language.Coptic: // foreach (CoptLib.XML.Doc doc in Common.Docs.Where(d => d.Language == Language.Coptic)) // { // foreach (string content in doc.Content) // { // string cont = CopticInterpreter.ConvertFont(content, CopticFont.CsAvvaShenouda, CopticFont.CopticUnicode); // var contentBlockC = new TextBlock // { // Text = cont.Replace(" ", " \u200B"), // FontFamily = Common.Segoe, // FontSize = Common.GetCopticFontSize(), // TextWrapping = TextWrapping.Wrap, // Foreground = new SolidColorBrush(args.ForeColor.ToUiColor()) // }; // ContentPanelRight.Children.Add(contentBlockC); // } // } // break; // #endregion // #region Arabic // // TODO: Support Arabic text // case Language.Arabic: // var contentBlockA = new TextBlock // { // Text = "\n", // FontFamily = Common.Segoe, // FontSize = 40, // TextWrapping = TextWrapping.WrapWholeWords // }; // ContentPanelRight.Children.Add(contentBlockA); // break; // #endregion //} #endregion base.OnNavigatedTo(e); }