Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>What I need is when the Alarm property of my object is set to true I need to change colors, start an animation, create and display other elements in the control.</p> </blockquote> <ul> <li><strong>Change colors:</strong> Bind the Color/Foreground of the element you want to change the color of, to the boolean that sets the alarm, and add an <code>IValueConverter</code> in the binding that returns a <code>Brush</code> based on the boolean.</li> <li><strong>Start an animation:</strong> Use a (data)trigger on whichever element needs to be animated, in that trigger, use a Storyboard to define the animation you want.</li> <li><strong>create and display other elements in the control:</strong> that really depends on how well you did your MVVM, if the elements are a visualisation of an <code>ObservableCollection</code> through a <code>ListBox</code>/<code>ListView</code>/<code>ItemsControl</code> (which it should), wire up a <code>Command</code> to whatever sets the alarm on/off (the Button class has a Command property built in, other <code>UIElement</code>s may require the use of <em>System.Windows.Interactivity</em>) and in the method that this <code>Command</code> will point to, add a new item to the <code>ObservableCollection</code>, the <code>ItemsControl</code> will automatically reflect the change by adding a new control.</li> </ul> <p>Of course this is just raw information, and you're probably not familiar will all these things, that's when Google comes into play ;)</p> <p>HTH,</p> <p>Bab.</p>
    singulars
    1. This table or related slice is empty.
    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.
    1. VO
      singulars
      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