~ruther/NosTale-PacketLogger

ref: b7a938bde6948c2b71507f3c173e23ec6d6df1ff NosTale-PacketLogger/src/PacketLogger/Views/PacketLogDocumentView.axaml -rw-r--r-- 5.2 KiB
b7a938bd — Rutherther feat: replace datagrid with listbox for better performance 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<UserControl 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"
             xmlns:views="clr-namespace:PacketLogger.Views"
             xmlns:viewModels="clr-namespace:PacketLogger.ViewModels"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             xmlns:i="clr-namespace:Projektanker.Icons.Avalonia;assembly=Projektanker.Icons.Avalonia"
             x:Class="PacketLogger.Views.PacketLogDocumentView">
    <Design.DataContext>
        <viewModels:PacketLogDocumentViewModel />
    </Design.DataContext>

    <Grid>
        <Border IsVisible="{Binding !Loaded}"
                MaxWidth="1000" MaxHeight="600"
                CornerRadius="25"
                Background="{DynamicResource SystemControlPageBackgroundChromeLowBrush}">
            <Grid Margin="50">
                <Grid ColumnDefinitions="*,*" RowDefinitions="60, 80, 80, *">
                    <Grid.Styles>
                        <Style Selector="Button.open">
                            <Setter Property="FontSize" Value="24"></Setter>
                            <Setter Property="Width" Value="200" />
                            <Setter Property="Height" Value="60" />
                            <Setter Property="Margin" Value="0" />
                        </Style>
                        <Style Selector="Button.open i|Icon">
                            <Setter Property="Margin" Value="0,0,5,0"></Setter>
                        </Style>
                        <Style Selector="Button.open TextBlock">
                            <Setter Property="Margin" Value="5, 0, 0, 0"></Setter>
                        </Style>
                        <Style Selector="Button.open Border">
                            <Setter Property="BorderThickness" Value="1" />
                            <Setter Property="BorderBrush" Value="{DynamicResource TextControlForeground}"></Setter>
                        </Style>
                    </Grid.Styles>

                    <TextBlock Grid.Row="0" Grid.Column="0" Margin="-10,0,0,0" FontSize="34" Text="Packet Logger" />

                    <Button Grid.Row="1" Grid.Column="0"
                            Classes="open"
                            IsEnabled="{Binding !Loading}"
                            Command="{Binding OpenFile}">
                        <StackPanel VerticalAlignment="Center" Orientation="Horizontal">
                            <i:Icon HorizontalAlignment="Left" Value="mdi-file-document-outline" />
                            <Border></Border>
                            <TextBlock HorizontalAlignment="Right" Text="Open File" />
                        </StackPanel>
                    </Button>
                    <Button Grid.Row="2" Grid.Column="0"
                            Classes="open"
                            IsEnabled="{Binding !Loading}"
                            Command="{Binding OpenDummy}">
                        <StackPanel VerticalAlignment="Center" Orientation="Horizontal">
                            <i:Icon HorizontalAlignment="Left" Value="mdi-file-document-plus-outline" />
                            <Border></Border>
                            <TextBlock HorizontalAlignment="Right" Text="Open Empty" />
                        </StackPanel>
                    </Button>

                    <StackPanel Grid.Row="3" Grid.Column="0" Orientation="Vertical">
                        <TextBlock FontSize="30" Margin="0,0,0,5" Text="Connect to NosTale process" />
                        <DataGrid Margin="0,0,30,0" Items="{Binding Processes}">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="Character" Binding="{Binding CharacterString}" />
                                <DataGridTextColumn Header="Process" Binding="{Binding ProcessString}" />
                                <DataGridTemplateColumn Header="Connect">
                                    <DataGridTemplateColumn.CellTemplate>
                                        <DataTemplate>
                                            <Button Content="Connect"
                                                    Command="{Binding $parent[UserControl].DataContext.OpenProcess}"
                                                    IsEnabled="{Binding !$parent[UserControl].DataContext.Loading}"
                                                    CommandParameter="{Binding }" />
                                        </DataTemplate>
                                    </DataGridTemplateColumn.CellTemplate>
                                </DataGridTemplateColumn>
                            </DataGrid.Columns>
                        </DataGrid>
                    </StackPanel>

                    <TextBlock Grid.Row="0" Grid.Column="1" FontSize="34" Margin="-10,0,0,0" Text="Packet Sender" />

                    <TextBlock Grid.Row="1" Grid.Column="1" Text="To be implemented..." />
                </Grid>
            </Grid>
        </Border>

        <ContentControl IsVisible="{Binding Loaded}" Content="{Binding  LogViewModel}" />
    </Grid>
</UserControl>
Do not follow this link