private static void IsDimmedChanged(MaterialDimmer i, DPChangedEventArgs<bool> e)
		{
			if (e.NewValue)
			{
				i.IsHitTestVisible = true;
				i._rectangle.BeginAnimation(OpacityProperty,
					new DoubleAnimation(i.DimPercent, new Duration(TimeSpan.FromMilliseconds(200)))
					{
						AccelerationRatio = AnimationParameters.AccelerationRatio,
						DecelerationRatio = AnimationParameters.DecelerationRatio
					});
			}
			else
			{
				i.IsHitTestVisible = false;
				i._rectangle.BeginAnimation(OpacityProperty,
					new DoubleAnimation(0, new Duration(TimeSpan.FromMilliseconds(200)))
					{
						AccelerationRatio = AnimationParameters.AccelerationRatio,
						DecelerationRatio = AnimationParameters.DecelerationRatio
					});
			}
		}
Beispiel #2
0
 private static void IsDimmedChanged(MaterialDimmer i, DPChangedEventArgs <bool> e)
 {
     if (e.NewValue)
     {
         i.IsHitTestVisible = true;
         i._rectangle.BeginAnimation(OpacityProperty,
                                     new DoubleAnimation(i.DimPercent, new Duration(TimeSpan.FromMilliseconds(200)))
         {
             AccelerationRatio = AnimationParameters.AccelerationRatio,
             DecelerationRatio = AnimationParameters.DecelerationRatio
         });
     }
     else
     {
         i.IsHitTestVisible = false;
         i._rectangle.BeginAnimation(OpacityProperty,
                                     new DoubleAnimation(0, new Duration(TimeSpan.FromMilliseconds(200)))
         {
             AccelerationRatio = AnimationParameters.AccelerationRatio,
             DecelerationRatio = AnimationParameters.DecelerationRatio
         });
     }
 }