为什么Expression Blend 3不会记录我的色彩动画? [英] Why Expression Blend 3 does not record my color animation?
问题描述
大家好,
我有一个非常简单的项目,里面有一个按钮和2个画笔
< Window
xmlns = " ; http://schemas.microsoft.com/winfx/2006/xaml/presentation "
xmlns:x = " http://schemas.microsoft.com/winfx/2006/xaml "
xmlns:d = " http://schemas.microsoft.com/expression/blend/2008 " xmln s:mc = " http://schemas.openxmlformats.org/markup-compatibility/2006 " mc:可忽略 = " d " xmlns:Microsoft_Windows_Themes = " clr-namespace:Microsoft.Windows.Themes; assembly = PresentationFramework.Aero " xmlns:ic = " clr-namespace:Microsoft.Expression.Interactivity.Core; assembly = Microsoft.Expression.Interactions " x:Class = " ComboBoxTest.Window1 "
标题 < span style ="color:Blue;"> = " Window1 " 高度 = " 300 " 宽度 = " 300 " >
< Window.Resources >
< SolidColorBrush x:键 = " OriginalColor " 颜色 = " #FFEC7171 " />
< SolidColorBrush x:Key = " OverColor < span style ="color:Black;">" Color = " #FFEC3737 " < span style ="color:Blue;"> />
< / Window.Resources >
< 网格 >
< Grid.RowDefinitions >
< RowDefinition < span style ="color:Red;">高度 = " 0.629 * " />
< RowDefinition 高度 = " 0.371 * " />
< / Grid.RowDefinitions >
< 按钮 x:名称 = " 按钮 " 边距 = " 64,48,90,56.056 " 内容 = " 按钮 " 背景 = " {DynamicResource Ori ginalColor} " />
< / 网格 >
< / 窗口 >
您使用的是属性触发器吗?试试这个
< Style x:Key =" myStyle" TargetType = " {x:Type按钮}" >
......
&NBSP;&NBSP; < Style.Triggers>
&NBSP; &NBSP; &NBSP; <触发器
属性 = "IsMouseOver"
值 = " True" >
&NBSP; &NBSP; &NBSP; &NBSP; &NBSP; < Setter
属性 = "背景"
值 = " {StaticResource
OverColor }" />
&NBSP; &NBSP; &NBSP; < / Trigger>
&NBSP; < /Style.Triggers>
< / Style>
Hi all,
I have a very simple project with a button and 2 brushes inside
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" x:Class="ComboBoxTest.Window1" Title="Window1" Height="300" Width="300"> <Window.Resources> <SolidColorBrush x:Key="OriginalColor" Color="#FFEC7171"/> <SolidColorBrush x:Key="OverColor" Color="#FFEC3737"/> </Window.Resources> <Grid> <Grid.RowDefinitions> <RowDefinition Height="0.629*"/> <RowDefinition Height="0.371*"/> </Grid.RowDefinitions> <Button x:Name="button" Margin="64,48,90,56.056" Content="Button" Background="{DynamicResource OriginalColor}"/> </Grid> </Window>
Hi,
Are you using property trigger, Try this
<Style x:Key="myStyle" TargetType="{x:Type Button}">
......
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource OverColor}" />
</Trigger>
</Style.Triggers>
</Style>
这篇关于为什么Expression Blend 3不会记录我的色彩动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!