public MainWindow() { this.InitializeComponent(); this.AttachDevTools(new Avalonia.Diagnostics.DevToolsOptions() { StartupScreenIndex = 1, }); //Renderer.DrawFps = true; //Renderer.DrawDirtyRects = Renderer.DrawFps = true; _notificationArea = new WindowNotificationManager(this) { Position = NotificationPosition.TopRight, MaxItems = 3 }; DataContext = new MainWindowViewModel(_notificationArea); _recentMenu = ((NativeMenu.GetMenu(this).Items[0] as NativeMenuItem).Menu.Items[2] as NativeMenuItem).Menu; var mainMenu = this.FindControl <Menu>("MainMenu"); mainMenu.AttachedToVisualTree += MenuAttached; ExtendClientAreaChromeHints = Avalonia.Platform.ExtendClientAreaChromeHints.OSXThickTitleBar; }
public static void SetNotificationManager(Window host) { var notificationManager = new WindowNotificationManager(host) { Position = NotificationPosition.BottomRight, MaxItems = 4, Margin = new Thickness(0, 0, 15, 40) }; NotificationManager = notificationManager; }
public override void OnFrameworkInitializationCompleted() { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { desktop.MainWindow = new MainWindow(); _notificationManager = new WindowNotificationManager(desktop.MainWindow); desktop.MainWindow.DataContext = new MainWindowViewModel(_notificationManager); } base.OnFrameworkInitializationCompleted(); }
public MainWindow() { InitializeComponent(); _notificationArea = new WindowNotificationManager(this) { Position = NotificationPosition.TopRight, MaxItems = 2 }; DataContext = new MainWindowViewModel(this, _notificationArea); clientPage = this.FindControl <ClientPage>("ClientPage"); }
public MainWindow() { this.InitializeComponent(); this.AttachDevTools(); //Renderer.DrawFps = true; //Renderer.DrawDirtyRects = Renderer.DrawFps = true; _notificationArea = new WindowNotificationManager(this) { Position = NotificationPosition.TopRight, MaxItems = 3 }; DataContext = new MainWindowViewModel(_notificationArea); }
/// <summary> /// Registers the controls. /// </summary> /// <param name="container">The container.</param> private void RegisterControls(Container container) { var notificationFactory = new NotificationFactory(); container.RegisterInitializer(d => { var notificationManager = new WindowNotificationManager(d.Instance as MainWindow) { Position = NotificationPosition.BottomRight, MaxItems = 3 }; notificationFactory.SetManager(notificationManager); }, ctx => ctx.Registration.ImplementationType == typeof(MainWindow)); container.RegisterInstance <INotificationFactory>(notificationFactory); }
public MainWindow(MyDbContext db) { InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif _db = db; _notificationArea = new WindowNotificationManager(this) { Position = NotificationPosition.TopRight, MaxItems = 3 }; DataContext = new MainWindowViewModel(_db, _notificationArea); (DataContext as MainWindowViewModel).MainWindow = this; }
public MainWindow() { InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif var notificationManager = new WindowNotificationManager(this) { Position = NotificationPosition.BottomRight, MaxItems = 4, Margin = new Thickness(0, 0, 15, 40) }; Locator.CurrentMutable.RegisterConstant <INotificationManager>(notificationManager); }
public MainWindow() { this.InitializeComponent(); //Renderer.DrawFps = true; //Renderer.DrawDirtyRects = Renderer.DrawFps = true; _notificationArea = new WindowNotificationManager(this) { Position = NotificationPosition.TopRight, MaxItems = 3 }; DataContext = new MainWindowViewModel(_notificationArea); _recentMenu = ((NativeMenu.GetMenu(this)?.Items[0] as NativeMenuItem)?.Menu?.Items[2] as NativeMenuItem)?.Menu; }
public MainWindow() { this.InitializeComponent(); //Renderer.DrawFps = true; //Renderer.DrawDirtyRects = Renderer.DrawFps = true; _notificationArea = new WindowNotificationManager(this) { Position = NotificationPosition.TopRight, MaxItems = 3 }; DataContext = new MainWindowViewModel(_notificationArea); _recentMenu = ((NativeMenu.GetMenu(this).Items[0] as NativeMenuItem).Menu.Items[2] as NativeMenuItem).Menu; ExtendClientAreaChromeHints = Avalonia.Platform.ExtendClientAreaChromeHints.OSXThickTitleBar; }
public MainWindow() { this.InitializeComponent(); this.AttachDevTools(); //Renderer.DrawFps = true; //Renderer.DrawDirtyRects = Renderer.DrawFps = true; _notificationArea = new WindowNotificationManager(this) { Position = NotificationPosition.TopRight, MaxItems = 3 }; DataContext = new MainWindowViewModel(_notificationArea); _recentMenu = ((NativeMenu.GetMenu(this).Items[0] as NativeMenuItem).Menu.Items[2] as NativeMenuItem).Menu; var mainMenu = this.FindControl <Menu>("MainMenu"); mainMenu.AttachedToVisualTree += MenuAttached; }
public MainWindow() { InitializeComponent(); #if DEBUG this.AttachDevTools(); #endif notificationManager = new WindowNotificationManager(this) { Position = NotificationPosition.TopRight, MaxItems = 3 }; var _themeSelector = this.Find <CheckBox>("themeSelector"); _themeSelector.Checked += (sender, e) => { Styles[0] = _darkTheme; }; _themeSelector.Unchecked += (sender, e) => { Styles[0] = _lightTheme; }; _lightTheme = new StyleInclude(new Uri("resm:Styles?assembly=Solria.SAFT.Desktop")) { Source = new Uri("resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default") }; _darkTheme = new StyleInclude(new Uri("resm:Styles?assembly=Solria.SAFT.Desktop")) { Source = new Uri("resm:Avalonia.Themes.Default.Accents.BaseDark.xaml?assembly=Avalonia.Themes.Default") }; Styles.Add(_darkTheme); txtMessage = this.Find <TextBlock>("messages"); this.WhenActivated(disposables => { Disposable.Create(() => { }) .DisposeWith(disposables); }); }