public TypeWindow() { InitializeComponent(); this.DataContext = this; Tip = new Tvpe { Ikonica = "/Images/basic_signs.png" }; }
private void Type_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!iconChanged) { Tvpe t = (Tvpe)cbType.SelectedValue; Event.Ikonica = t.Ikonica; } }
private void EditType_Click(object sender, RoutedEventArgs e) { if (dgTypes.SelectedValue != null) { Tvpe tip = (Tvpe)dgTypes.SelectedValue; var s = new TypeWindow(tip); s.ShowDialog(); ChartTypes(); } }
public TypeWindow(Tvpe tip) { InitializeComponent(); this.DataContext = this; tipe = tip; Tip = new Tvpe { Oznaka = tip.Oznaka, Naziv = tip.Naziv, Ikonica = tip.Ikonica, Opis = tip.Opis }; edit = true; TextBox_TextChanged(null, null); }
private void Discard_Click(object sender, RoutedEventArgs e) { if (edit) { Event.Ikonica = doge.Ikonica; } else { Tvpe t = (Tvpe)cbType.SelectedValue; Event.Ikonica = t.Ikonica; iconChanged = false; } }
private void DeleteType_Click(object sender, RoutedEventArgs e) { Tvpe tip = (Tvpe)dgTypes.SelectedValue; Data.Types.Remove(tip); /* * foreach (Event dog in Data.ListEvents) * if (dog.Tip == tip) * Data.ListEvents.Remove(dog); * * foreach (Event dog in Data.MapEvents) * if (dog.Tip == tip) * Data.MapEvents.Remove(dog); * * foreach (Event dog in Data.Events) * if (dog.Tip == tip) * Data.Events.Remove(dog); */ ChartTypes(); ChartTags(); }