/// <summary> /// Parse and display the new input stream /// </summary> private void CreatePaths(string stream) { GraphicPath path; try { var streamGeometryParser = new StreamGeometryParser(); var graphicPathGeometry = streamGeometryParser.ParseGeometry(stream); path = new GraphicPath(); path.Geometry = graphicPathGeometry; path.FillBrush = new GraphicSolidColorBrush { Color = Color.FromRgb(128, 128, 128) }; ShowError = false; } catch { path = null; ShowError = true; } PreviewViewModel.SetNewGraphicPath(path); ResourceViewModel.SetNewGraphicVisual(path); XamlViewModel.SetNewGraphicVisual(path); CSharpViewModel.SetNewGraphicVisual(path); ExportViewModel.SetNewGraphicVisual(path); }
/// <summary> /// Constructor /// </summary> public StreamConverterViewModel() { PreviewViewModel = new PreviewViewModel(); ResourceViewModel = new ResourceViewModel(); XamlViewModel = new XamlViewModel(); CSharpViewModel = new CSharpViewModel(); ExportViewModel = new ExportViewModel(); }