summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.UAP
diff options
context:
space:
mode:
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 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)