<UserControl x:Class="Wex.Lib.Demo.Views.Demos.PropertyTrigger" 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" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:wex="clr-namespace:Wex.Lib.Interactions;assembly=Wex.Lib" mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"> <Grid x:Name="LayoutRoot"> <i:Interaction.Triggers> <!-- <wex:PropertyTrigger ElementName="txtData" Property="Text"> <wex:InvokeCommandAction CommandName="UpdateDataCommand"> <wex:InvokeCommandAction.Conditions> <wex:InvokingConditions> <wex:InvokingCondition Value="Hello"/> <wex:InvokingCondition ElementName="myCheckBox" Property="IsChecked" Value="True"/> </wex:InvokingConditions> </wex:InvokeCommandAction.Conditions> </wex:InvokeCommandAction> </wex:PropertyTrigger> --> </i:Interaction.Triggers> <StackPanel> <TextBlock FontSize="20" Text="Property Trigger Demo"/> <TextBlock Margin="4" TextWrapping="Wrap" Text="This demo shows how to invoke an action when a property is changed, based on multiple conditions. Type 'Hello' in the below text box, with the check box checked, to fire the command"/> <TextBox Margin="4" Name="txtData" Text="Type Hello here, with the checkbox checked"/> <StackPanel Background="LightGray" Margin="5"> <TextBlock Margin="4" Text="{Binding Data}" FontSize="14"/> <CheckBox Name="myCheckBox" Content="Check to Fire The Command if 'Hello' is entered"/> </StackPanel> </StackPanel> </Grid> </UserControl>
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)