Beispiel #1
0
        // We want to kick off this method, we don't need to (a)wait for the response.
        private async void Init()
        {
            var internalPaths = await CanvasRepository.GetInternalPathsAsync().ConfigureAwait(false);

            var externalPaths = await Task.Run(() => CanvasRepository.GetExternalPaths(UpdatePaths));

            if (internalPaths?.Count > 0)
            {
                Paths = internalPaths;
            }
            else
            {
                Paths = new List <Path>();
            }

            if (externalPaths?.Count > 0)
            {
                ExternalPaths = externalPaths;
            }
            else
            {
                ExternalPaths = new List <Path>();
            }

            UpdateCanvas?.Invoke();
        }
Beispiel #2
0
        void ClearAll()
        {
            CanvasRepository?.DeleteAllPaths();
            Paths = new List <Path>();
            UpdateCanvas?.Invoke();

            Paths         = new List <Path>();
            ExternalPaths = new List <Path>();
        }
Beispiel #3
0
        void UndoLastPath()
        {
            var path = Paths?.Last();

            if (path != null)
            {
                CanvasRepository?.DeletePath(path);
                Paths.Remove(path);
                UpdateCanvas?.Invoke();
            }
        }
Beispiel #4
0
        void UpdatePaths(List <Path> paths)
        {
            ExternalPaths = paths;
            var internalPaths = CanvasRepository.GetInternalPaths();



            if (internalPaths == null || internalPaths?.Count == 0)
            {
                Paths = new List <Path>();
            }


            UpdateCanvas?.Invoke();
        }
Beispiel #5
0
 void UpdatePaths(List <Path> paths)
 {
     ExternalPaths = paths;
     UpdateCanvas?.Invoke();
 }
Beispiel #6
0
 void SavePath(Path path)
 {
     Task.Run(() => CanvasRepository?.SavePath(path));
     UpdateCanvas?.Invoke();
 }