WPF-Styling Rahmenstärke auf trigger

Habe ich die folgenden definierten Stil...

<!-- Blue Button -->
<Style x:Key="BlueButton" TargetType="{x:Type Button}">
  <Setter Property="OverridesDefaultStyle" Value="True"/>
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="Button">                   
     <Border Name="border" 
        BorderThickness="2"
        Padding="4,2" 
        CornerRadius="5" 
        BorderBrush="{TemplateBinding BorderBrush}"
        Background="{TemplateBinding Background}">
      <Grid >
        <ContentPresenter 
        HorizontalAlignment="Center" 
        VerticalAlignment="Center" 
        Name="content"/>
      </Grid>
    </Border>
    <ControlTemplate.Triggers>
      <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="Background" Value="{DynamicResource BlueGradientOver}"/>
        <Setter Property="BorderBrush" Value="White"/>
      </Trigger>
      <Trigger Property="IsEnabled" Value="False">
        <Setter Property="Background" Value="Black"/>
        <Setter Property="BorderBrush" Value="White"/>
        <!-- how do I set the BorderThickness here? -->
        <Setter Property="Foreground" Value="White"/>
      </Trigger>             
      <Trigger Property="IsPressed" Value="True">
        <Setter Property="Background" Value="{DynamicResource BlueGradient4}"/>
        <Setter Property="BorderBrush" Value="{DynamicResource BlueGradient1}"/>
      </Trigger>
    </ControlTemplate.Triggers>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
  <Setter Property="SnapsToDevicePixels" Value="true"/>
  <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
  <Setter Property="Background" Value="{DynamicResource BlueGradient1}"/>
  <Setter Property="BorderBrush" Value="{DynamicResource BlueGradient2}"/>
  <Setter Property="Foreground" Value="White"/>
  <Setter Property="HorizontalContentAlignment" Value="Center"/>
  <Setter Property="VerticalContentAlignment" Value="Center"/>
  <Setter Property="TextBox.TextAlignment" Value="Center"/>  
  <Setter Property="FontFamily" Value="Trebuchet MS"/>
  <Setter Property="FontSize" Value="15pt"/>
  <Setter Property="Effect" Value="{DynamicResource KioskStandardDropShadow}" />
  <Setter Property="IsEnabled" Value="True"/>
</Style>

Möchte ich ändern BorderThickness - Eigenschaft, wenn eine Schaltfläche deaktiviert ist, aber ich kann nicht herausfinden, wie es zu tun.

  • Warum wurde dieser nach unten gestimmt?
InformationsquelleAutor ocodo | 2010-09-08
Schreibe einen Kommentar