WPF MultiDataTrigger not working

So i have polygon:

<Polygon Points="1.875,0.875 2.75,13.875 18.875,11 16.625,-3.375 1.875,0.875 "              Style="{ StaticResource BlockView}"              Name="KEY_1"              Canvas.Left="35"              Canvas.Top="211"              attachedproperty:UtilityFunctions.IsDualModeActive="{Binding  GetDevice.SelectedProfile.IsDualMode,Mode=TwoWay}" /> 

i want the stroke of the polygon to change based on the values of IsMouseOver property and an attached property which is like this:

public static readonly DependencyProperty IsDualModeActiveProperty = DependencyProperty.RegisterAttached(                                                                         "IsDualModeActive",                                                                         typeof(Boolean),                                                                         typeof(UtilityFunctions)         );     public static void SetIsDualModeActive(UIElement element, Boolean value)     {         element.SetValue(IsDualModeActiveProperty, value);     }     public static Boolean GetIsDualModeActive(UIElement element)     {         return (Boolean)element.GetValue(IsDualModeActiveProperty);     } 

the attached property is bound to a property in my ViewModel as you can see in the polygon code. Then i have this trigger defined in the style resource:

 <MultiDataTrigger>                     <MultiDataTrigger.Conditions>                         <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver }"                                    Value="True" />                         <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsDualModeActive }"                                    Value="False" />                     </MultiDataTrigger.Conditions>                     <MultiDataTrigger.EnterActions>                         <BeginStoryboard>                             <Storyboard>                                 <ColorAnimation  Storyboard.TargetProperty="Stroke.Color"                                                  To="#73BB00"                                                  Duration="{StaticResource controlTransitionEnterDuration}" />                             </Storyboard>                         </BeginStoryboard>                     </MultiDataTrigger.EnterActions>                     <MultiDataTrigger.ExitActions>                         <BeginStoryboard>                             <Storyboard>                                 <ColorAnimation Storyboard.TargetProperty="Stroke.Color"                                                 Duration="{StaticResource controlTransitionEnterDuration}" />                             </Storyboard>                         </BeginStoryboard>                     </MultiDataTrigger.ExitActions>                     <Setter Property="Opacity" Value="3" />                 </MultiDataTrigger> 

the problem is i have checked the values of mouseover and the attachedproperty, they meet the trigger condition but the stroke of the polygon doesn't change. Any thing i am missing out here? Thanks.


Category: c# Time: 2016-07-30 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.143 (s). 12 q(s)