* 视觉状态控制:为什么小弟我的控件无法显示
***求助*** 视觉状态控制:为什么我的控件无法显示
我是新手,高手帮忙啊,下面是我的代码,不知道我的checkbox 为什么显示不出来啊。
App.xaml 视觉控制 checkbox
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SilverlightApplicationTest01.App"
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
>
<Application.Resources>
<ControlTemplate x:Key="myCheckBoxControlTemplate" TargetType="CheckBox">
<Grid>
<vsm:VisualStateManager.VisualStateGroups>
<!-- CommonStates Group -->
<vsm:VisualStateGroup x:Name="CommonStates">
<!-- CommonState StateGroup -->
<vsm:VisualState x:Name="Normal">
</vsm:VisualState>
<!-- MouseOver State -->
<vsm:VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="Glow"
Storyboard.TargetProperty="Opacity"
Duration="0" To="1" />
</Storyboard>
</vsm:VisualState>
<!-- Pressed State -->
<vsm:VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="HighlightBorder"
Storyboard.TargetProperty="Opacity"
Duration="0" To=".6" />
<ColorAnimation Storyboard.TargetName="InnerBorder"
Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
Duration="0" To="#FF000000" />
<ColorAnimation Storyboard.TargetName="InnerBorder"
Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
Duration="0" To="#FF000000" />
</Storyboard>
</vsm:VisualState>
<!-- Disabled State -->
<vsm:VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="Root"
Storyboard.TargetProperty="Opacity"
Duration="0" To=".5" />
</Storyboard>
</vsm:VisualState>
<!-- CommonStates Transitions -->
<vsm:VisualStateGroup.Transitions>
我是新手,高手帮忙啊,下面是我的代码,不知道我的checkbox 为什么显示不出来啊。
App.xaml 视觉控制 checkbox
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="SilverlightApplicationTest01.App"
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
>
<Application.Resources>
<ControlTemplate x:Key="myCheckBoxControlTemplate" TargetType="CheckBox">
<Grid>
<vsm:VisualStateManager.VisualStateGroups>
<!-- CommonStates Group -->
<vsm:VisualStateGroup x:Name="CommonStates">
<!-- CommonState StateGroup -->
<vsm:VisualState x:Name="Normal">
</vsm:VisualState>
<!-- MouseOver State -->
<vsm:VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="Glow"
Storyboard.TargetProperty="Opacity"
Duration="0" To="1" />
</Storyboard>
</vsm:VisualState>
<!-- Pressed State -->
<vsm:VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="HighlightBorder"
Storyboard.TargetProperty="Opacity"
Duration="0" To=".6" />
<ColorAnimation Storyboard.TargetName="InnerBorder"
Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
Duration="0" To="#FF000000" />
<ColorAnimation Storyboard.TargetName="InnerBorder"
Storyboard.TargetProperty="(Border.BorderBrush).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
Duration="0" To="#FF000000" />
</Storyboard>
</vsm:VisualState>
<!-- Disabled State -->
<vsm:VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="Root"
Storyboard.TargetProperty="Opacity"
Duration="0" To=".5" />
</Storyboard>
</vsm:VisualState>
<!-- CommonStates Transitions -->
<vsm:VisualStateGroup.Transitions>