Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem is you've placed additional code in your Setter. When using Dependency properties the setter is not always called, for example when some other external code calls <code>SetValue</code> passing in <code>SolidGlossTypeProperty</code> and a new value, your setter is not called.</p> <p>You sould use the property callback method to perform additional operations instead.</p> <p><strong>Edit</strong></p> <p>For example:-</p> <pre><code>public SolidGlossTypes SolidGlossType { get { return (SolidGlossTypes)GetValue(SolidGlossTypeProperty); } set { SetValue(SolidGlossTypeProperty, value); } } public static readonly DependencyProperty SolidGlossTypeProperty = DependencyProperty.Register( "SolidGlossType", typeof(SolidGlossTypes), typeof(SolidGloss), new PropertyMetadata(SolidGlossTypes.Normal, OnSolidGlossTypePropertyChanged)); private static void OnSolidGlossTypePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { SolidGloss source = d as SolidGloss; SolidGlossTypes value = (SolidGlossTypes)e.NewValue switch (value) { case SolidGlossTypes.Header: source.SolidGloss_Upper.Visibility = Visibility.Visible; source.SolidGloss_Lower.Visibility = Visibility.Collapsed; break; case SolidGlossTypes.Footer: source.SolidGloss_Upper.Visibility = Visibility.Collapsed; source.SolidGloss_Lower.Visibility = Visibility.Visible; break; case SolidGlossTypes.None: source.SolidGloss_Upper.Visibility = Visibility.Collapsed; source.SolidGloss_Lower.Visibility = Visibility.Collapsed; break; default: source.SolidGloss_Upper.Visibility = Visibility.Visible; source.SolidGloss_Lower.Visibility = Visibility.Visible; break; } } </code></pre> <p>In this arrangement whenever the value of <code>SolidGlossTypeProperty</code> is changed by whatever means (the setter in your code, by animation or by other direct calls to <code>SetValue</code>) the callback property changed method will always be called.</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. 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