fixed #346
This commit is contained in:
1 parent
d083df2b42
commit
31e962f594
1 file changed
+34
@@ -8,6 +8,7 @@ using System.Windows.Input;
|
|||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Threading;
|
||||||
using HandyControl.Data;
|
using HandyControl.Data;
|
||||||
using HandyControl.Interactivity;
|
using HandyControl.Interactivity;
|
||||||
using HandyControl.Properties.Langs;
|
using HandyControl.Properties.Langs;
|
||||||
@@ -157,6 +158,8 @@ namespace HandyControl.Controls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private bool _showBorderBottom;
|
private bool _showBorderBottom;
|
||||||
|
|
||||||
|
private DispatcherTimer _dispatcher;
|
||||||
|
|
||||||
#endregion Data
|
#endregion Data
|
||||||
|
|
||||||
#region ctor
|
#region ctor
|
||||||
@@ -444,6 +447,18 @@ namespace HandyControl.Controls
|
|||||||
{
|
{
|
||||||
if (ImageSource == null || !IsLoaded) return;
|
if (ImageSource == null || !IsLoaded) return;
|
||||||
|
|
||||||
|
if (ImageSource.IsDownloading)
|
||||||
|
{
|
||||||
|
_dispatcher = new DispatcherTimer(DispatcherPriority.ApplicationIdle)
|
||||||
|
{
|
||||||
|
Interval = TimeSpan.FromSeconds(1)
|
||||||
|
};
|
||||||
|
_dispatcher.Tick += Dispatcher_Tick;
|
||||||
|
_dispatcher.Start();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
double width;
|
double width;
|
||||||
double height;
|
double height;
|
||||||
|
|
||||||
@@ -495,6 +510,25 @@ namespace HandyControl.Controls
|
|||||||
InitBorderSmall();
|
InitBorderSmall();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Dispatcher_Tick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (ImageSource == null || !IsLoaded)
|
||||||
|
{
|
||||||
|
_dispatcher.Stop();
|
||||||
|
_dispatcher.Tick -= Dispatcher_Tick;
|
||||||
|
_dispatcher = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ImageSource.IsDownloading)
|
||||||
|
{
|
||||||
|
_dispatcher.Stop();
|
||||||
|
_dispatcher.Tick -= Dispatcher_Tick;
|
||||||
|
_dispatcher = null;
|
||||||
|
Init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ButtonActual_OnClick(object sender, RoutedEventArgs e)
|
private void ButtonActual_OnClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var scaleAnimation = AnimationHelper.CreateAnimation(1);
|
var scaleAnimation = AnimationHelper.CreateAnimation(1);
|
||||||
|
|||||||
Reference in new issue
Block a user