Assign enum property in xaml using silverlight
Posted
by Malcolm
on Stack Overflow
See other posts from Stack Overflow
or by Malcolm
Published on 2010-05-07T14:15:22Z
Indexed on
2010/05/07
14:18 UTC
Read the original article
Hit count: 192
Silverlight
|c#
I have a property of datattype enum : like
public BreakLevel Level
{
get { return level; }
set { level = value; }
}
And enum defined :
public enum BreakLevel
{
Warning, Fatal
}
I want bind the neum property to the visibility of my border , somewhat like this:
Visibility="{Binding BreakLevel.Fatal}" so is it possible?
<Border CornerRadius="4" BorderThickness="1" BorderBrush="#DAE0E5"
Visibility="{Binding DataContext.IsError, Converter={StaticResource BoolToVisibilityConverter}, RelativeSource={RelativeSource TemplatedParent}}" >
© Stack Overflow or respective owner