public override Control CreateView(ModifiableEntity entity, PropertyRoute typeContext) { if (View == null) { throw new InvalidOperationException("View not defined in EntitySettings"); } if (typeContext == null && !(entity is IRootEntity)) { throw new ArgumentException("An EmbeddedEntity neeed TypeContext"); } Control control = View((T)entity); Common.SetPropertyRoute(control, typeContext ?? PropertyRoute.Root(entity.GetType())); return(control); }
static void OnSetTypeContext(DependencyObject sender, DependencyPropertyChangedEventArgs args) { Common.SetPropertyRoute(sender, args.NewValue == null ? null : PropertyRoute.Root((Type)args.NewValue)); }
public AutoControl(Type type) : this() { Common.SetPropertyRoute(this, PropertyRoute.Root(type)); }