123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using InABox.Core;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- namespace InABox.DynamicGrid
- {
- public abstract class DynamicFormControl : ContentControl
- {
- public DynamicFormDesignGrid FormDesignGrid { get; set; }
- protected abstract FrameworkElement Create();
- public abstract void SetControl(DFLayoutControl control);
- }
- public abstract class DynamicFormControl<TControl> : DynamicFormControl
- where TControl : DFLayoutControl
- {
- private TControl control;
- public TControl Control
- {
- get => control;
- set
- {
- control = value;
- Content = Create();
- AfterSetControl(control);
- }
- }
- protected virtual void AfterSetControl(TControl control)
- {
- }
- public override void SetControl(DFLayoutControl control) => Control = (TControl)control;
- }
- }
|