private static void Skill_PropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            SkillControl o = (SkillControl)obj;

            o.Update();
            o.startingRank = ((Skill)args.NewValue).Rank;
        }
        public void AddSkills()
        {
            int count = 0;

            foreach (var s in _setting.Skills)
            {
                var cs = _career.Skills.Find(skill => skill.Name.Contains(s.Name)); // so that Melee and Ranged fall back for the setting works
                if (cs != null)
                {
                    s.IsCareer = true;
                }
                else
                {
                    s.IsCareer = false;
                }

                cs = _character.Skills.Find(skill => skill.Name.Contains(s.Name));
                if (cs != null)
                {
                    s.Rank = cs.StartingRank;
                }

                var sc = new SkillControl();
                sc.EnforceStartMax = false;
                sc.Margin          = new Thickness(0, 1, 0, 1);
                Binding b = new Binding("CharacteristicValue");
                switch (s.LinkedCharacteristic)
                {
                case Characteristic.Agility: b.Source = AgilityCharacteristic; break;

                case Characteristic.Brawn: b.Source = BrawnCharacteristic; break;

                case Characteristic.Cunning: b.Source = CunningCharacteristic; break;

                case Characteristic.Intellect: b.Source = IntellectCharacteristic; break;

                case Characteristic.Presence: b.Source = PresenceCharacteristic; break;

                case Characteristic.Willpower: b.Source = WillpowerCharacteristic; break;
                }
                b.Path = new PropertyPath("CharacteristicValue");
                sc.SetBinding(SkillControl.LinkedCharacteristicValueProperty, b);
                sc.OnXPEvent += XpEvent;
                if (count < _setting.Skills.Count / 2)
                {
                    GeneralSkillsPanel.Children.Add(sc);
                }
                else
                {
                    SkillsPanel2.Children.Add(sc);
                }
                sc.MySkill = s;
                count++;
            }
            _character.Skills = _setting.Skills;
        }
        public void AddSkills()
        {
            int count = 0;

            foreach (var s in MyCharacter.Skills)
            {
                var sc = new SkillControl();
                sc.Margin = new Thickness(0, 1, 0, 1);
                Binding b = new Binding("CharacteristicValue");
                switch (s.LinkedCharacteristic)
                {
                case Characteristic.Agility: b.Source = AgilityCharacteristic; break;

                case Characteristic.Brawn: b.Source = BrawnCharacteristic; break;

                case Characteristic.Cunning: b.Source = CunningCharacteristic; break;

                case Characteristic.Intellect: b.Source = IntellectCharacteristic; break;

                case Characteristic.Presence: b.Source = PresenceCharacteristic; break;

                case Characteristic.Willpower: b.Source = WillpowerCharacteristic; break;
                }
                b.Path = new PropertyPath("CharacteristicValue");
                sc.SetBinding(SkillControl.LinkedCharacteristicValueProperty, b);
                sc.OnXPEvent += XpEvent;
                if (count < MyCharacter.Skills.Count / 2)
                {
                    GeneralSkillsPanel.Children.Add(sc);
                }
                else
                {
                    SkillsPanel2.Children.Add(sc);
                }

                sc.MySkill = s;

                count++;
            }
        }
        private static void LinkedCharacteristicValue_PropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            SkillControl o = (SkillControl)obj;

            o.Update();
        }