I created a class:
class StorageBase
{
public Queue<Slices> Slices {get;set;}
}
and a wpf user control with the Storage dependency property of type StorageBase:
public StorageBase Storage
{
get { return (StorageBase)GetValue(StorageProperty); }
set { SetValue(StorageProperty, value); }
}
public static readonly DependencyProperty StorageProperty =
DependencyProperty.Register("Storage", typeof(StorageBase), typeof(MaterialStreamControl), new UIPropertyMetadata(null, new PropertyChangedCallback(OnStoragePropertyChanged)));
static void OnStoragePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
(d as MaterialStreamControl).Render();
}
How can I retrain a component if the slices in the repository are changed?
source
share