private void save_click(object sender, RoutedEventArgs e) { if (!DrawingLayer.GetInstance.IsSave) { save_as_click(sender, e); } if (DrawingLayer.GetInstance.FileName != null) { SerializationLayer.SerializeToXML(drawingSurface, DrawingLayer.GetInstance.FileName); } DrawingLayer.GetInstance.IsChanged = false; }
private void open_click(object sender, RoutedEventArgs e) { OpenFileDialog openDialog = new OpenFileDialog(); openDialog.FileName = ""; openDialog.Filter = "All Files (*.*)|*.*|Image files|*.svg;"; openDialog.Title = "Открыть файл"; var dialogResult = openDialog.ShowDialog(); if (dialogResult.HasValue && dialogResult.Value) { /*ImageBrush ibrush = new ImageBrush(); * ibrush.ImageSource = new BitmapImage(new Uri(openDialog.FileName.ToString())); * drawingSurface.Background = ibrush; */ SerializationLayer.DeserializeFromXML(openDialog.FileName, ref this.drawingSurface); } }