We have a WPF page with a user control where we use BitmapCache - when we try to clear this element by updating the property (data binding) with an empty path (New Path ()), it is not completely updated / cleared. If I slightly resized the window, the area in which BitmapCache is active is completely cleared.
Is there anything special to clear / update an element that uses BitmapCache?
This is our code:
<me:ScrollViewer RenderedWaves="{Binding RenderedWaves}" ItemTemplate="{DynamicResource DataTemplateForWaveItem}" ItemsPanel="{DynamicResource ItemsPanelTemplateForWaveItems}" CacheMode="BitmapCache" />
I thought I fixed it, but it does not work every time ...
This path setting code does not immediately update BitmapCache:
Protected WriteOnly Property SetGraph As Path Set(value As Path) If value Is Nothing Then value = GetEmptyPath() _graph = value OnPropertyChanged(New PropertyChangedEventArgs(PropertyNameGraph)) End Set End Property
And this code sometimes updates it:
Protected WriteOnly Property SetGraph As Path Set(value As Path) UIDispatcherLocator.UIDispatcher.Invoke(Sub() If value Is Nothing Then value = GetEmptyPath() _graph = value End Sub, Threading.DispatcherPriority.Background) OnPropertyChanged(New PropertyChangedEventArgs(PropertyNameGraph)) End Set End Property
source share