Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Observable property not updated on successive change

$
0
0

Dear all,

I have an observable collection property call PushPinLocationCollection.

That property is bind to a View as follow:

<m:MapItemsControl x:Name="mapPushPin" 
                                       ItemsSource="{Binding PushPinLocationCollection,UpdateSourceTrigger=PropertyChanged}" 
                                       ItemTemplate="{StaticResource LocationPushpin}"/>

Then the item template is as follow :

<DataTemplate x:Key="LocationPushpin"><m:Pushpin   Location="{Binding Location, Converter={StaticResource LocationToLatLongConverter},UpdateSourceTrigger=PropertyChanged}"
                PositionOrigin="BottomLeft"         
                           Template="{StaticResource CutomPushpinTemplate}"
                            Heading="{Binding ElementName=wmap, Path=Heading}"
                             Width="{Binding ElementName=pin,Path=Width}"
                             Height="{Binding ElementName=pin,Path=Height}"><m:Pushpin.Content><ctrl:NewPushPinControl x:Name="_pin" DataContext="{Binding}" RenderTransformOrigin="0.5,0.5"/></m:Pushpin.Content></m:Pushpin></DataTemplate>

Then I have a Task which runs and add an item to the collection when it is available as PushPinLocationCollection.Add(pm);

What is strange is that the view display collection items only when the task complete.

Any reason that the view binding to the collection did not display item each type a new one is added to the collection by the running task ?

Or did I miss something ?

Thanks for advise


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>