-
Hi there, Just to ask if we can Bind on Selector Style like this ? :
I want to compare this bind with Static Value to apply style.
Or I have mistook something ? Thank in advance |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
First of all, you can bind classname with following syntax:
With that, in your code it probably will be the best/easiest option to have boolean property in the view model and not calculate it in the xaml. |
Beta Was this translation helpful? Give feedback.
-
The workaround I found is to use Tag property to contains binding enum value (in string format) and use a style selector with checking Tag property like this
EDIT : as mentionned @maxkatz6 (Thanks Max) : I added many classes on my control ListBox to make two different styles :
after that apply style with selector from a style :
|
Beta Was this translation helpful? Give feedback.
The workaround I found is to use Tag property to contains binding enum value (in string format) and use a style selector with checking Tag property like this
<Style Selector="ListBox#lstBox[Tag=SuperUser] ListBoxItem">
EDIT :
as mentionned @maxkatz6 (Thanks Max) :
I added many classes on my control ListBox to make two different styles :
after that apply style with selector from a style :
<Style Selector="ListBox.U…