Exemple #1
0
        public static DrawingBrush GetDrawingForIcon(Octicon icon, Brush colorBrush, string theme = null)
        {
            string name = icon.ToString();

            if (theme != null)
            {
                name += "_" + theme;
            }
            if (drawingBrushes.ContainsKey(name))
            {
                return(drawingBrushes[name]);
            }

            var brush = new DrawingBrush()
            {
                Drawing = new GeometryDrawing()
                {
                    Brush    = colorBrush,
                    Geometry = OcticonPath.GetGeometryForIcon(icon).FreezeThis()
                }
                .FreezeThis(),
                Stretch = Stretch.Uniform
            }
            .FreezeThis();

            drawingBrushes.Add(name, brush);
            return(brush);
        }
        public static DrawingBrush GetDrawingForIcon(Octicon icon, Brush colorBrush, string theme = null)
        {
            string name = icon.ToString();
            if (theme != null)
                name += "_" + theme;
            if (drawingBrushes.ContainsKey(name))
                return drawingBrushes[name];

            var brush = new DrawingBrush()
            {
                Drawing = new GeometryDrawing()
                {
                    Brush = colorBrush,
                    Geometry = OcticonPath.GetGeometryForIcon(icon).FreezeThis()
                }
                .FreezeThis(),
                Stretch = Stretch.Uniform
            }
            .FreezeThis();
            drawingBrushes.Add(name, brush);
            return brush;
        }