summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.UAP
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:02:14 (GMT)
commitfc74c65e8ec5e733e6e24a4db968dee430c01f73 (patch)
treee66d2079c20e7c8dfade4086806d3e37abdd20cf /Xamarin.Forms.Platform.UAP
parenta0fb20a075e89ddb8763faa1306f07041ea3d4fe (diff)
downloadxamarin-forms-fc74c65e8ec5e733e6e24a4db968dee430c01f73.zip
xamarin-forms-fc74c65e8ec5e733e6e24a4db968dee430c01f73.tar.gz
xamarin-forms-fc74c65e8ec5e733e6e24a4db968dee430c01f73.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.UAP')
-rw-r--r--Xamarin.Forms.Platform.UAP/MasterDetailControl.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
index 51f737f..dddd0ba 100644
--- a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
+++ b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
@@ -239,6 +239,13 @@ namespace Xamarin.Forms.Platform.UWP
_bottomCommandBarArea = GetTemplateChild("BottomCommandBarArea") as Border;
_topCommandBarArea = GetTemplateChild("TopCommandBarArea") as Border;
+ 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();
+ }
+
UpdateToolbarPlacement();
UpdateMode();