Example #1
0
 public void AddEntityReferenceControl(WpfEventManager wpfEventManager, EntityReferenceValue defaultValue)
 {
     EntityReferenceInputControl = new EntityReferenceInputControlView
     {
         DefaultValue    = defaultValue,
         InputModel      = ViewModel.InputModel,
         WpfEventManager = wpfEventManager,
     };
     EntityReferenceInputControl.ValueChanged += EntityReferenceInputControlView_ValueChanged;
     TheControlGrid.Children.Add(EntityReferenceInputControl);
 }
Example #2
0
        private static void OnPropsValueChangedHandler(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            EntityReferenceInputControlView v = d as EntityReferenceInputControlView;

            if (e.Property.Name == nameof(DefaultValue))
            {
                v.SetEntityReference((EntityReferenceValue)e.NewValue);
            }
            else if (e.Property.Name == nameof(InputModel))
            {
                v.SetInputModel((GenericFormInputModel)e.NewValue);
            }
            else if (e.Property.Name == nameof(WpfEventManager))
            {
                v.SetWpfEventManager((WpfEventManager)e.NewValue);
            }
        }