static void OnParameterChanged(DependencyObject d, object newValue) { if (NotSetParameter == newValue) { return; } ViewModelInitializer.SetViewModelParameter(d, newValue); ParameterAndParentViewModelSyncBehavior.AttachTo(d); }
void OnAssociatedObjectDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { ViewModelInitializer.SetViewModelParameter(AssociatedObject, GetParameter(AssociatedObject)); ViewModelInitializer.SetViewModelParentViewModel(AssociatedObject, GetParentViewModel(AssociatedObject)); ViewModelInitializer.SetViewModelDocumentOwner(AssociatedObject, GetDocumentOwner(AssociatedObject)); }