The timer in my app is doing some change and I want it to stop when the change is enough for me when it executes the stop()
method it doesn't stop.
timerpartAnimation = new DispatcherTimer();
timerpartAnimation.Interval = TimeSpan.FromMilliseconds(1);
timerpartAnimation.Tick += timer_Tick_Anime;
timerpartAnimation.Start();
public void timer_Tick_Anime(object sender, object e)
{
newL-=3;
newT = A * newL + B;
playPart33.Margin = new Thickness(newL, newT, playPart33.Margin.Right, playPart33.Margin.Bottom);
if (dis(playPart33.Margin, currentIm.Margin))
{
timerpartAnimation.Stop();
currentIm.Visibility = Windows.UI.Xaml.Visibility.Visible;
}
}
the weird thing is that this line:
currentIm.Visibility = Windows.UI.Xaml.Visibility.Visible;
does happening so it is deffenetly enter the if scope.
anyone has an idea?