Question

I'm working on a table of strings and need to check if a cell's string is not in a small collection of strings. How would I go about implementing this as a style trigger in XAML? Thanks for the help!

<Style.Resources>
   <x:Array Type="sys:String" x:Key="SomeKey">
      <sys:String>One</sys:String>
      <sys:String>Two</sys:String>
      <sys:String>Three</sys:String>
   </x:Array>
</Style.Resources>
<Style.Triggers>
  <Trigger Property="Value" -????
</Style.Triggers>
Was it helpful?

Solution

it is not possible to do it with standard XAML Triggers. You could try to do it in a converter or a behaviour. But probably when the logic becomes a bit complex you should consider transfering it to VM side.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top