|
17 | 17 | <CommonControls:BaseControl.Resources> |
18 | 18 |
|
19 | 19 |
|
| 20 | + <Style x:Key="HistoryPopup" TargetType="{x:Type Popup}"> |
| 21 | + <Setter Property="StaysOpen" Value="True"/> |
| 22 | + <Setter Property="PopupAnimation" Value="Fade"/> |
| 23 | + <Setter Property="AllowsTransparency" Value="True"/> |
| 24 | + <Setter Property="Width" Value="230"/> |
| 25 | + <Setter Property="Height" Value="100"/> |
| 26 | + <Setter Property="Placement" Value="Top"/> |
| 27 | + <Setter Property="VerticalOffset" Value="16"/> |
| 28 | + <Setter Property="HorizontalOffset" Value="-2"/> |
| 29 | + <Style.Triggers> |
| 30 | + <DataTrigger Binding="{Binding Orientation, RelativeSource={RelativeSource AncestorType={x:Type local:HistoryControl}}}" Value="Vertical"> |
| 31 | + <Setter Property="Placement" Value="Left"/> |
| 32 | + <Setter Property="VerticalOffset" Value="-2"/> |
| 33 | + <Setter Property="HorizontalOffset" Value="0"/> |
| 34 | + </DataTrigger> |
| 35 | + </Style.Triggers> |
| 36 | + </Style> |
| 37 | + |
| 38 | + <Style x:Key="HistoryContainer" TargetType="{x:Type Border}"> |
| 39 | + <Setter Property="Margin" Value="0,0,0,18"/> |
| 40 | + <Setter Property="CornerRadius" Value="6,6,0,0"/> |
| 41 | + <Setter Property="BorderThickness" Value="1,1,1,0"/> |
| 42 | + <Setter Property="Background" Value="#80000000"/> |
| 43 | + <Setter Property="BorderBrush" Value="{StaticResource ContainerBorder}"/> |
| 44 | + <Style.Triggers> |
| 45 | + <DataTrigger Binding="{Binding Orientation, RelativeSource={RelativeSource AncestorType={x:Type local:HistoryControl}}}" Value="Vertical"> |
| 46 | + <Setter Property="Margin" Value="0,0,0,0"/> |
| 47 | + <Setter Property="CornerRadius" Value="6,0,0,6"/> |
| 48 | + <Setter Property="BorderThickness" Value="1,1,0,1"/> |
| 49 | + </DataTrigger> |
| 50 | + </Style.Triggers> |
| 51 | + </Style> |
| 52 | + |
| 53 | + |
20 | 54 | <!--DiffusionHistory--> |
21 | 55 | <DataTemplate DataType="{x:Type Common:DiffusionHistory}"> |
22 | 56 | <Grid x:Name="Root" Background="Transparent" > |
|
56 | 90 |
|
57 | 91 |
|
58 | 92 | <!-- Popup card --> |
59 | | - <Popup x:Name="CardPopup" |
60 | | - Height="100" |
61 | | - Width="230" |
62 | | - VerticalOffset="16" |
63 | | - HorizontalOffset="-2" |
64 | | - Placement="Top" |
65 | | - StaysOpen="True" |
66 | | - PopupAnimation="Slide" |
67 | | - AllowsTransparency="True" > |
| 93 | + <Popup x:Name="CardPopup" Style="{StaticResource HistoryPopup}"> |
68 | 94 | <Border Background="#01000000"> |
69 | | - <Border Margin="0,0,0,18" Background="#80000000" BorderBrush="{StaticResource ContainerBorder}" BorderThickness="1,1,1,0" CornerRadius="6,6,0,0"> |
| 95 | + <Border Style="{StaticResource HistoryContainer}" > |
70 | 96 | <StackPanel Margin="6,4,6,6"> |
71 | 97 | <TextBlock Text="{Binding Source}" /> |
72 | 98 | <TextBlock Text="{Binding Width, StringFormat={}Width: {0}}" /> |
|
101 | 127 | </EventTrigger> |
102 | 128 | </Grid.Triggers> |
103 | 129 |
|
104 | | - |
| 130 | + |
105 | 131 | </Grid> |
106 | 132 | </DataTemplate> |
107 | 133 |
|
|
145 | 171 |
|
146 | 172 |
|
147 | 173 | <!-- Popup card --> |
148 | | - <Popup x:Name="CardPopup" |
149 | | - Height="100" |
150 | | - Width="230" |
151 | | - VerticalOffset="16" |
152 | | - HorizontalOffset="-2" |
153 | | - Placement="Top" |
154 | | - StaysOpen="True" |
155 | | - PopupAnimation="Slide" |
156 | | - AllowsTransparency="True" > |
| 174 | + <Popup x:Name="CardPopup" Style="{StaticResource HistoryPopup}"> |
157 | 175 | <Border Background="#01000000"> |
158 | | - <Border Margin="0,0,0,18" Background="#80000000" BorderBrush="{StaticResource ContainerBorder}" BorderThickness="1,1,1,0" CornerRadius="6,6,0,0"> |
| 176 | + <Border Style="{StaticResource HistoryContainer}" > |
159 | 177 | <StackPanel Margin="6,4,6,6"> |
160 | 178 | <TextBlock Text="{Binding Source}" /> |
161 | 179 | <TextBlock Text="{Binding Width, StringFormat={}Width: {0}}" /> |
|
233 | 251 |
|
234 | 252 |
|
235 | 253 | <!-- Popup card --> |
236 | | - <Popup x:Name="CardPopup" |
237 | | - Height="100" |
238 | | - Width="230" |
239 | | - VerticalOffset="16" |
240 | | - HorizontalOffset="-2" |
241 | | - Placement="Top" |
242 | | - StaysOpen="True" |
243 | | - PopupAnimation="Slide" |
244 | | - AllowsTransparency="True" > |
| 254 | + <Popup x:Name="CardPopup" Style="{StaticResource HistoryPopup}"> |
245 | 255 | <Border Background="#01000000"> |
246 | | - <Border Margin="0,0,0,18" Background="#80000000" BorderBrush="{StaticResource ContainerBorder}" BorderThickness="1,1,1,0" CornerRadius="6,6,0,0"> |
| 256 | + <Border Style="{StaticResource HistoryContainer}" > |
247 | 257 | <StackPanel Margin="6,4,6,6"> |
248 | 258 | <TextBlock Text="{Binding Source}" /> |
249 | 259 | <TextBlock Text="{Binding Width, StringFormat={}Width: {0}}" /> |
|
321 | 331 |
|
322 | 332 |
|
323 | 333 | <!-- Popup card --> |
324 | | - <Popup x:Name="CardPopup" |
325 | | - Height="100" |
326 | | - Width="230" |
327 | | - VerticalOffset="16" |
328 | | - HorizontalOffset="-2" |
329 | | - Placement="Top" |
330 | | - StaysOpen="True" |
331 | | - PopupAnimation="Slide" |
332 | | - AllowsTransparency="True" > |
| 334 | + <Popup x:Name="CardPopup" Style="{StaticResource HistoryPopup}"> |
333 | 335 | <Border Background="#01000000"> |
334 | | - <Border Margin="0,0,0,18" Background="#80000000" BorderBrush="{StaticResource ContainerBorder}" BorderThickness="1,1,1,0" CornerRadius="6,6,0,0"> |
| 336 | + <Border Style="{StaticResource HistoryContainer}" > |
335 | 337 | <StackPanel Margin="6,4,6,6"> |
336 | 338 | <TextBlock Text="{Binding Source}" /> |
337 | 339 | <TextBlock Text="{Binding Width, StringFormat={}Width: {0}}" /> |
|
416 | 418 | </ControlTemplate> |
417 | 419 | </Setter.Value> |
418 | 420 | </Setter> |
419 | | - |
420 | 421 | </Style> |
421 | 422 | </ListBox.ItemContainerStyle> |
422 | 423 | </ListBox> |
|
0 commit comments