/// <summary> /// Prepare all data for the graphic path selection listbox /// </summary> void PrepSelectionList() { if (graphicVisual != null) { var previewIcons = new List <PreviewShapeViewModel>(); int index = 0; CreateShapeSelectionList(graphicVisual, previewIcons, ref index); PreviewShapes = previewIcons; if (previewIcons.Count > 0) { TriggerResetView.Fire(); ResourceViewModel.Reset(); XamlViewModel.Reset(); CSharpViewModel.Reset(); } SelectAllPreviewIcons(true); } else { PreviewShapes = null; PreviewViewModel.SetNewGraphicVisual(null); ResourceViewModel.SetNewGraphicVisual(null); XamlViewModel.SetNewGraphicVisual(null); CSharpViewModel.SetNewGraphicVisual(null); ExportViewModel.SetNewGraphicVisual(null); } }
/// <summary> /// Update all views with the new selection /// </summary> private void UpdateAll() { GraphicColorPrecision?colorPrecision = null; // get the selected paths selectedVisual = BuildSelectedDrawing(graphicVisual); if (selectedVisual != null) { colorPrecision = GetColorPrecision(selectedVisual); } PreviewViewModel.SetNewGraphicVisual(selectedVisual, colorPrecision); ResourceViewModel.SetNewGraphicVisual(selectedVisual, colorPrecision); XamlViewModel.SetNewGraphicVisual(selectedVisual, colorPrecision); CSharpViewModel.SetNewGraphicVisual(selectedVisual); ExportViewModel.SetNewGraphicVisual(selectedVisual); }