summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.UAP
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2016-06-16 17:09:22 (GMT)
committerRui Marinho <me@ruimarinho.net>2016-06-16 17:09:22 (GMT)
commitaf6ac9649f71d1557dffa3dc3357868016ebc1e7 (patch)
treef46a823ac63d614991f48d119f32821c2c8854ca /Xamarin.Forms.Platform.UAP
parent7ae79f49072d4543da80eaf443e214fdfa02ed9c (diff)
downloadxamarin-forms-af6ac9649f71d1557dffa3dc3357868016ebc1e7.zip
xamarin-forms-af6ac9649f71d1557dffa3dc3357868016ebc1e7.tar.gz
xamarin-forms-af6ac9649f71d1557dffa3dc3357868016ebc1e7.tar.bz2
[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.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
index 9ec03f8..6787cce 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)