示例#1
0
        /// <summary>
        /// Handles the Click event of the addGroupButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void addGroupButton_Click(object sender, RoutedEventArgs e)
        {
            GroupWindow window = new GroupWindow();

            if (window.OpenWindowInMode(OpenWindowMode.Add) == true)
            {
                DataManager.Instance.AddGroup(new Group(window.GroupName, window.Color));
                this.RefreshGroups();
            }
        }
示例#2
0
        /// <summary>
        /// Handles the Click event of the editGroupButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void editGroupButton_Click(object sender, RoutedEventArgs e)
        {
            GroupWindow window = new GroupWindow();

            window.GroupName = this.selectedGroup.Name;
            window.Color     = this.selectedGroup.Color;
            if (window.OpenWindowInMode(OpenWindowMode.Edit) == true)
            {
                this.selectedGroup.Name  = window.GroupName;
                this.selectedGroup.Color = window.Color;
                this.selectedGroup.InitGroupBrush();
                this.RefreshSelectedGroup();
                this.RefreshGroups();
            }
        }