public LayoutPath(string pathMarkup) { DefaultStyleKey = typeof(LayoutPath); Path = new StringToPathGeometryConverter().Convert(pathMarkup); Loaded += delegate { TransformToProgress(PathProgress); }; }
private static string Convert(string value) { if (value == null) { return(null); } var converter = new StringToPathGeometryConverter(); var convertString = converter.Convert(value); var pathText = converter.ConvertBack(convertString); return(pathText?.Length > 0 ? pathText : null); }
public static System.Windows.Media.Geometry GetDataPathGeometry(this StringBuilder self) { #if WPF if (self.Length == 0) { return(System.Windows.Media.Geometry.Empty); } return(System.Windows.Media.Geometry.Parse(self.ToString())); #endif #if SILVERLIGHT if (self.Length == 0) { return(null); } StringToPathGeometryConverter converter = new StringToPathGeometryConverter(); return(converter.Convert(self.ToString())); #endif }