@@ -45,6 +45,7 @@ private class DummyFrameworkElement : FrameworkElement { }
4545 [ "SolidColorBrush" ] = HandleXmlElement_SolidColorBrush ,
4646 [ "ImageBrush" ] = HandleXmlElement_ImageBrush ,
4747 [ "LinearGradientBrush" ] = HandleXmlElement_LinearGradientBrush ,
48+ [ "RadialGradientBrush" ] = HandleXmlElement_RadialGradientBrush ,
4849
4950 [ "GradientStop" ] = HandleXmlElement_GradientStop ,
5051
@@ -573,6 +574,7 @@ private static GradientStop HandleXmlElement_GradientStop(CustomDialog dialog, X
573574 private static Brush HandleXmlElement_LinearGradientBrush ( CustomDialog dialog , XElement xmlElement )
574575 {
575576 var brush = new LinearGradientBrush ( ) ;
577+
576578 HandleXml_Brush ( brush , xmlElement ) ;
577579
578580 object ? startPoint = GetPointFromXElement ( xmlElement , "StartPoint" ) ;
@@ -593,6 +595,29 @@ private static Brush HandleXmlElement_LinearGradientBrush(CustomDialog dialog, X
593595 return brush ;
594596 }
595597
598+ private static Brush HandleXmlElement_RadialGradientBrush ( CustomDialog dialog , XElement xmlElement ) {
599+ var radialbrush = new RadialGradientBrush ( ) ;
600+
601+ HandleXml_Brush ( radialbrush , xmlElement ) ;
602+
603+ object ? startPoint = GetPointFromXElement ( xmlElement , "GradientOrigin" ) ;
604+ if ( startPoint is Point )
605+ radialbrush . GradientOrigin = ( Point ) startPoint ;
606+
607+ object ? endPoint = GetPointFromXElement ( xmlElement , "Center" ) ;
608+ if ( endPoint is Point )
609+ radialbrush . Center = ( Point ) endPoint ;
610+
611+ radialbrush . ColorInterpolationMode = ParseXmlAttribute < ColorInterpolationMode > ( xmlElement , "ColorInterpolationMode" , ColorInterpolationMode . SRgbLinearInterpolation ) ;
612+ radialbrush . MappingMode = ParseXmlAttribute < BrushMappingMode > ( xmlElement , "MappingMode" , BrushMappingMode . RelativeToBoundingBox ) ;
613+ radialbrush . SpreadMethod = ParseXmlAttribute < GradientSpreadMethod > ( xmlElement , "SpreadMethod" , GradientSpreadMethod . Pad ) ;
614+
615+ foreach ( var child in xmlElement . Elements ( ) )
616+ radialbrush . GradientStops . Add ( HandleXml < GradientStop > ( dialog , child ) ) ;
617+
618+ return radialbrush ;
619+ }
620+
596621 private static void ApplyBrush_UIElement ( CustomDialog dialog , FrameworkElement uiElement , string name , DependencyProperty dependencyProperty , XElement xmlElement )
597622 {
598623 // check if attribute exists
0 commit comments