public InsertGeFileCommand(string fileName, GraphicContent graphicContent) { f_layers = new List<Layer>(); Canvas loadedCanvas; using (FileStream fileStream = new FileStream(fileName, FileMode.Open)) { try { loadedCanvas = XamlReader.Load(fileStream) as Canvas; } catch (XamlParseException exception) { MessageBox.Show(exception.ToString(), @"Error adding layer"); return; } catch (ArgumentException exception) { MessageBox.Show(exception.ToString(), @"Error adding layer"); return; } } if (loadedCanvas == null) return; foreach (Layer layer in loadedCanvas.Children) f_layers.Add(layer.Clone(false)); f_graphicContent = graphicContent; }
public void InsertGeFile(string filename, GraphicContent graphicContent) { f_command = new InsertGeFileCommand(filename, graphicContent); f_undoCommands.Push(f_command); f_redoCommands.Clear(); f_command.Execute(); }
public Tool(GraphicContent graphicContent) { f_graphicContent = graphicContent; f_graphicContent.WorkSpace.MouseMove += MouseMoveHandler; f_graphicContent.WorkSpace.MouseLeftButtonDown += MouseDownHandler; f_graphicContent.WorkSpace.MouseLeftButtonUp += MouseUpHandler; }
public BrushTool(GraphicContent graphicContent) : base(graphicContent) { f_thickness = 2; f_opacity = 1; f_softness = 10; Name = "Brush"; }
public LineTool(GraphicContent graphicContent) : base(graphicContent) { f_thickness = 10; f_opacity = 1; f_softness = 10; Name = "Line"; }
public LayersChildWindowFactory(GraphicContent graphicContent) { GraphicContent = graphicContent; ChildWindow = new LayersViewChildWindow { Header = "Layers" }; ChildWindow.Move(-20, 10); ((LayersViewViewModel)ChildWindow.ViewModel).AddLayer(GraphicContent.SelectedLayer); ((LayersViewViewModel)ChildWindow.ViewModel).OnLayerCreate += LayerWindowViewModel_OnLayerCreate; ((LayersViewViewModel)ChildWindow.ViewModel).OnLayerDelete += LayerWindowViewModel_OnLayerDelete; ((LayersViewViewModel)ChildWindow.ViewModel).OnLayerDublicate += LayerWindowViewModel_OnLayerDublicate; GraphicContent.OnLayerCreate += GraphicContentOnOnLayerCreate; GraphicContent.OnLayerRemove += GraphicContentOnOnLayerRemove; }
public MainWindowViewModel() { SubscribeToCommands(); GraphicContent = new GraphicContent(); GraphicContent.WorkSpace.MouseMove += GraphicContentWorkSpaceMouseMove; ConfigureWorkSpace(); f_layersChildWindowFactory = new LayersChildWindowFactory(GraphicContent); f_colorPickerChildWindowFactory = new ColorPickerChildWindowFactory(); f_zoomBoxChildWindowFactory = new ZoomBoxChildWindowFactory(); ((ZoomBoxChildWindow)f_zoomBoxChildWindowFactory.ChildWindow).ScrollViewer = ScrollViewer; ((ColorPickerViewModel)f_colorPickerChildWindowFactory.ChildWindow.ViewModel).Subscribe(GraphicContent.GraphicToolProperties); f_childWindows = new List<IChildWindowFactory>() { f_layersChildWindowFactory, f_colorPickerChildWindowFactory, f_zoomBoxChildWindowFactory }; }
public FillTool(GraphicContent graphicContent) : base(graphicContent) { Name = "Fill"; }
public NoTool(GraphicContent graphicContent) : base(graphicContent) { }
public PointerTool(GraphicContent graphicContent) : base(graphicContent) { Name = "Pointer"; }