Merge pull request #472 from xsnakes/master
Fix null exception (when application shutdown with transitioning)
This commit is contained in:
1 file changed
+9
-2
@@ -49,7 +49,14 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (Visibility != Visibility.Visible || _contentPresenter == null) return;
|
||||
|
||||
(TransitionStoryboard ?? ResourceHelper.GetResource<Storyboard>($"{TransitionMode.ToString()}Transition"))?.Begin(_contentPresenter);
|
||||
if (TransitionStoryboard != null)
|
||||
{
|
||||
TransitionStoryboard.Begin(_contentPresenter);
|
||||
}
|
||||
else if (Application.Current != null)
|
||||
{
|
||||
ResourceHelper.GetResource<Storyboard>($"{TransitionMode.ToString()}Transition")?.Begin(_contentPresenter);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnApplyTemplate()
|
||||
@@ -73,4 +80,4 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user