/// <summary> /// Show text to the preview and projector /// </summary> private void DisplayText(string text) { //update for the projector winDis.DisplayText(text, transitionSpeed); //update text, do fade effect if (txtbPreview.Opacity == 0) { txtbPreview2.BeginAnimation(OpacityProperty, CustomAnimation.GetDouble(1, 0, transitionSpeed)); //check Bilingual if (Common.appConfig.Bilingual && text.Contains('@')) { txtbPreview.Text = ""; string[] str = text.Split('@'); txtbPreview.Inlines.Add(new Run(str[0]) { Foreground = Brushes.Yellow }); txtbPreview.Inlines.Add(new Run(str[1]) { Foreground = Brushes.White }); } else { txtbPreview.Text = text; } txtbPreview.BeginAnimation(OpacityProperty, CustomAnimation.GetDouble(0, 1, transitionSpeed)); } else { txtbPreview.BeginAnimation(OpacityProperty, CustomAnimation.GetDouble(1, 0, transitionSpeed)); //check Bilingual if (Common.appConfig.Bilingual && text.Contains('@')) { txtbPreview2.Text = ""; string[] str = text.Split('@'); txtbPreview2.Inlines.Add(new Run(str[0]) { Foreground = Brushes.Yellow }); txtbPreview2.Inlines.Add(new Run(str[1]) { Foreground = Brushes.White }); } else { txtbPreview2.Text = text; } txtbPreview2.BeginAnimation(OpacityProperty, CustomAnimation.GetDouble(0, 1, transitionSpeed)); } }
private void tgbtnControlDisplayText_Unchecked(object sender, RoutedEventArgs e) { winDis.HideText(transitionSpeed); grdText.BeginAnimation(OpacityProperty, CustomAnimation.GetDouble(1, 0, transitionSpeed)); }
private void tgbtnControlSleep_Unchecked(object sender, RoutedEventArgs e) { winDis.HideBlackCover(transitionSpeed); recBlackCover.BeginAnimation(OpacityProperty, CustomAnimation.GetDouble(1, 0, transitionSpeed)); }
/// <summary> /// Hide text /// </summary> public void HideText(double transitionSpeed) { grdText.BeginAnimation(OpacityProperty, CustomAnimation.GetDouble(1, 0, transitionSpeed)); }
/// <summary> /// Hide black cover for normal mode /// </summary> public void HideBlackCover(double transitionSpeed) { recBlackCover.BeginAnimation(OpacityProperty, CustomAnimation.GetDouble(1, 0, transitionSpeed)); }