From fc74c65e8ec5e733e6e24a4db968dee430c01f73 Mon Sep 17 00:00:00 2001 From: Samantha Houts Date: Wed, 26 Oct 2016 12:02:14 -0700 Subject: [Win] Toolbar placement works with initial value (#488) * Defer UpdateToolbarPlacement until CommandBar is in the control hierarchy * Cleanup --- Xamarin.Forms.Platform.UAP/MasterDetailControl.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Xamarin.Forms.Platform.UAP') diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs index 51f737f8..dddd0ba6 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(); -- cgit v1.2.3