private void AddControl(string text, bool isXaml) { if (!isXamlIslandsSupported) { isXaml = false; } var controlTypeHelper = new ControlTypeHelper(); ControlEnum?controlType = controlTypeHelper.GetControlEnum(text, isXaml); if (controlType == null) { return; } //-- factory pattern ControlFactory factory = (isXaml) ? (ControlFactory)(new ControlFactoryXaml()) : (ControlFactory)(new ControlFactoryNet()); var control = factory.GetControl(controlType.Value); if (control == null) { return; } flowLayoutPanel1.Controls.Add(control); flowLayoutPanel1.ScrollControlIntoView(control); }
private void AddUWPControl(string controlName) { var controlTypeHelper = new ControlTypeHelper(); var controlType = controlTypeHelper.GetControlEnum(controlName, true); if (!controlType.HasValue) { return; } //-- add as a new control if (!IsXamlAppendAction() || !controlTypeHelper.IsWuxControl(controlType.Value)) { AddControl(controlName, true); return; } AppendUWPControl(controlType); }