static void OnParameterChanged(DependencyObject d, object newValue) { if (NotSetParameter == newValue) { return; } ViewModelInitializer.SetViewModelParameter(d, newValue); ParameterAndParentViewModelSyncBehavior.AttachTo(d); }
public static void AttachTo(DependencyObject obj) { if (!(obj is FrameworkElement || obj is FrameworkContentElement)) { return; } BehaviorCollection bCol = Interaction.GetBehaviors(obj); ParameterAndParentViewModelSyncBehavior b = (ParameterAndParentViewModelSyncBehavior)bCol.FirstOrDefault(x => x is ParameterAndParentViewModelSyncBehavior); if (b != null) { return; } bCol.Add(new ParameterAndParentViewModelSyncBehavior()); }
static void OnDocumentOwnerChanged(DependencyObject d, IDocumentOwner newValue) { SetDocumentOwnerCore(d, newValue); ParameterAndParentViewModelSyncBehavior.AttachTo(d); }
static void OnParentViewModelChanged(DependencyObject d, object newValue) { SetParentViewModelCore(d, newValue); ParameterAndParentViewModelSyncBehavior.AttachTo(d); }
static void OnDocumentOwnerChanged(DependencyObject d, IDocumentOwner newValue) { ViewModelInitializer.SetViewModelDocumentOwner(d, newValue); ParameterAndParentViewModelSyncBehavior.AttachTo(d); }
static void OnParentViewModelChanged(DependencyObject d, object newValue) { ViewModelInitializer.SetViewModelParentViewModel(d, newValue); ParameterAndParentViewModelSyncBehavior.AttachTo(d); }