public void DeleteInstance(GraphicInstance graphicInstance) { RecursiveDeleteInstance(graphicInstance); InstancesContext.SubmitChanges(); if (graphicInstance is RootInstance) { SetCanvasRootItem(null); } }
public InstancesManager() { if (IsNotDesigner()) { myInstance = this; InstancesContext = new InstancesContext(); InstancesContext.GraphicInstances.EntityAdded += GraphicInstances_EntityAdded; InstancesContext.GraphicInstances.EntityRemoved += GraphicInstances_EntityRemoved; DispatcherTimer timer = new DispatcherTimer { Interval = new TimeSpan(0, 0, 0, 0, 1000) }; timer.Tick += new EventHandler(TimerTick); TypeLoader.Instance.Request(timer.Start); } }