Ejemplo n.º 1
0
 public static void UpdateAll(object model, DependencyObject view)
 {
     foreach (var member in FacadeType.Create(view.GetType(), model.GetType()).Members)
     {
         member.UpdateFrom(model, view);
     }
 }
Ejemplo n.º 2
0
        public static void Update(object model, DependencyObject view, DependencyPropertyChangedEventArgs change)
        {
            FacadeMapping member;

            if (FacadeType.Create(view.GetType(), model.GetType()).ByViewProperty.TryGetValue(change.Property, out member))
            {
                member.Update(model, change.NewValue);
            }
        }
Ejemplo n.º 3
0
        public static FacadeType Create(Type viewType, Type modelType)
        {
            var        key = Tuple.Create(viewType, modelType);
            FacadeType facadeType;

            if (!All.TryGetValue(key, out facadeType))
            {
                All[key] = facadeType = new FacadeType(viewType, modelType);
            }
            return(facadeType);
        }