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

            var spellWindow = new SpellEditorWindow(spell);

            spellWindow.Owner = this;

            var result = spellWindow.ShowDialog();

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

            spellWindow.Spell.CopyTo(spell);
            BindingOperations.GetBindingExpression(spellListView, ListView.ItemsSourceProperty).UpdateTarget();

            if (!string.Equals(spell.Name, originalName, StringComparison.Ordinal))
            {
                SpellMetadataManager.Instance.RenameSpell(originalName, spell.Name);
            }

            skillListView.SelectedItem = spell;
            skillListView.ScrollIntoView(spell);
        }
Пример #2
0
        void AddSpell()
        {
            var spellWindow = new SpellEditorWindow();

            spellWindow.Owner = this;

            var result = spellWindow.ShowDialog();

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

            SpellMetadataManager.Instance.AddSpell(spellWindow.Spell);
            spellListView.SelectedItem = spellWindow.Spell;
            spellListView.ScrollIntoView(spellWindow.Spell);
        }
        void EditSpell(SpellMetadata spell)
        {
            var originalName = spell.Name;

              var spellWindow = new SpellEditorWindow(spell);
              spellWindow.Owner = this;

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

              spellWindow.Spell.CopyTo(spell);
              BindingOperations.GetBindingExpression(spellListView, ListView.ItemsSourceProperty).UpdateTarget();

              if (!string.Equals(spell.Name, originalName, StringComparison.Ordinal))
            SpellMetadataManager.Instance.RenameSpell(originalName, spell.Name);

              skillListView.SelectedItem = spell;
              skillListView.ScrollIntoView(spell);
        }
        void AddSpell()
        {
            var spellWindow = new SpellEditorWindow();
              spellWindow.Owner = this;

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

              SpellMetadataManager.Instance.AddSpell(spellWindow.Spell);
              spellListView.SelectedItem = spellWindow.Spell;
              spellListView.ScrollIntoView(spellWindow.Spell);
        }