SketchFlow 如何通过行为设置按钮启用 true/false

发布于 2024-09-25 16:46:05 字数 106 浏览 1 评论 0原文

我试图弄清楚是否可以在 SketchFlow/ExpressionBlend 中设置具有 ChangeProperty 行为的按钮的 Enabled 属性。行为中似乎没有启用属性可用。 谢谢! 账单

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月竹挽风 2024-10-02 16:46:05

这是执行上面提到的操作的 xaml(在 silverlight 中)。它在 WPF 中的工作方式相同。如果这是混淆的根源,则该属性被命名为 IsEnabled:

<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>

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文