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