|
2 | 2 | x:Class="LLCOM.Views.PacketDataView" |
3 | 3 | xmlns="https://github.com/avaloniaui" |
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
5 | | - xmlns:controls="clr-namespace:LLCOM.Controls" |
6 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
7 | 6 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
8 | 7 | xmlns:u="https://irihi.tech/ursa" |
|
15 | 14 | <vm:PacketDataViewModel /> |
16 | 15 | </Design.DataContext> |
17 | 16 | <UserControl.Styles> |
| 17 | + <!-- 防止ListBoxItem被选中时背景色变化 --> |
18 | 18 | <Style Selector="ListBoxItem"> |
19 | | - <Setter Property="Padding" Value="0 0 0 5" /> |
| 19 | + <Setter Property="Padding" Value="0 0 0 3" /> |
20 | 20 | </Style> |
21 | 21 | <Style Selector="ListBoxItem:pointerover"> |
22 | 22 | <Setter Property="Background" Value="Transparent" /> |
23 | 23 | </Style> |
24 | 24 | <Style Selector="ListBoxItem:selected"> |
25 | 25 | <Setter Property="Background" Value="Transparent" /> |
26 | 26 | </Style> |
| 27 | + <!-- 几种颜色的样式 --> |
| 28 | + <Style Selector="PacketDataControl.Green"> |
| 29 | + <Setter Property="MainColor" Value="{DynamicResource SemiGreen8}" /> |
| 30 | + <Setter Property="Icon" Value="" /> |
| 31 | + </Style> |
| 32 | + <Style Selector="PacketDataControl.Red"> |
| 33 | + <Setter Property="MainColor" Value="{DynamicResource SemiRed8}" /> |
| 34 | + <Setter Property="Icon" Value="" /> |
| 35 | + </Style> |
| 36 | + <Style Selector="PacketDataControl.Black"> |
| 37 | + <Setter Property="MainColor" Value="{DynamicResource SemiGrey8}" /> |
| 38 | + <Setter Property="Icon" Value="" /> |
| 39 | + </Style> |
27 | 40 | </UserControl.Styles> |
28 | 41 | <Grid RowDefinitions="auto *"> |
29 | 42 | <ListBox |
|
34 | 47 | ItemsSource="{Binding PacketData}"> |
35 | 48 | <ListBox.ItemTemplate> |
36 | 49 | <DataTemplate> |
37 | | - <controls:PacketDataControl |
| 50 | + <PacketDataControl |
38 | 51 | Margin="5,0,10,0" |
| 52 | + Classes.Black="{Binding IsWayUnknown}" |
| 53 | + Classes.Green="{Binding IsWaySend}" |
| 54 | + Classes.Red="{Binding IsWayReceive}" |
39 | 55 | Extra="{Binding Extra}" |
40 | | - Header="{Binding TagString}" |
| 56 | + Header="{Binding Channel}" |
41 | 57 | Hex="{Binding HexString}" |
42 | | - MainColor="{DynamicResource SemiGreen8}" |
43 | 58 | Text="{Binding String}" /> |
44 | 59 | </DataTemplate> |
45 | 60 | </ListBox.ItemTemplate> |
|
53 | 68 | Margin="5" |
54 | 69 | HorizontalAlignment="Right" |
55 | 70 | Orientation="Horizontal" |
56 | | - Spacing="5"> |
57 | | - <CheckBox VerticalAlignment="Center" Content="转义不可见字符" /> |
| 71 | + Spacing="8"> |
| 72 | + <CheckBox |
| 73 | + VerticalAlignment="Center" |
| 74 | + Content="转义不可见字符" |
| 75 | + ToolTip.Tip="仅在UTF-8编码时生效" /> |
58 | 76 | <CheckBox |
59 | 77 | VerticalAlignment="Center" |
60 | 78 | Content="Hex模式" |
|
0 commit comments