ChangedPropertyAction
.NET프로그래밍/Silverlight 3.0 2009. 12. 7. 16:59 |[FrmChangedPropertyAction.xaml]
<UserControl
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"
x:Class="RiaAction.FrmChangedPropertyAction"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<Button x:Name="btn" Content="클릭하면 변합니다." Background="#FFEB2611">
</Button>
</Grid>
</UserControl>
"RiaAction"의 "App.xaml.cs"코드에서 'Startup'부분을 수정하여 "FrmChangedPropertyAction.xaml"을 시작페이지로 설정하고 "Expression Blend"를 사용하여 디자인하면 아래와 같이 "FrmChangedPropertyAction.xaml"에 소스코드가 생긴다.
[FrmChangedPropertyAction.xaml]
<UserControl
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:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" x:Class="RiaAction.FrmChangedPropertyAction"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<Button x:Name="btn" Content="클릭하면 변합니다." Background="#FFEB2611">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<ic:ChangePropertyAction PropertyName="Background">
<ic:ChangePropertyAction.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="#FFF72610" Offset="1"/>
</LinearGradientBrush>
</ic:ChangePropertyAction.Value>
</ic:ChangePropertyAction>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</Grid>
</UserControl>
'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글
RemoveElementAction - 클릭하면 사라지는 동작 (0) | 2009.12.07 |
---|---|
GoToStateAction - 컨트롤 상태 변경 액션 (0) | 2009.12.07 |
트리거(Triggers) (0) | 2009.12.07 |
VisualStateManager 클래스 (0) | 2009.12.07 |
키프레임 (KeyFrame) - EasingDoubleKeyFrame (여러가지 모양을 단어화(함수화)) (0) | 2009.12.04 |