Beispiel #1
0
 public void Cut()
 {
     if (SelectedStrokesIds.Count == 0)
     {
         return;
     }
     Clipboard = new StrokeList(SelectedStrokes);
     Clipboard.ForEach(x => Strokes.Remove(x));
     SelectedStrokesIds.Clear();
     EditingMode = InkCanvasEditingMode.Select;
 }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        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);
        }