| 12345678910111213141516171819202122 |
- using Avalonia.Controls;
- using YZWater.Avalonia.Controls;
- namespace YZWater.Avalonia.Views;
- public partial class ViewAView : UserControl
- {
- public ViewAView()
- {
- InitializeComponent();
- if (this.FindControl<Border>("TitleBar") is Border titleBar)
- ThemeBrushBinding.BindTitleBar(titleBar);
- if (this.FindControl<TextBlock>("TitleText") is TextBlock t)
- ThemeHelper.ThemeChanged += () => t.Foreground = ThemeHelper.HeaderText;
- if (this.FindControl<TextBlock>("SubtitleText") is TextBlock s)
- ThemeHelper.ThemeChanged += () => s.Foreground = ThemeHelper.HeaderSubtext;
- if (this.FindControl<Border>("StatusBar") is Border statusBar)
- ThemeBrushBinding.BindStatusBar(statusBar);
- if (this.FindControl<Border>("RootBorder") is Border root)
- ThemeBrushBinding.BindContent(root);
- }
- }
|