internal XamlRenderer GetCachedXamlRenderer(GaugeGraphics g) { if (xamlRenderer != null) { return(xamlRenderer); } BackFrameStyle backFrameStyle = FrameStyle; if (backFrameStyle == BackFrameStyle.None) { backFrameStyle = BackFrameStyle.Edged; } xamlRenderer = new XamlRenderer(FrameShape.ToString() + "." + backFrameStyle.ToString() + ".xaml"); xamlRenderer.AllowPathGradientTransform = false; RectangleF frameRectangle = GetFrameRectangle(g); Color[] layerHues = new Color[2] { FrameColor, BackColor }; xamlRenderer.ParseXaml(frameRectangle, layerHues); return(xamlRenderer); }