private void OnStaminaUpdate(object source, PlayerStaminaEventArgs args) { Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() => { StaminaBar.UpdateBar(args.Stamina, args.MaxStamina); })); }