Constellation06 | Code :
- <!-- Button styles -->
- <!--
- TextButtonStyle is used to style a Button using subheader-styled text with no other adornment. This
- style is used in the GroupedItemsPage as a group header and in the FileOpenPickerPage for triggering
- commands.
- -->
- <Style x:Key="TextButtonStyle" TargetType="Button">
- <Setter Property="MinWidth" Value="0"/>
- <Setter Property="MinHeight" Value="0"/>
- <Setter Property="Margin" Value="20,15,0,0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Grid Background="Transparent">
- <TextBlock
- x:Name="Text"
- Text="{TemplateBinding Content}"
- Margin="3,-7,3,10"
- TextWrapping="NoWrap"
- Style="{StaticResource SubheaderTextStyle}"/>
- <Rectangle
- x:Name="FocusVisualWhite"
- IsHitTestVisible="False"
- Stroke="{StaticResource FocusVisualWhiteStrokeBrush}"
- StrokeEndLineCap="Square"
- StrokeDashArray="1,1"
- Opacity="0"
- StrokeDashOffset="1.5"/>
- <Rectangle
- x:Name="FocusVisualBlack"
- IsHitTestVisible="False"
- Stroke="{StaticResource FocusVisualBlackStrokeBrush}"
- StrokeEndLineCap="Square"
- StrokeDashArray="1,1"
- Opacity="0"
- StrokeDashOffset="0.5"/>
- <VisualStateManager.VisualStateGroups>
- <VisualStateGroup x:Name="CommonStates">
- <VisualState x:Name="Normal"/>
- <VisualState x:Name="PointerOver">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationHoverTextBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Pressed">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPressedTextBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Disabled">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlDisabledTextBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- <VisualStateGroup x:Name="FocusStates">
- <VisualState x:Name="Focused">
- <Storyboard>
- <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="FocusVisualWhite" Storyboard.TargetProperty="Opacity"/>
- <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="FocusVisualBlack" Storyboard.TargetProperty="Opacity"/>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Unfocused"/>
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--
- TextRadioButtonStyle is used to style a RadioButton using subheader-styled text with no other adornment.
- This style is used in the SearchResultsPage to allow selection among filters.
- -->
- <Style x:Key="TextRadioButtonStyle" TargetType="RadioButton">
- <Setter Property="MinWidth" Value="0"/>
- <Setter Property="MinHeight" Value="0"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="RadioButton">
- <Grid Background="Transparent">
- <TextBlock
- x:Name="Text"
- Text="{TemplateBinding Content}"
- Margin="3,-7,3,10"
- TextWrapping="NoWrap"
- Style="{StaticResource SubheaderTextStyle}"/>
- <Rectangle
- x:Name="FocusVisualWhite"
- IsHitTestVisible="False"
- Stroke="{StaticResource FocusVisualWhiteStrokeBrush}"
- StrokeEndLineCap="Square"
- StrokeDashArray="1,1"
- Opacity="0"
- StrokeDashOffset="1.5"/>
- <Rectangle
- x:Name="FocusVisualBlack"
- IsHitTestVisible="False"
- Stroke="{StaticResource FocusVisualBlackStrokeBrush}"
- StrokeEndLineCap="Square"
- StrokeDashArray="1,1"
- Opacity="0"
- StrokeDashOffset="0.5"/>
- <VisualStateManager.VisualStateGroups>
- <VisualStateGroup x:Name="CommonStates">
- <VisualState x:Name="Normal"/>
- <VisualState x:Name="PointerOver">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationHoverTextBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Pressed">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationPressedTextBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Disabled">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ControlDisabledTextBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- <VisualStateGroup x:Name="FocusStates">
- <VisualState x:Name="Focused">
- <Storyboard>
- <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="FocusVisualWhite" Storyboard.TargetProperty="Opacity"/>
- <DoubleAnimation Duration="0" To="1" Storyboard.TargetName="FocusVisualBlack" Storyboard.TargetProperty="Opacity"/>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Unfocused"/>
- </VisualStateGroup>
- <VisualStateGroup x:Name="CheckStates">
- <VisualState x:Name="Checked"/>
- <VisualState x:Name="Unchecked">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ApplicationSecondaryTextBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Indeterminate"/>
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--
- AppBarButtonStyle is used to style a Button for use in an App Bar. Content will be centered and should fit within
- the 40-pixel radius glyph provided. 16-point Segoe UI Symbol is used for content text to simplify the use of glyphs
- from that font. AutomationProperties.Name is used for the text below the glyph.
- -->
- <Style x:Key="AppBarButtonStyle" TargetType="Button">
- <Setter Property="Foreground" Value="{StaticResource AppBarItemForegroundBrush}"/>
- <Setter Property="VerticalAlignment" Value="Stretch"/>
- <Setter Property="FontFamily" Value="Segoe UI Symbol"/>
- <Setter Property="FontWeight" Value="Normal"/>
- <Setter Property="FontSize" Value="21.333"/>
- <Setter Property="AutomationProperties.ItemType" Value="App Bar Button"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Grid Width="100" Background="Transparent">
- <StackPanel VerticalAlignment="Top" Margin="0,14,0,13">
- <Grid Width="40" Height="40" Margin="0,0,0,5" HorizontalAlignment="Center">
- <TextBlock x:Name="BackgroundGlyph" Text="" FontFamily="Segoe UI Symbol" FontSize="53.333" Margin="-4,-19,0,0" Foreground="{StaticResource AppBarItemBackgroundBrush}"/>
- <TextBlock x:Name="OutlineGlyph" Text="" FontFamily="Segoe UI Symbol" FontSize="53.333" Margin="-4,-19,0,0"/>
- <ContentPresenter x:Name="Content" HorizontalAlignment="Center" Margin="-1,-1,0,0" VerticalAlignment="Center"/>
- </Grid>
- <TextBlock
- x:Name="TextLabel"
- Text="{TemplateBinding AutomationProperties.Name}"
- Margin="0,0,2,0"
- FontSize="12"
- TextAlignment="Center"
- Width="88"
- MaxHeight="32"
- TextTrimming="WordEllipsis"
- Style="{StaticResource BasicTextStyle}"/>
- </StackPanel>
- <Rectangle
- x:Name="FocusVisualWhite"
- IsHitTestVisible="False"
- Stroke="{StaticResource FocusVisualWhiteStrokeBrush}"
- StrokeEndLineCap="Square"
- StrokeDashArray="1,1"
- Opacity="0"
- StrokeDashOffset="1.5"/>
- <Rectangle
- x:Name="FocusVisualBlack"
- IsHitTestVisible="False"
- Stroke="{StaticResource FocusVisualBlackStrokeBrush}"
- StrokeEndLineCap="Square"
- StrokeDashArray="1,1"
- Opacity="0"
- StrokeDashOffset="0.5"/>
- <VisualStateManager.VisualStateGroups>
- <VisualStateGroup x:Name="CommonStates">
- <VisualState x:Name="Normal"/>
- <VisualState x:Name="PointerOver">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemHoverBackgroundBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemHoverForegroundBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Pressed">
- <Storyboard>
- <DoubleAnimation
- Storyboard.TargetName="OutlineGlyph"
- Storyboard.TargetProperty="Opacity"
- To="0"
- Duration="0"/>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BackgroundGlyph" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemForegroundBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemPressedForegroundBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Disabled">
- <Storyboard>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OutlineGlyph" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextLabel" Storyboard.TargetProperty="Foreground">
- <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource AppBarItemDisabledForegroundBrush}"/>
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- <VisualStateGroup x:Name="FocusStates">
- <VisualState x:Name="Focused">
- <Storyboard>
- <DoubleAnimation
- Storyboard.TargetName="FocusVisualWhite"
- Storyboard.TargetProperty="Opacity"
- To="1"
- Duration="0"/>
- <DoubleAnimation
- Storyboard.TargetName="FocusVisualBlack"
- Storyboard.TargetProperty="Opacity"
- To="1"
- Duration="0"/>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Unfocused" />
- <VisualState x:Name="PointerFocused" />
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
|
Voilà
Présent dans le fichier StandardStyles. Message édité par Constellation06 le 16-05-2012 à 19:22:13
|