private void CreateEntity(Type type, double x, double y, double w, double h, UIElement template = null, string data = "") { FrameworkElement nc = null; if (string.IsNullOrEmpty(data)) { nc = (FrameworkElement)Activator.CreateInstance(type, new object[] { }); } else { nc = new Controls.Stamps.Shape(); ((Controls.Stamps.Shape)nc).StampData = data; ((Controls.Stamps.Shape)nc).StampType = type; } nc.Width = w; nc.Height = h; nc.SetValue(Windows.UI.Xaml.Controls.Canvas.LeftProperty, Math.Abs(x)); nc.SetValue(Windows.UI.Xaml.Controls.Canvas.TopProperty, Math.Abs(y)); if (template != null) { ((IStamp)nc).GenerateFromXAML(template); } ((IStamp)nc).PerformAction += Stamp_PerformAction; cvMainAdorner.Children.Add(nc); }
private void CreateStamp(Type type, double x, double y, double w, double h, UIElement template = null, string data = "") { FrameworkElement nc = null; if (string.IsNullOrEmpty(data)) nc = (FrameworkElement)Activator.CreateInstance(type, new object[] { }); //Controls.Stamps.Circle(); else { nc = new Controls.Stamps.Shape(); ((Controls.Stamps.Shape)nc).StampData = data; ((Controls.Stamps.Shape)nc).StampType = type; } nc.Width = w; nc.Height = h; nc.SetValue(Windows.UI.Xaml.Controls.Canvas.LeftProperty, Math.Abs(x)); nc.SetValue(Windows.UI.Xaml.Controls.Canvas.TopProperty, Math.Abs(y)); if (template != null) ((IStamp)nc).GenerateFromXAML(template); ((IStamp)nc).PerformAction += Stamp_PerformAction; cvMainAdorner.Children.Add(nc); }