public AddNewEntryWindow(Group currentGroup, IPreviewNewEntry previewNewEntry) { m_previewNewEntry = previewNewEntry; InitializeComponent(); m_currentGroup = currentGroup; textBlockGroupName.Text = m_currentGroup.Name; }
private void Window_Loaded(object sender, RoutedEventArgs e) { var collectionViewSourceGroups = (CollectionViewSource)(this.FindResource("collectionViewSourceGroups")); collectionViewSourceGroups.Source = (from x in DictionaryEntities.Singleton.Groups orderby x.TimeStamp descending select x).ToList().AsReadOnly(); if (Group != null) { dataGridGroups.SelectedItem = Group; Group = null; } }
private void dataGridGroups_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (dataGridGroups.IsEnabled) m_currentGroup = dataGridGroups.SelectedItem as Group; bool isGroupSelected = (m_currentGroup != null); buttonAddNewEntries.IsEnabled = isGroupSelected; dataGridEntries.IsEnabled = isGroupSelected; updateEntriesDataGrig(); }
private void HyperlinkCurrentGroup_Click(object sender, RoutedEventArgs e) { var window = new ChooseGroupWindow(); window.Group = CurrentGroup; window.ShowDialog(); if (window.Group != null) { CurrentGroup = window.Group; } }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { textBlockCurrentGroup.DataContext = this; bool hasGroup = DictionaryEntities.Singleton.Groups.Count() > 0; if (hasGroup) { var timeStamp = DictionaryEntities.Singleton.Groups.Max(x => x.TimeStamp); var group = (from x in DictionaryEntities.Singleton.Groups where x.TimeStamp == timeStamp select x).Single(); CurrentGroup = group; } else { buttonReset.Visibility = Visibility.Hidden; CurrentGroup = null; } }
private void dataGridGroups_MouseDoubleClick(object sender, MouseButtonEventArgs e) { Group = (Group)dataGridGroups.SelectedItem; Close(); }
/// <summary> /// Create a new Group object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="timeStamp">Initial value of the TimeStamp property.</param> public static Group CreateGroup(global::System.Guid id, global::System.String name, global::System.DateTime timeStamp) { Group group = new Group(); group.Id = id; group.Name = name; group.TimeStamp = timeStamp; return group; }
/// <summary> /// Deprecated Method for adding a new object to the Groups EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToGroups(Group group) { base.AddObject("Groups", group); }