public MainWindow() { InitializeComponent(); BaseDataStore.LoadData(); BasePicture.CreateCanvas(); BasePicture.ClearAllSelected(); BaseCanvas.Children.Add(BasePicture.MainCanvas); }
private void SaveButton_OnClick(object sender, RoutedEventArgs e) { if (ElementTypeCombobox.SelectedIndex < 0 || MarkTextBox.Text.Length < 1) { MessageBox.Show("Укажите тип и маркировку элемента!"); return; } int elT = ((KeyValuePair <int, string>)ElementTypeCombobox.SelectedItem).Key; Element el = new Element() { Id = Guid.NewGuid(), ElementType = elT, Mark = MarkTextBox.Text, ImageSource = _photoPath, Location = locate, Purpose = PurposeTextBox.Text, Rotate = RotateComboBox.SelectedIndex * 90 }; BaseDataStore.AddElement(el); element = el; this.Close(); }
private void Window_Closed(object sender, EventArgs e) { BaseDataStore.SaveData(); }