~ruther/NosTale-PacketLogger

ref: 676e5bb566fd796d9d023b1ccbdc751d8e0bb5c2 NosTale-PacketLogger/src/PacketLogger/Views/Log/PacketLogView.axaml.cs -rw-r--r-- 1019 bytes
676e5bb5 — Rutherther feat: add possibility to save and load settings to json 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
//  PacketLogView.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 System.Linq;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using PropertyChanged;

namespace PacketLogger.Views.Log;

/// <summary>
/// A view of a packet log.
/// </summary>
[DoNotNotify]
public partial class PacketLogView : UserControl
{
    /// <summary>
    /// Initializes a new instance of the <see cref="PacketLogView"/> class.
    /// </summary>
    public PacketLogView()
    {
        InitializeComponent();
    }

    private void InitializeComponent()
    {
        AvaloniaXamlLoader.Load(this);
    }

    private void PacketsLog_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
    {
        if (sender is DataGrid dataGrid && dataGrid.SelectedItem is not null)
        {
            dataGrid.ScrollIntoView(dataGrid.SelectedItem, dataGrid.Columns.First());
        }
    }
}
Do not follow this link