|
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 | 4 | xmlns:controls="using:LLCOM.Controls"> |
5 | 5 | <Design.PreviewWith> |
6 | | - <StackPanel Width="500"> |
| 6 | + <StackPanel Width="500" Height="400"> |
7 | 7 | <controls:PacketDataControl |
8 | 8 | Extra="2025/03/11 - 11:22:33.123" |
9 | 9 | Header="串口1" |
|
39 | 39 | <Style Selector="controls|PacketDataControl"> |
40 | 40 | <Setter Property="Template"> |
41 | 41 | <ControlTemplate> |
42 | | - <StackPanel> |
43 | | - <Grid> |
44 | | - <Border |
45 | | - HorizontalAlignment="Left" |
46 | | - Background="{TemplateBinding MainColor}" |
47 | | - BorderBrush="{TemplateBinding MainColor}" |
48 | | - BorderThickness="1,1,1,0" |
49 | | - CornerRadius="5 5 0 0"> |
50 | | - <StackPanel |
51 | | - Margin="6,2" |
52 | | - Orientation="Horizontal" |
53 | | - Spacing="4"> |
54 | | - <TextBlock |
55 | | - VerticalAlignment="Center" |
56 | | - FontFamily="{DynamicResource Phosphor}" |
57 | | - FontSize="12" |
58 | | - Foreground="{DynamicResource SemiColorHighlight}" |
59 | | - Text="{TemplateBinding Icon}" /> |
60 | | - <TextBlock |
61 | | - FontSize="12" |
62 | | - Foreground="{DynamicResource SemiColorHighlight}" |
63 | | - Text="{TemplateBinding Header}" /> |
64 | | - </StackPanel> |
65 | | - </Border> |
66 | | - <SelectableTextBlock |
67 | | - Margin="0,2,10,0" |
68 | | - HorizontalAlignment="Right" |
69 | | - FontSize="12" |
70 | | - FontWeight="Bold" |
71 | | - Text="{TemplateBinding Extra}" /> |
72 | | - </Grid> |
| 42 | + <StackPanel Background="Transparent"> |
73 | 43 | <Border |
74 | 44 | BorderBrush="{TemplateBinding MainColor}" |
75 | 45 | BorderThickness="1" |
76 | | - CornerRadius="0 5 5 5"> |
| 46 | + CornerRadius="{TemplateBinding DataBorderCornerRadius}"> |
77 | 47 | <StackPanel Margin="5" Spacing="2"> |
78 | 48 | <SelectableTextBlock |
79 | 49 | Background="Transparent" |
|
98 | 68 | TextWrapping="Wrap" /> |
99 | 69 | </StackPanel> |
100 | 70 | </Border> |
| 71 | + <Grid Height="{TemplateBinding HeaderHeight}"> |
| 72 | + <Grid.Transitions> |
| 73 | + <Transitions> |
| 74 | + <DoubleTransition Property="Height" Duration="0:0:0.05" /> |
| 75 | + </Transitions> |
| 76 | + </Grid.Transitions> |
| 77 | + <Border |
| 78 | + HorizontalAlignment="Left" |
| 79 | + Background="{TemplateBinding MainColor}" |
| 80 | + BorderBrush="{TemplateBinding MainColor}" |
| 81 | + CornerRadius="0 0 5 5"> |
| 82 | + <StackPanel |
| 83 | + Margin="6,2" |
| 84 | + Orientation="Horizontal" |
| 85 | + Spacing="4"> |
| 86 | + <TextBlock |
| 87 | + VerticalAlignment="Center" |
| 88 | + FontFamily="{DynamicResource Phosphor}" |
| 89 | + FontSize="12" |
| 90 | + Foreground="{DynamicResource SemiColorHighlight}" |
| 91 | + Text="{TemplateBinding Icon}" /> |
| 92 | + <TextBlock |
| 93 | + VerticalAlignment="Center" |
| 94 | + FontSize="12" |
| 95 | + Foreground="{DynamicResource SemiColorHighlight}" |
| 96 | + Text="{TemplateBinding Header}" /> |
| 97 | + </StackPanel> |
| 98 | + </Border> |
| 99 | + <SelectableTextBlock |
| 100 | + Margin="0,0,10,0" |
| 101 | + HorizontalAlignment="Right" |
| 102 | + VerticalAlignment="Center" |
| 103 | + FontSize="12" |
| 104 | + FontWeight="Bold" |
| 105 | + Text="{TemplateBinding Extra}" /> |
| 106 | + </Grid> |
101 | 107 | </StackPanel> |
102 | 108 | </ControlTemplate> |
103 | 109 | </Setter> |
|
0 commit comments