~ruther/NosTale-PacketLogger

4ffd3c3e2a7f5d888ff4c02354e93bda0f9da42f — Rutherther 2 years ago bff42b1
feat: add custom host window
M src/PacketLogger/ViewModels/DockFactory.cs => src/PacketLogger/ViewModels/DockFactory.cs +1 -1
@@ 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;


A src/PacketLogger/Views/HostWindow.axaml => src/PacketLogger/Views/HostWindow.axaml +24 -0
@@ 0,0 1,24 @@
<HostWindow xmlns="https://github.com/avaloniaui"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
            mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
            x:Class="PacketLogger.Views.HostWindow"
            Title="HostWindow"
            ExtendClientAreaToDecorationsHint="True">
    <Grid RowDefinitions="32,*">

        <ExperimentalAcrylicBorder Grid.Row="0" IsHitTestVisible="False">
            <ExperimentalAcrylicBorder.Material>
                <ExperimentalAcrylicMaterial
                    BackgroundSource="Digger"
                    TintColor="Black"
                    TintOpacity="1"
                    MaterialOpacity="0.65" />
            </ExperimentalAcrylicBorder.Material>
        </ExperimentalAcrylicBorder>

        <DockControl Grid.Row="1" Grid.Column="0" x:Name="DockControl" Layout="{Binding}"
                     Margin="0" />
    </Grid>
</HostWindow>

A src/PacketLogger/Views/HostWindow.axaml.cs => src/PacketLogger/Views/HostWindow.axaml.cs +32 -0
@@ 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
{
    /// <summary>
    /// Initializes a new instance of the <see cref="HostWindow"/> class.
    /// </summary>
    public HostWindow()
    {
        InitializeComponent();
#if DEBUG
        this.AttachDevTools();
#endif
    }

    private void InitializeComponent()
    {
        AvaloniaXamlLoader.Load(this);
    }
}
\ No newline at end of file

Do not follow this link