private void OnRegionsLoaded(DataLoaded <Region> e) { foreach (var region in e.Data) { var viewmodel = new RegionViewModel(region); AllRegions.Add(viewmodel); //viewmodel.Exists(); viewmodel.AddToUI(Overlay); } }
private void OnMouseStateChanged(MouseState e) { if (e.IsLeftButtonDown) { if (EditingRegion == null) { EditingRegion = new RegionViewModel(e.Position); EditingRegion.AddToUI(Overlay); DragOrigin = e.Position; return; } EditingRegion.ApplyDrag(DragOrigin, e.Position); } else { CommitRegion(); } }