我想知道如何将System.Windows.Visibility Enum作为转换器的参数传递:
<Bdl:BdlRoundButton Name="BtAddUser" Grid.Row="1" Grid.Column="2" Color="Orange" Image="Create" Command="{StaticResource GetSequence}" Margin="5,0,0,0"
Visibility="{Binding Converter={StaticResource StringNotNullToVisibilityConverter}, ConverterParameter={System.Windows.Visibility.Hidden}}"/>
答案 0 :(得分:0)
如@dkozl所述,您可以使用x:Static Markup Extension:
引用以兼容公共语言规范(CLS)的方式定义的任何静态按值代码实体。引用的静态属性可用于提供XAML中属性的值。
所以您的代码应如下所示:
<Bdl:BdlRoundButton Name="BtAddUser" Grid.Row="1" Grid.Column="2" Color="Orange"
Image="Create" Margin="5,0,0,0"
Command="{StaticResource GetSequence}"
Visibility="{Binding Converter={StaticResource StringNotNullToVisibilityConverter}, ConverterParameter={x:Static Visibility.Hidden}}"/>