关于DotNetBar ButtonX样式问题
如图:上面列举了DotNetBarButtonX所有样式,但左下方的橙色按钮不是枚举的样式,是自定义样式,这个样式是设置出来的?...
如图:上面列举了DotNetBar ButtonX所有样式,但左下方的橙色按钮不是枚举的样式,是自定义样式,这个样式是设置出来的?
展开
1个回答
展开全部
XAML样式定义
你没有源码?
有源码的话,查袜滑看下对象绑定的那个样式,找下工程的资源文件,搜索下绑定关键纯掘字就OK了
没源码的话,参考下面:
http://msdn.microsoft.com/zh-cn/library/ee230084
<ControlTemplateTargetType="Button">
<BorderName="RootElement">
<VisualStateManager.VisualStateGroups>
<!--Define the states and transitions for the common states.
The states in the VisualStateGroup are mutually exclusive to
each other.-->
<VisualStateGroupName="CommonStates">
<!--The Normal state is the state the button is in
when it is not in another state from this VisualStateGroup.-->
<VisualStateName="Normal"/>
<!--Change the SolidColorBrush, BorderBrush, to red when the
mouse is over the button.-->
<VisualStateName="MouseOver">
<Storyboard>
<ColorAnimationStoryboard.TargetName="BorderBrush"
Storyboard.TargetProperty="Color"
To="做好核Red"/>
</Storyboard>
</VisualState>
<!--Change the SolidColorBrush, BorderBrush, to Transparent when the
button is pressed.-->
<VisualStateName="Pressed">
<Storyboard>
<ColorAnimationStoryboard.TargetName="BorderBrush"
Storyboard.TargetProperty="Color"
To="Transparent"/>
</Storyboard>
</VisualState>
<!--The Disabled state is omitted for brevity.-->
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border.Background>
<SolidColorBrushx:Name="BorderBrush"Color="Black"/>
</Border.Background>
<GridBackground="{TemplateBinding Background}"Margin="4">
<ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="4,5,4,4"/>
</Grid>
</Border>
</ControlTemplate>
你没有源码?
有源码的话,查袜滑看下对象绑定的那个样式,找下工程的资源文件,搜索下绑定关键纯掘字就OK了
没源码的话,参考下面:
http://msdn.microsoft.com/zh-cn/library/ee230084
<ControlTemplateTargetType="Button">
<BorderName="RootElement">
<VisualStateManager.VisualStateGroups>
<!--Define the states and transitions for the common states.
The states in the VisualStateGroup are mutually exclusive to
each other.-->
<VisualStateGroupName="CommonStates">
<!--The Normal state is the state the button is in
when it is not in another state from this VisualStateGroup.-->
<VisualStateName="Normal"/>
<!--Change the SolidColorBrush, BorderBrush, to red when the
mouse is over the button.-->
<VisualStateName="MouseOver">
<Storyboard>
<ColorAnimationStoryboard.TargetName="BorderBrush"
Storyboard.TargetProperty="Color"
To="做好核Red"/>
</Storyboard>
</VisualState>
<!--Change the SolidColorBrush, BorderBrush, to Transparent when the
button is pressed.-->
<VisualStateName="Pressed">
<Storyboard>
<ColorAnimationStoryboard.TargetName="BorderBrush"
Storyboard.TargetProperty="Color"
To="Transparent"/>
</Storyboard>
</VisualState>
<!--The Disabled state is omitted for brevity.-->
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border.Background>
<SolidColorBrushx:Name="BorderBrush"Color="Black"/>
</Border.Background>
<GridBackground="{TemplateBinding Background}"Margin="4">
<ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Margin="4,5,4,4"/>
</Grid>
</Border>
</ControlTemplate>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询