ViewCView.axaml.cs 889 B

12345678910111213141516171819202122
  1. using Avalonia.Controls;
  2. using YZWater.Avalonia.Controls;
  3. namespace YZWater.Avalonia.Views;
  4. public partial class ViewCView : UserControl
  5. {
  6. public ViewCView()
  7. {
  8. InitializeComponent();
  9. if (this.FindControl<Border>("TitleBar") is Border titleBar)
  10. ThemeBrushBinding.BindTitleBar(titleBar);
  11. if (this.FindControl<TextBlock>("TitleText") is TextBlock t)
  12. ThemeHelper.ThemeChanged += () => t.Foreground = ThemeHelper.HeaderText;
  13. if (this.FindControl<TextBlock>("SubtitleText") is TextBlock s)
  14. ThemeHelper.ThemeChanged += () => s.Foreground = ThemeHelper.HeaderSubtext;
  15. if (this.FindControl<Border>("StatusBar") is Border statusBar)
  16. ThemeBrushBinding.BindStatusBar(statusBar);
  17. if (this.FindControl<Border>("RootBorder") is Border root)
  18. ThemeBrushBinding.BindContent(root);
  19. }
  20. }