Наследование: System.Windows.Window
Пример #1
0
        void EditSkill(SkillMetadata skill)
        {
            var originalName = skill.Name;

            var skillWindow = new SkillEditorWindow(skill);

            skillWindow.Owner = this;

            var result = skillWindow.ShowDialog();

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

            skillWindow.Skill.CopyTo(skill);
            BindingOperations.GetBindingExpression(skillListView, ListView.ItemsSourceProperty).UpdateTarget();

            if (!string.Equals(skill.Name, originalName, StringComparison.Ordinal))
            {
                SkillMetadataManager.Instance.RenameSkill(originalName, skill.Name);
            }

            skillListView.SelectedItem = skill;
            skillListView.ScrollIntoView(skill);
        }
Пример #2
0
        void AddSkill()
        {
            var skillWindow = new SkillEditorWindow();

            skillWindow.Owner = this;

            var result = skillWindow.ShowDialog();

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

            SkillMetadataManager.Instance.AddSkill(skillWindow.Skill);
            skillListView.SelectedItem = skillWindow.Skill;
            skillListView.ScrollIntoView(skillWindow.Skill);
        }
        void AddSkill()
        {
            var skillWindow = new SkillEditorWindow();
              skillWindow.Owner = this;

              var result = skillWindow.ShowDialog();
              if (!result.HasValue || !result.Value)
            return;

              SkillMetadataManager.Instance.AddSkill(skillWindow.Skill);
              skillListView.SelectedItem = skillWindow.Skill;
              skillListView.ScrollIntoView(skillWindow.Skill);
        }
        void EditSkill(SkillMetadata skill)
        {
            var originalName = skill.Name;

              var skillWindow = new SkillEditorWindow(skill);
              skillWindow.Owner = this;

              var result = skillWindow.ShowDialog();
              if (!result.HasValue || !result.Value)
            return;

              skillWindow.Skill.CopyTo(skill);
              BindingOperations.GetBindingExpression(skillListView, ListView.ItemsSourceProperty).UpdateTarget();

              if (!string.Equals(skill.Name, originalName, StringComparison.Ordinal))
            SkillMetadataManager.Instance.RenameSkill(originalName, skill.Name);

              skillListView.SelectedItem = skill;
              skillListView.ScrollIntoView(skill);
        }