Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe this isn't a problem with <code>ExpandoObject</code> not implementing <code>INotifyPropertyChanged</code> (because <a href="http://msdn.microsoft.com/en-us/library/system.dynamic.expandoobject_events.aspx" rel="nofollow noreferrer">it does</a>).</p> <p>What I'm thinking is that your problem is the combination of <code>INotifyCollectionChanged</code> and using a converter. What happens is that converters are called when the property changes, but they aren't called when the collection changes. This will cause the UI not to update when an item is added or removed from the bound collection.</p> <p>You can have a look at these questions for more information about this problem:</p> <ul> <li><a href="https://stackoverflow.com/questions/1675429/how-do-i-update-an-ivalueconverter-on-collectionchanged">How do I update an IValueConverter on CollectionChanged?</a></li> <li><a href="https://stackoverflow.com/questions/787188/why-is-converter-not-called-when-collection-changes">Why is Converter not called when Collection changes?</a></li> </ul> <p>You could see if that's really your issue by setting a breakpoint in your converter and see if it's being called when you add the new item. If that's indeed the issue, you could either try to work your way around this without using a converter, or use a <code>MultiValueConverter</code> that will also receive the <code>Count</code> property (which will only act as a trigger), like so:</p> <pre class="lang-xml prettyprint-override"><code>&lt;DataGrid&gt; &lt;DataGrid.ItemsSource&gt; &lt;MultiBinding Converter="{local:MyConverter}"&gt; &lt;Binding Path="Items" /&gt; &lt;Binding Path="Items.Count" /&gt; &lt;/MultiBinding&gt; &lt;/DataGrid.ItemsSource&gt; &lt;/DataGrid&gt; </code></pre> <pre class="lang-cs prettyprint-override"><code>public class MyConverter : MarkupExtension, IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { // Your converter logic which will use values[0] (the bound collection). // Ignore anything else in the values[] array. } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } public override object ProvideValue(IServiceProvider serviceProvider) { return this; } } </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. 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