コード例 #1
0
        /// <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);
        }
コード例 #2
0
 /// <summary>
 /// Constructor
 /// </summary>
 public StreamConverterViewModel()
 {
     PreviewViewModel  = new PreviewViewModel();
     ResourceViewModel = new ResourceViewModel();
     XamlViewModel     = new XamlViewModel();
     CSharpViewModel   = new CSharpViewModel();
     ExportViewModel   = new ExportViewModel();
 }