Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you have done it "correctly" the <code>PropertyChanged</code> event will cause an update of the bindings which bind to that property, when this occurs any converters that are used in <em>the same binding</em> will reconvert the values. So normally the conversions happen on their own. If this is not the case you are probably using the converters "inappropriately", please post some code because without it it's quite impossible to tell what exactly you are doing wrong.</p> <p><strong>Edit:</strong> You use <code>grid.SetValue(Grid.BackgroundProperty, bin)</code>, you should use <code>grid.SetBinding(Grid.BackgroundProperty, bin)</code> instead since it is a binding.</p> <p><strong>Edit2:</strong> This really has nothing to do with converters.<br/> In your sample code you bind to <code>IntValue</code>, then you change <code>TodayColor</code> and expect the binding to be updated, <strong>not gonna happen</strong>. If you want the binding to react to both properties you have to either use a <code>MultiBinding</code> or raise the respective events since your properties are interdependent.</p> <p>i.e.</p> <pre><code> private Color _TodayColor; public short _IntValue; public short IntValue { get { return _IntValue; } set { if (_IntValue != value) { _IntValue = value; OnPropertyChanged("IntValue"); OnPropertyChanged("TodayColor"); } } } public Color TodayColor { get { return _TodayColor; } set { if (_TodayColor != value) { _TodayColor = value; OnPropertyChanged("TodayColor"); OnPropertyChanged("IntValue"); } } } </code></pre>
    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