Closed punker76 closed 9 years ago
@charri this property can maybe directly implemented for the ISpinnable interface. what do you think?
@charri busy or is this repo dead?
@punker76 i hope not!
@punker76 - Sorry for the delay, currently very busy:
I will look at the pull-request asap :), thanks for being so patient
@charri will do that now.
one thing
this property can maybe directly implemented for the ISpinnable interface. what do you think?
not sure i understand the question. how can you implement the property in the ISpinnable interface?
@charri i mean, this attached property can be implemented directly as dependency property in FontAwesome
and ImageAwesome
(ok its a little bit boilerplate code)
public interface ISpinable
{
/// <summary>
/// Gets or sets the current spin (angle) animation of the icon.
/// </summary>
bool Spin { get; set; }
/// <summary>
/// Gets/Sets the duration of the spinning animation (in seconds). This will stop and start the spin animation.
/// </summary>
double SpinDuration { get; set; }
}
good idea, then it can be directly accessed as a property in the FontAwesome class
@charri this one...
/// <summary>
/// Identifies the FontAwesome.WPF.ImageAwesome.Spin dependency property.
/// </summary>
public static readonly DependencyProperty SpinDurationProperty =
DependencyProperty.Register("SpinDuration", typeof(double), typeof(ImageAwesome), new PropertyMetadata(1d, SpinDurationChanged, SpinDurationCoerceValue));
/// <summary>
/// Gets or sets the duration of the spinning animation (in seconds). This will stop and start the spin animation.
/// </summary>
public double SpinDuration
{
get { return (double)GetValue(SpinProperty); }
set { SetValue(SpinProperty, value); }
}
private static void SpinDurationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var imageAwesome = d as ImageAwesome;
if (null == imageAwesome || !imageAwesome.Spin || !(e.NewValue is double) || e.NewValue.Equals(e.OldValue)) return;
imageAwesome.StopSpin();
imageAwesome.BeginSpin();
}
:+1:
@charri done
that was fast!
I will do nuget push tomorrow/friday.
Add an attached dependency property to set the spinning animation duration.
This Fixes #16 Changable Duration for Spinning Icons