private void AlertBar_Show(object sender, RoutedEventArgs e) { var spStandard = (StackPanel)AlertBar.FindName("spStandard"); var spOutline = (StackPanel)AlertBar.FindName("spOutline"); Grid grdParent; switch (AlertBar.Theme) { case DivinityModManager.Controls.AlertBar.ThemeType.Standard: grdParent = spStandard.FindVisualChildren <Grid>().FirstOrDefault(); break; case DivinityModManager.Controls.AlertBar.ThemeType.Outline: default: grdParent = spOutline.FindVisualChildren <Grid>().FirstOrDefault(); break; } TextBlock lblMessage = grdParent.FindVisualChildren <TextBlock>().FirstOrDefault(); if (lblMessage != null) { Trace.WriteLine(lblMessage.Text); } }
public void SlideUpAlert() { if (alertBarVisible) { return; } DoubleAnimation animation = new DoubleAnimation(); animation.From = 0d; animation.To = 30d; animation.Duration = TimeSpan.FromSeconds(.5d); alertBarVisible = true; AlertBar.BeginAnimation(HeightProperty, animation); }
public void SlideDownAlert() { if (!alertBarVisible) { return; } DoubleAnimation animation = new DoubleAnimation(); animation.From = 30d; animation.To = 0d; animation.Duration = TimeSpan.FromSeconds(.5d); alertBarVisible = false; alertBarPriorityAlert = false; AlertBar.BeginAnimation(HeightProperty, animation); }
private void ResetButton_Click(object sender, RoutedEventArgs e) { VersionData.ParseInt(268435456); VersionNumberTextBox.Text = "268435456"; AlertBar.SetWarningAlert($"Reset version number."); }
private void CopyButton_Click(object sender, RoutedEventArgs e) { Clipboard.SetText(VersionData.VersionInt.ToString()); AlertBar.SetSuccessAlert($"Copied {VersionData.VersionInt} to the clipboard."); }
public AlertBarAutomationPeer(AlertBar owner) : base(owner) { alertBar = owner; }