我想知道如何将 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}}"/>

最佳答案

正如@dkozl 已经提到的,您可以使用 x:Static Markup Extension :



所以你的代码应该是这样的:

<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}}"/>

关于wpf - 将可见性枚举值作为 ConverterParameter 传递,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28882964/

10-13 03:12