Live Chat Icon For mobile
Live Chat Icon

What way can a custom class can be defined in XAML ?

Platform: WPF| Category: Type Converters

Custom classes can be defined in the Window.Resoures of the XAML page. This can be done with the following code snippets.

[XAML]

<Window.Resources>
    <local:BoolToVisibilityConverter x:Key="BoolToVisConverter"/>
</Window.Resources>
<Grid>
    <Button Visibility="{Binding IsVisible,Converter={StaticResource BoolToVisConverter}}"/>
</Grid>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.