public void Cut() { if (SelectedStrokesIds.Count == 0) { return; } Clipboard = new StrokeList(SelectedStrokes); Clipboard.ForEach(x => Strokes.Remove(x)); SelectedStrokesIds.Clear(); EditingMode = InkCanvasEditingMode.Select; }
private async Task RemoveSelection() { var strokesToUpdate = new Dictionary <string, string>(); SelectedStrokesIds.ForEach(x => strokesToUpdate.Add(x, null)); if (!IsOffline) { await DatabaseService.Ref(DatabasePaths.Drawings) .Child(Id) .Child(DatabasePaths.SelectedStrokes) .Update(strokesToUpdate); } }
private bool IsSelectionDifferent(StrokeCollection newSelection) { if (newSelection.Count != SelectedStrokesIds.Count) { return(true); } foreach (var s in newSelection) { var stroke = s as StrokeModel; if (stroke == null || !SelectedStrokesIds.Contains(stroke.Id)) { return(true); } } return(false); }