Note that there are some explanatory texts on larger screens.

plurals
  1. POMultiDataTrigger with value range
    primarykey
    data
    text
    <p>I have several conditions that need to be met in order to allow a user to edit the details of the selected item.</p> <p>the conditions are:</p> <p>if the item is active they are allowed to edit it regardless of security level. No problem there.</p> <p>if the item is inactive: users above security level 50 can edit it users below security level 50 can only view it</p> <p>currently I am using a multidatatrigger to do this:</p> <pre><code>&lt;MultiDataTrigger&gt; &lt;MultiDataTrigger.Conditions&gt; &lt;Condition Binding="{Binding Active,Converter={StaticResource DebugConverter}}" Value="False" /&gt; &lt;Condition Binding="{Binding SelectedOffice}" /&gt; &lt;/MultiDataTrigger.Conditions&gt; &lt;Setter Property="ContentTemplate" Value="{DynamicResource InActiveOfficeDataTemplate}" /&gt; &lt;/MultiDataTrigger&gt; &lt;MultiDataTrigger&gt; &lt;MultiDataTrigger.Conditions&gt; &lt;Condition Binding="{Binding Active,Converter={StaticResource DebugConverter}}" Value="True" /&gt; &lt;Condition Binding="{Binding SelectedOffice}" /&gt; &lt;/MultiDataTrigger.Conditions&gt; &lt;Setter Property="ContentTemplate" Value="{DynamicResource ActiveOfficeDataTemplate}" /&gt; &lt;/MultiDataTrigger&gt; </code></pre> <p>I also need to know when the Selected Office changes. I was hoping to monitor the PhysicianId but I wont know what the number is, only that its changed. I have a selectedoffice property that the listbox is bound to, but I imagine I have to do something with the datatrigger to make it fire.</p> <hr> <h2>CHANGES</h2> <pre><code>&lt;DataTrigger Binding="{Binding Active}" Value="False"&gt; &lt;Setter Property="ContentTemplateSelector" Value="{DynamicResource DoctorOfficesDataTemplateSelector}" /&gt; &lt;/DataTrigger&gt; &lt;DataTrigger Binding="{Binding Active,Converter={StaticResource DebugConverter}}" Value="True"&gt; &lt;Setter Property="ContentTemplate" Value="{DynamicResource ActiveOfficeDataTemplate}" /&gt; &lt;/DataTrigger&gt; </code></pre> <p>This seems to be working. I have the security level actually being checked in the templateselector.</p> <p>The issue remains though that the selecteddoctor is only being updated when I change between an inactive and active office. If i choose and active then an active the trigger isnt firing again...I have the list bound to an Icollection do I need to make it observable? this was working correctly before i implemented the datatrigger.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload