summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WinRT
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2016-10-26 19:02:14 (GMT)
committerRui Marinho <me@ruimarinho.net>2016-10-26 19:10:20 (GMT)
commitadab99b2c73da8d9e0e1c6f72d55deaddb47b8d4 (patch)
treea2c991171f072f5103e200c3b8a3647b02acb567 /Xamarin.Forms.Platform.WinRT
parent9195089b81bd1f47b7864aa62b833a67703f84a7 (diff)
downloadxamarin-forms-adab99b2c73da8d9e0e1c6f72d55deaddb47b8d4.zip
xamarin-forms-adab99b2c73da8d9e0e1c6f72d55deaddb47b8d4.tar.gz
xamarin-forms-adab99b2c73da8d9e0e1c6f72d55deaddb47b8d4.tar.bz2
[Win] Toolbar placement works with initial value (#488)
* Defer UpdateToolbarPlacement until CommandBar is in the control hierarchy * Cleanup
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT')
-rw-r--r--Xamarin.Forms.Platform.WinRT/PageControl.xaml.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/PageControl.xaml.cs b/Xamarin.Forms.Platform.WinRT/PageControl.xaml.cs
index 7be51c0..a57b674 100644
--- a/Xamarin.Forms.Platform.WinRT/PageControl.xaml.cs
+++ b/Xamarin.Forms.Platform.WinRT/PageControl.xaml.cs
@@ -150,7 +150,13 @@ namespace Xamarin.Forms.Platform.WinRT
#if WINDOWS_UWP
_bottomCommandBarArea = GetTemplateChild("BottomCommandBarArea") as Border;
_topCommandBarArea = GetTemplateChild("TopCommandBarArea") as Border;
- UpdateToolbarPlacement();
+
+ if (_commandBar != null && _bottomCommandBarArea != null && _topCommandBarArea != null)
+ {
+ // We have to wait for the command bar to load so that it'll be in the control hierarchy
+ // otherwise we can't properly move it to wherever the toolbar is supposed to be
+ _commandBar.Loaded += (sender, args) => UpdateToolbarPlacement();
+ }
#endif
TaskCompletionSource<CommandBar> tcs = _commandBarTcs;