Пример #1
0
 static void OnParameterChanged(DependencyObject d, object newValue)
 {
     if (NotSetParameter == newValue)
     {
         return;
     }
     ViewModelInitializer.SetViewModelParameter(d, newValue);
     ParameterAndParentViewModelSyncBehavior.AttachTo(d);
 }
Пример #2
0
            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());
            }
Пример #3
0
 static void OnDocumentOwnerChanged(DependencyObject d, IDocumentOwner newValue)
 {
     SetDocumentOwnerCore(d, newValue);
     ParameterAndParentViewModelSyncBehavior.AttachTo(d);
 }
Пример #4
0
 static void OnParentViewModelChanged(DependencyObject d, object newValue)
 {
     SetParentViewModelCore(d, newValue);
     ParameterAndParentViewModelSyncBehavior.AttachTo(d);
 }
Пример #5
0
 static void OnDocumentOwnerChanged(DependencyObject d, IDocumentOwner newValue)
 {
     ViewModelInitializer.SetViewModelDocumentOwner(d, newValue);
     ParameterAndParentViewModelSyncBehavior.AttachTo(d);
 }
Пример #6
0
 static void OnParentViewModelChanged(DependencyObject d, object newValue)
 {
     ViewModelInitializer.SetViewModelParentViewModel(d, newValue);
     ParameterAndParentViewModelSyncBehavior.AttachTo(d);
 }