Search This Blog

Wednesday, August 31, 2011

Set property in View from ViewModel in MVVM using Interaction Triggers; Set View's property from ViewModel without code behind in Silverlight 4.0

We have a View which is a Window control with DialogResult property and we want to set this property to True without using code behind.

<controls:ChildWindow  x:Class="WebClient.Views.ConfWorkerView"

Name="Window" >

    <Button HorizontalAlignment="Right" Content="Save"  Command="{Binding SaveCommand}" >
            <i:EventTrigger EventName="Click">
               <ei:ChangePropertyAction PropertyName="DialogResult" Value="True" TargetName="Window"/>

No comments:

Post a Comment

If you like this post, please leave a comment :)