|
336 | 336 | </Setter.Value> |
337 | 337 | </Setter> |
338 | 338 | </Style> |
| 339 | + |
| 340 | + |
| 341 | + <Style x:Key="ColorButton.FocusVisual"> |
| 342 | + <Setter Property="Control.Template"> |
| 343 | + <Setter.Value> |
| 344 | + <ControlTemplate> |
| 345 | + <Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/> |
| 346 | + </ControlTemplate> |
| 347 | + </Setter.Value> |
| 348 | + </Setter> |
| 349 | + </Style> |
| 350 | + <SolidColorBrush x:Key="ColorButton.Static.Background" Color="#FFDDDDDD"/> |
| 351 | + <SolidColorBrush x:Key="ColorButton.Static.Border" Color="#FF707070"/> |
| 352 | + <SolidColorBrush x:Key="ColorButton.MouseOver.Background" Color="#FFBEE6FD"/> |
| 353 | + <SolidColorBrush x:Key="ColorButton.MouseOver.Border" Color="#FF3C7FB1"/> |
| 354 | + <SolidColorBrush x:Key="ColorButton.Pressed.Background" Color="#FFC4E5F6"/> |
| 355 | + <SolidColorBrush x:Key="ColorButton.Pressed.Border" Color="#FF2C628B"/> |
| 356 | + <SolidColorBrush x:Key="ColorButton.Disabled.Background" Color="#FFF4F4F4"/> |
| 357 | + <SolidColorBrush x:Key="ColorButton.Disabled.Border" Color="#FFADB2B5"/> |
| 358 | + <SolidColorBrush x:Key="ColorButton.Disabled.Foreground" Color="#FF838383"/> |
| 359 | + |
| 360 | + <Style x:Key="btnBorderOnly" TargetType="{x:Type Button}"> |
| 361 | + <Setter Property="FocusVisualStyle" Value="{StaticResource ColorButton.FocusVisual}"/> |
| 362 | + <Setter Property="Background" Value="#00000000"/> |
| 363 | + <!--<Setter Property="BorderBrush" Value="{StaticResource ColorButton.Static.Border}"/>--> |
| 364 | + <Setter Property="BorderBrush" Value="LightGray"/> |
| 365 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> |
| 366 | + <Setter Property="BorderThickness" Value="1"/> |
| 367 | + <Setter Property="HorizontalContentAlignment" Value="Center"/> |
| 368 | + <Setter Property="VerticalContentAlignment" Value="Center"/> |
| 369 | + <Setter Property="Padding" Value="1"/> |
| 370 | + <Setter Property="Template"> |
| 371 | + <Setter.Value> |
| 372 | + <ControlTemplate TargetType="{x:Type Button}"> |
| 373 | + <Border x:Name="border" CornerRadius="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> |
| 374 | + <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" |
| 375 | + RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
| 376 | + </Border> |
| 377 | + <ControlTemplate.Triggers> |
| 378 | + <Trigger Property="IsDefaulted" Value="true"> |
| 379 | + <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> |
| 380 | + </Trigger> |
| 381 | + <Trigger Property="IsMouseOver" Value="true"> |
| 382 | + <!--<Setter Property="Background" TargetName="border" Value="{StaticResource ColorButton.MouseOver.Background}"/>--> |
| 383 | + <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ColorButton.MouseOver.Border}"/> |
| 384 | + </Trigger> |
| 385 | + <Trigger Property="IsPressed" Value="true"> |
| 386 | + <!--<Setter Property="Background" TargetName="border" Value="{StaticResource ColorButton.Pressed.Background}"/>--> |
| 387 | + <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ColorButton.Pressed.Border}"/> |
| 388 | + </Trigger> |
| 389 | + <Trigger Property="IsEnabled" Value="false"> |
| 390 | + <!--<Setter Property="Background" TargetName="border" Value="{StaticResource ColorButton.Disabled.Background}"/>--> |
| 391 | + <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ColorButton.Disabled.Border}"/> |
| 392 | + <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource ColorButton.Disabled.Foreground}"/> |
| 393 | + </Trigger> |
| 394 | + </ControlTemplate.Triggers> |
| 395 | + </ControlTemplate> |
| 396 | + </Setter.Value> |
| 397 | + </Setter> |
| 398 | + </Style> |
| 399 | + |
339 | 400 | </Application.Resources> |
340 | 401 | </Application> |
0 commit comments