diff options
author | Samantha Houts <samantha@teamredwall.com> | 2016-06-16 10:09:22 -0700 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2016-06-16 18:09:22 +0100 |
commit | af6ac9649f71d1557dffa3dc3357868016ebc1e7 (patch) | |
tree | f46a823ac63d614991f48d119f32821c2c8854ca /Xamarin.Forms.Platform.UAP | |
parent | 7ae79f49072d4543da80eaf443e214fdfa02ed9c (diff) | |
download | xamarin-forms-af6ac9649f71d1557dffa3dc3357868016ebc1e7.tar.gz xamarin-forms-af6ac9649f71d1557dffa3dc3357868016ebc1e7.tar.bz2 xamarin-forms-af6ac9649f71d1557dffa3dc3357868016ebc1e7.zip |
[UWP] MasterDetailControl will no longer null out the TCS before it is used. (#227)
* [UWP] Don't null the _commandBarTcs too soon
* Add repro for 41842
Diffstat (limited to 'Xamarin.Forms.Platform.UAP')
-rw-r--r-- | Xamarin.Forms.Platform.UAP/MasterDetailControl.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs index 9ec03f8d..6787ccec 100644 --- a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs +++ b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs @@ -167,7 +167,11 @@ namespace Xamarin.Forms.Platform.UWP _commandBarTcs = new TaskCompletionSource<CommandBar>(); ApplyTemplate(); - return _commandBarTcs.Task; + + var commandBarFromTemplate = _commandBarTcs.Task; + _commandBarTcs = null; + + return commandBarFromTemplate; } protected override void OnApplyTemplate() @@ -193,12 +197,8 @@ namespace Xamarin.Forms.Platform.UWP UpdateMode(); - TaskCompletionSource<CommandBar> tcs = _commandBarTcs; - if (tcs != null) - { - _commandBarTcs = null; - tcs.SetResult(_commandBar); - } + if (_commandBarTcs != null) + _commandBarTcs.SetResult(_commandBar); } static void OnShouldShowSplitModeChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) |