private static void OnMaxChargesChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { RechargeableBoxes rechargeableBoxes = o as RechargeableBoxes; if (rechargeableBoxes != null) { rechargeableBoxes.OnMaxChargesChanged((int)e.OldValue, (int)e.NewValue); } }
private static void OnEndLabelChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { RechargeableBoxes rechargeableBoxes = o as RechargeableBoxes; if (rechargeableBoxes != null) { rechargeableBoxes.OnEndLabelChanged((string)e.OldValue, (string)e.NewValue); } }
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); }