|
337 | 337 | </Setter>
|
338 | 338 | </Style>
|
339 | 339 |
|
340 |
| - <Style TargetType="StackPanel" x:Key="TestPanel"> |
341 |
| - <Setter Property="Background" Value="#ff0000"/> |
| 340 | + <Style x:Key="FlatButtonStyle" TargetType="Button"> |
| 341 | + <Setter Property="Background" Value="#FFE2E2E2"/> |
| 342 | + <Setter Property="Foreground" Value="Black"/> |
| 343 | + <Setter Property="BorderThickness" Value="0"/> |
| 344 | + <Setter Property="Padding" Value="12,4,12,4"/> |
| 345 | + <Setter Property="Cursor" Value="Hand"/> |
| 346 | + <Setter Property="HorizontalContentAlignment" Value="Center"/> |
| 347 | + <Setter Property="VerticalContentAlignment" Value="Center"/> |
| 348 | + <Setter Property="Template"> |
| 349 | + <Setter.Value> |
| 350 | + <ControlTemplate TargetType="Button"> |
| 351 | + <Border x:Name="OuterBorder" |
| 352 | + Background="{TemplateBinding Background}" |
| 353 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 354 | + BorderThickness="{TemplateBinding BorderThickness}"> |
| 355 | + <VisualStateManager.VisualStateGroups> |
| 356 | + <VisualStateGroup Name="CommonStates"> |
| 357 | + <VisualState Name="Normal"> |
| 358 | + </VisualState> |
| 359 | + <VisualState Name="PointerOver"> |
| 360 | + <Storyboard> |
| 361 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="InnerBorder"> |
| 362 | + <DiscreteObjectKeyFrame KeyTime="0" Value="#11000000"/> |
| 363 | + </ObjectAnimationUsingKeyFrames> |
| 364 | + </Storyboard> |
| 365 | + </VisualState> |
| 366 | + <VisualState Name="Pressed"> |
| 367 | + <Storyboard> |
| 368 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="InnerBorder"> |
| 369 | + <DiscreteObjectKeyFrame KeyTime="0" Value="#22000000"/> |
| 370 | + </ObjectAnimationUsingKeyFrames> |
| 371 | + </Storyboard> |
| 372 | + </VisualState> |
| 373 | + <VisualState Name="Disabled"> |
| 374 | + <Storyboard> |
| 375 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="InnerBorder"> |
| 376 | + <DiscreteObjectKeyFrame KeyTime="0" Value="#33FFFFFF"/> |
| 377 | + </ObjectAnimationUsingKeyFrames> |
| 378 | + </Storyboard> |
| 379 | + </VisualState> |
| 380 | + </VisualStateGroup> |
| 381 | + </VisualStateManager.VisualStateGroups> |
| 382 | + <Border x:Name="InnerBorder" |
| 383 | + Background="{TemplateBinding Background}"> |
| 384 | + <ContentPresenter x:Name="ContentPresenter" |
| 385 | + ContentTemplate="{TemplateBinding ContentTemplate}" |
| 386 | + Content="{TemplateBinding Content}" |
| 387 | + Margin="{TemplateBinding Padding}" |
| 388 | + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 389 | + VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
| 390 | + </Border> |
| 391 | + </Border> |
| 392 | + </ControlTemplate> |
| 393 | + </Setter.Value> |
| 394 | + </Setter> |
342 | 395 | </Style>
|
343 |
| - <!--<Style TargetType="StackPanel" BasedOn="TestPanel"/>--> |
344 | 396 | </ResourceDictionary>
|
0 commit comments