Assigning the Tag Property of a Control in WPF
Posted
by jmayor
on Stack Overflow
See other posts from Stack Overflow
or by jmayor
Published on 2010-04-27T20:55:34Z
Indexed on
2010/04/27
21:03 UTC
Read the original article
Hit count: 351
If I have 7 checkBoxes, one for each day of the week, Can I assing in XAML the Tag property to each one of the the System.DayOfWeek enumeration value?
<StackPanel >
<StackPanel.Resources>
<system:DayOfWeek x:Key="Monday" >Monday</system:DayOfWeek>
</StackPanel.Resources>
<CheckBox Name="chkMo" Tag="{StaticResource Monday}">Mo</CheckBox>
...
</StackPanel>
Is there a way to assign directly the enum value to the tag without using resources?
© Stack Overflow or respective owner