From 4ffd3c3e2a7f5d888ff4c02354e93bda0f9da42f Mon Sep 17 00:00:00 2001 From: Rutherther Date: Fri, 3 Feb 2023 22:51:45 +0100 Subject: [PATCH] feat: add custom host window --- src/PacketLogger/ViewModels/DockFactory.cs | 2 +- src/PacketLogger/Views/HostWindow.axaml | 24 ++++++++++++++++ src/PacketLogger/Views/HostWindow.axaml.cs | 32 ++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 src/PacketLogger/Views/HostWindow.axaml create mode 100644 src/PacketLogger/Views/HostWindow.axaml.cs diff --git a/src/PacketLogger/ViewModels/DockFactory.cs b/src/PacketLogger/ViewModels/DockFactory.cs index 1088c8b..37b6426 100644 --- a/src/PacketLogger/ViewModels/DockFactory.cs +++ b/src/PacketLogger/ViewModels/DockFactory.cs @@ -8,7 +8,6 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Reactive; -using System.Reactive.Linq; using Dock.Avalonia.Controls; using Dock.Model.Controls; using Dock.Model.Core; @@ -20,6 +19,7 @@ using PacketLogger.Models; using PacketLogger.Models.Packets; using PacketLogger.Views; using ReactiveUI; +using HostWindow = PacketLogger.Views.HostWindow; namespace PacketLogger.ViewModels; diff --git a/src/PacketLogger/Views/HostWindow.axaml b/src/PacketLogger/Views/HostWindow.axaml new file mode 100644 index 0000000..5783127 --- /dev/null +++ b/src/PacketLogger/Views/HostWindow.axaml @@ -0,0 +1,24 @@ + + + + + + + + + + + + diff --git a/src/PacketLogger/Views/HostWindow.axaml.cs b/src/PacketLogger/Views/HostWindow.axaml.cs new file mode 100644 index 0000000..dda718f --- /dev/null +++ b/src/PacketLogger/Views/HostWindow.axaml.cs @@ -0,0 +1,32 @@ +// +// HostWindow.axaml.cs +// +// Copyright (c) František Boháček. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using PropertyChanged; + +namespace PacketLogger.Views; + +[DoNotNotify] +public partial class HostWindow : Dock.Avalonia.Controls.HostWindow +{ + /// + /// Initializes a new instance of the class. + /// + public HostWindow() + { + InitializeComponent(); +#if DEBUG + this.AttachDevTools(); +#endif + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } +} \ No newline at end of file -- 2.49.0