【问题标题】:How to change materialDesign: property in C# code?如何在 C# 代码中更改 materialDesign: 属性?
【发布时间】:2019-09-12 18:34:07
【问题描述】:

我正在尝试通过 C# 代码更改属性 materialDesign:ButtonProgressAssist.IsIndeterminate。 我在 Button 对象中没有找到类似的属性。

这是按钮代码:

 <Button x:Name="loginButton" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,100" Width="100"
                    Style="{StaticResource MaterialDesignRaisedButton}"
    materialDesign:ButtonProgressAssist.Value="-1"
    materialDesign:ButtonProgressAssist.IsIndicatorVisible="True"
    materialDesign:ButtonProgressAssist.IsIndeterminate="false" />

我想在被点击时将 IsIndeterminate 属性设置为 true。

【问题讨论】:

    标签: c# .net wpf material-design-in-xaml


    【解决方案1】:

    我不明白,为什么我总是在 StackOverflow 上询问后不久就发现它... 但这是解决方案:

    MaterialDesignThemes.Wpf.ButtonProgressAssist.SetIsIndeterminate(loginButton, true);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-12-06
      • 1970-01-01
      • 2010-10-07
      • 1970-01-01
      • 2013-04-30
      • 2019-12-11
      • 2011-01-30
      相关资源
      最近更新 更多