void SetFrom(ShapeCollectionSave shapeCollectionSave)
        {
            Clear();

            foreach(var saveObject in shapeCollectionSave.AxisAlignedRectangleSaves)
            {
                var runtime = saveObject.ToAxisAlignedRectangle();

                var vm = new AxisAlignedRectangleViewModel(runtime);

                Rectangles.Add(vm);
            }

            foreach (var saveObject in shapeCollectionSave.CircleSaves)
            {
                var runtime = saveObject.ToCircle();

                var vm = new CircleViewModel(runtime);

                Circles.Add(vm);
            }

            foreach(var saveObject in shapeCollectionSave.PolygonSaves)
            {
                var runtime = saveObject.ToPolygon();

                var vm = new PolygonViewModel(runtime);

                Polygons.Add(vm);
            }


        }
Example #2
0
        void SetFrom(ShapeCollectionSave shapeCollectionSave)
        {
            Clear();

            foreach (var saveObject in shapeCollectionSave.AxisAlignedRectangleSaves)
            {
                var runtime = saveObject.ToAxisAlignedRectangle();

                var vm = new AxisAlignedRectangleViewModel(runtime);

                Rectangles.Add(vm);
            }

            foreach (var saveObject in shapeCollectionSave.CircleSaves)
            {
                var runtime = saveObject.ToCircle();

                var vm = new CircleViewModel(runtime);

                Circles.Add(vm);
            }

            foreach (var saveObject in shapeCollectionSave.PolygonSaves)
            {
                var runtime = saveObject.ToPolygon();

                var vm = new PolygonViewModel(runtime);

                Polygons.Add(vm);
            }
        }