[App.xaml.cs]에서 "FrmRemoveElementAction.xaml"을 '시작개체'로 설정한다. 그리고 [FrmRemoveElementAction.xaml]를 "Expression Blend"로 열어서 디자인하면 [FrmRemoveElementAction.xaml]소스코드가 아래와 같이 수정된다.




[FrmRemoveElementAction.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.FrmRemoveElementAction"

    d:DesignHeight="300" d:DesignWidth="400">   

    <Grid x:Name="LayoutRoot" Background="White">

        <StackPanel>

            <Button x:Name="btn" Content="클릭하면 사라집니다.">

                       <i:Interaction.Triggers>

                                         <i:EventTrigger EventName="Click">

                                                           <ic:RemoveElementAction TargetName="rect"/>

                                         </i:EventTrigger>

                       </i:Interaction.Triggers>

            </Button>

            <Rectangle x:Name="rect" Width="100" Height="100" Fill="Red" Margin="150,0"/>

        </StackPanel>

    </Grid>

</UserControl>

 

 













'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글

HyperlinkAction  (0) 2009.12.07
ControlStoryboardAction  (0) 2009.12.07
GoToStateAction - 컨트롤 상태 변경 액션  (0) 2009.12.07
ChangedPropertyAction  (0) 2009.12.07
트리거(Triggers)  (0) 2009.12.07
Posted by holland14
: