using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; using Avalonia.Media; using System.Windows.Input; namespace PatchGenerator.CustomControls { public partial class TitleBar : UserControl { public TitleBar() { InitializeComponent(); } private void InitializeComponent() { AvaloniaXamlLoader.Load(this); } public static readonly StyledProperty TitleProperty = AvaloniaProperty.Register(nameof(Title)); public string Title { get => GetValue(TitleProperty); set => SetValue(TitleProperty, value); } public static readonly StyledProperty XButtonForegroundProperty = AvaloniaProperty.Register(nameof(XButtonForeground)); public IBrush XButtonForeground { get => GetValue(XButtonForegroundProperty); set => SetValue(XButtonForegroundProperty, value); } public static new readonly StyledProperty ForegroundProperty = AvaloniaProperty.Register(nameof(Foreground)); public new IBrush Foreground { get => GetValue(ForegroundProperty); set => SetValue(ForegroundProperty, value); } public static new readonly StyledProperty BackgroundProperty = AvaloniaProperty.Register(nameof(Background)); public new IBrush Background { get => GetValue(BackgroundProperty); set => SetValue(BackgroundProperty, value); } //Close Button Command (X Button) Property public static readonly StyledProperty XButtonCommandProperty = AvaloniaProperty.Register(nameof(XButtonCommand)); public ICommand XButtonCommand { get => GetValue(XButtonCommandProperty); set => SetValue(XButtonCommandProperty, value); } } }