views:

6

answers:

1

Hi, I was trying to figure out if it is possible to set the Enabled property of a button with a ChangeProperty behavior in SketchFlow/ExpressionBlend. It doesn't appear that the Enabled property is available in the behavior. thanks! Bill

A: 

Here is xaml that does what you mention above (in silverlight). It works the same way in WPF. The property is named IsEnabled if that is the source of confusion:

<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
    x:Class="SilverlightApplication7.MainPage"
    Width="640" Height="480">

    <Grid x:Name="LayoutRoot" Background="White">
        <Button x:Name="button" Content="Button" HorizontalAlignment="Left" Height="58" Margin="225,124,0,0" VerticalAlignment="Top" Width="79"/>
        <Button Content="Button" HorizontalAlignment="Left" Margin="225,230,0,207" Width="50">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Click">
                    <ei:ChangePropertyAction TargetName="button" PropertyName="IsEnabled" Value="False"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Button>
    </Grid>
</UserControl>
Chuck Hays
That was it. I was using EB3 and I don't think that had the interactions for the IsEnabled for the button. Thanks!! Sure appreciate the help!!
Bill Campbell