Пример #1
0
        private static void OnMaxChargesChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            RechargeableBoxes rechargeableBoxes = o as RechargeableBoxes;

            if (rechargeableBoxes != null)
            {
                rechargeableBoxes.OnMaxChargesChanged((int)e.OldValue, (int)e.NewValue);
            }
        }
Пример #2
0
        private static void OnEndLabelChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            RechargeableBoxes rechargeableBoxes = o as RechargeableBoxes;

            if (rechargeableBoxes != null)
            {
                rechargeableBoxes.OnEndLabelChanged((string)e.OldValue, (string)e.NewValue);
            }
        }
Пример #3
0
        private void AddRechargeable(Character character, string beginLabel, int maxCharges, string key)
        {
            RechargeableBoxes rechargeable = new RechargeableBoxes();

            rechargeable.BeginLabel         = beginLabel;
            rechargeable.MaxCharges         = maxCharges;
            rechargeable.Key                = key;
            rechargeable.PlayerId           = character.playerID;
            rechargeable.MinBeginLabelWidth = RechargeableColumnStart;
            rechargeable.ChargesChanged    += Rechargeable_ChargesChanged;

            Viewbox viewbox = new Viewbox();

            viewbox.MaxWidth            = 180;
            viewbox.StretchDirection    = StretchDirection.DownOnly;
            viewbox.Child               = rechargeable;
            viewbox.HorizontalAlignment = HorizontalAlignment.Left;
            spSpellSlots.Children.Add(viewbox);
        }