■ MouseDragElementBehavior 엘리먼트를 사용하는 방법을 보여준다.
▶ Expression Blend 참조 추가
1 2 3 4 5 |
Microsoft.Expression.Interactions Microsoft.Expression.Prototyping.Interactivity System.Windows.Interactivity |
▶ 예제 코드 (XAML)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<Grid x:Name="grid" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" Width="600" Height="400" Background="Khaki"> <Rectangle Width="100" Height="100" Fill="Blue"> <i:Interaction.Behaviors> <ei:MouseDragElementBehavior ConstrainToParentBounds="True" X="0" Y="0" /> </i:Interaction.Behaviors> </Rectangle> </Grid> |