Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, since you said something along the lines of Navigation panel, you might want to think about using something like a listview or a listbox and templating your items while binded to a collection in your view model. But, since I don't know the scope of your Nav control, I will assume that your Nav control doesn't exactly fit this scheme.</p> <p>I will suggest using Attached Properties to achieve what you described as setting multiple properties based on single parent property. Consider the following as pseudo-code since I haven't tested it:</p> <pre><code> public class MagicHelper { #region Super Property public static readonly DependencyProperty SuperProperty = DependencyProperty.RegisterAttached( "Super", typeof(SecretType), typeof(MagicHelper) new PropertyMetadata(-1, SuperChanged)); // Get public static SecretType GetSuper(DependencyObject obj) { return (SecretType)obj.GetValue(SuperProperty); } // Set public static void SetSuper(DependencyObject obj, SecretType value) { obj.SetValue(SuperProperty, value); } // Change Event - make stuff happen here public static void SuperChanged( DependencyObject obj, DependencyPropertyChangedEventArgs e) { // I am using Polygon here for example but you could use a base class that might cover all your controls if (!(obj is Polygon)) return; Polygon pGon = (Polygon)obj; // do your thing to pGon here with e.NewValue var mySecretInstance = e.NewValue as SecretType; if (mySecretInstance.frap) { pGon.Visibility = Visibility.Collapsed; pGon.Background = Brushes.Red; } ... ... } } </code></pre> <p>and the XAML goes something like this</p> <pre><code>&lt;UserControl Name="thisControl" xmlns:local="yourLibrary"&gt; &lt;Polygon local:MagicHelper.Super="{Binding ElementName=thisControl, Path=Selected"/&gt; ... </code></pre> <p>m</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. 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