예제 #1
0
        private void UpdateGroupClick(object sender, RoutedEventArgs e)
        {
            if ((GroupListView.SelectedItem as PhrasesGroup) == null)
            {
                MessageBox.Show("Select any group", "Fail", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            PhrasesGroup oldGroup = (PhrasesGroup)GroupListView.SelectedItem;

            _groupWindow = new GroupAddWindow((newGroup)
                                              => GroupAddUpdateRequirement(newGroup, oldGroup), oldGroup);

            bool?result = _groupWindow.ShowDialog();

            if (result == null || !result.Value)
            {
                return;
            }

            oldGroup.GroupName    = _groupWindow.Group.GroupName;
            oldGroup.GroupTheme   = _groupWindow.Group.GroupTheme;
            oldGroup.FromLanguage = _groupWindow.Group.FromLanguage;
            oldGroup.ToLanguage   = _groupWindow.Group.ToLanguage;

            UpdateGridViewColumnsSize(GroupGridViewColumns);
        }
예제 #2
0
        private void AddGroupClick(object sender, RoutedEventArgs e)
        {
            _groupWindow = new GroupAddWindow((newGroup)
                                              => GroupAddUpdateRequirement(newGroup))
            {
                Owner = this,
                WindowStartupLocation = WindowStartupLocation.CenterOwner
            };

            bool?result = _groupWindow.ShowDialog();

            if (result == null || !result.Value)
            {
                return;
            }

            _wallpaperController.PhrasesGroups.Add(new PhrasesGroup(_groupWindow.Group.GroupName,
                                                                    _groupWindow.Group.GroupTheme, _groupWindow.Group.ToLanguage, _groupWindow.Group.FromLanguage));

            UpdateGridViewColumnsSize(GroupGridViewColumns);
        }