Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. DataTemplate triggers only on default enum property

DataTemplate triggers only on default enum property

Scheduled Pinned Locked Moved WCF and WF
wpfhelpdatabasewcfdesign
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mikey_H
    wrote on last edited by
    #1

    I am having an issue in setting up a trigger to run off an enum property. It only seems to be triggering when the trigger is set to the default value. Do I need to add a ProperrtyChanged handler to do something? Class is derived from ItemsControl. This will trigger

    Code
    public static DependencyProperty DisplayTypeProperty =
    DependencyProperty.Register("DisplayType",
    typeof(UICardArrayDisplayType), typeof(UICardArray),
    new PropertyMetadata(UICardArrayDisplayType.Community));

    XAML
    <ui:UICardArray ItemsSource="{Binding Path=Cards}" DisplayType="HoleCards"/>

    DataTemplate
    <MultiTrigger>
    <MultiTrigger.Conditions>
    <Condition Property="c:UICardArray.DisplayType" Value="Community"/>
    <Condition Property="ItemsControl.AlternationIndex" Value="3"/>
    </MultiTrigger.Conditions>
    <Setter TargetName="CardDisplay" Property="Margin" Value="5,0,0,0"/>
    </MultiTrigger>

    This will not

    Code
    public static DependencyProperty DisplayTypeProperty =
    DependencyProperty.Register("DisplayType",
    typeof(UICardArrayDisplayType), typeof(UICardArray),
    new PropertyMetadata(UICardArrayDisplayType.HoleCards));

    XAML
    <ui:UICardArray ItemsSource="{Binding Path=Cards}" DisplayType="Community"/>

    DataTemplate
    <MultiTrigger>
    <MultiTrigger.Conditions>
    <Condition Property="c:UICardArray.DisplayType" Value="Community"/>
    <Condition Property="ItemsControl.AlternationIndex" Value="3"/>
    </MultiTrigger.Conditions>
    <Setter TargetName="CardDisplay" Property="Margin" Value="5,0,0,0"/>
    </MultiTrigger>

    Any help is appreciated

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups