Example #1
0
 public static IEnumerable <BaseShapeViewModel> GetAllShapes(this ProjectContainerViewModel project)
 {
     return(project?.Documents
            .SelectMany(d => d.Pages)
            .SelectMany(c => c.Layers)
            .SelectMany(l => l.Shapes));
 }
Example #2
0
        public static IEnumerable <T> GetAllShapes <T>(this ProjectContainerViewModel project)
        {
            var shapes = project?.Documents
                         .SelectMany(d => d.Pages)
                         .SelectMany(c => c.Layers)
                         .SelectMany(l => l.Shapes);

            return(shapes.GetAllShapes()?.Where(s => s is T).Cast <T>());
        }