private void OnVialsChange(object source, ChargeBladeEventArgs args)
 {
     Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() =>
     {
         Vials = args.Vials;
     }));
 }
 private void OnShieldBuffUpdate(object source, ChargeBladeEventArgs args)
 {
     Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() =>
     {
         ShieldBuff        = args.ShieldBuffTimer > 0 ? $"{TimeSpan.FromSeconds(args.ShieldBuffTimer):m\\:ss}" : null;
         ShieldBuffOpacity = args.ShieldBuffTimer > 0 ? 1 : 0;
     }));
 }
 private void OnPowerchargeUpdate(object source, ChargeBladeEventArgs args)
 {
     Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() =>
     {
         PoweraxeBuff    = args.PoweraxeTimer > 0 ? $"{TimeSpan.FromSeconds(args.PoweraxeTimer):ss}" : null;
         PoweraxeOpacity = args.PoweraxeTimer > 0 ? 1 : 0;
     }));
 }
 private void OnVialChargeGaugeUpdate(object source, ChargeBladeEventArgs args)
 {
     Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() =>
     {
         HiddenGaugeSize  = 77 * args.VialChargeGauge / 100;
         HiddenGaugeColor = args.VialChargeGauge < 30 ? "#FFD6CBB8" :
                            args.VialChargeGauge > 70 ? "#FFFF0202" :
                            args.VialChargeGauge > 45 ? "#FFA41515" : "#FFD68800";
     }));
 }
        private void UpdateInformation()
        {
            // In case HunterPie is started mid-game, update everything without waiting for events
            ChargeBladeEventArgs dummyArgs = new ChargeBladeEventArgs(Context);

            OnPowerchargeUpdate(this, dummyArgs);
            OnVialsChange(this, dummyArgs);
            OnVialChargeGaugeUpdate(this, dummyArgs);
            OnSwordBuffUpdate(this, dummyArgs);
            OnShieldBuffUpdate(this, dummyArgs);
        }