diff options
author | Samantha Houts <samantha@teamredwall.com> | 2016-10-26 12:02:14 -0700 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2016-10-26 20:10:20 +0100 |
commit | adab99b2c73da8d9e0e1c6f72d55deaddb47b8d4 (patch) | |
tree | a2c991171f072f5103e200c3b8a3647b02acb567 /Xamarin.Forms.Platform.WinRT.Phone | |
parent | 9195089b81bd1f47b7864aa62b833a67703f84a7 (diff) | |
download | xamarin-forms-adab99b2c73da8d9e0e1c6f72d55deaddb47b8d4.tar.gz xamarin-forms-adab99b2c73da8d9e0e1c6f72d55deaddb47b8d4.tar.bz2 xamarin-forms-adab99b2c73da8d9e0e1c6f72d55deaddb47b8d4.zip |
[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.Phone')
-rw-r--r-- | Xamarin.Forms.Platform.WinRT.Phone/FormsPivot.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.WinRT.Phone/FormsPivot.cs b/Xamarin.Forms.Platform.WinRT.Phone/FormsPivot.cs index b06acb1f..68586abc 100644 --- a/Xamarin.Forms.Platform.WinRT.Phone/FormsPivot.cs +++ b/Xamarin.Forms.Platform.WinRT.Phone/FormsPivot.cs @@ -77,7 +77,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; |