private void AddMenuItem_Click(object sender, RoutedEventArgs e) { CalenderItemDetailDialog dialog = new CalenderItemDetailDialog(); dialog.setDate(ItemDate.Date); dialog.ShowDialog(); if (dialog.DialogResult.Value) { CalenderItemDto dto = dialog.GUIToObject(); ApplicationData.Get().calendarItemStore.AddItem(dto); } }
private void newButton_Click(object sender, RoutedEventArgs e) { CalenderItemDetailDialog newItemDialog = new CalenderItemDetailDialog(); newItemDialog.ShowDialog(); if (newItemDialog.DialogResult.Value) { CalenderItemDto item = newItemDialog.GUIToObject(); appData.calendarItemStore.AddItem(item); } }
private void Row_DoubleClick(object sender, MouseButtonEventArgs e) { CalenderItemDetailDialog dialog = new CalenderItemDetailDialog(); dialog.ApplyDtoToGUI((sender as DataGridRow).DataContext as CalenderItemDto); dialog.ShowDialog(); if (dialog.DialogResult.Value) { //CalenderItemDto dto = dialog.GUIToObject(); //if (item != dto) //{ // dto.id = item.id; // item = dto; //} } }
private void UserControl_MouseDoubleClick(object sender, MouseButtonEventArgs e) { CalenderItemDetailDialog dialog = new CalenderItemDetailDialog(); dialog.ApplyDtoToGUI(item, true); dialog.ShowDialog(); if (dialog.DialogResult.Value) { CalenderItemDto dto = dialog.GUIToObject(); if (!item.Equals(dto)) { dto.id = item.id; item = dto; ApplicationData.Get().calendarItemStore.UpdateItem(dto); } } }