diff options
3 files changed, 68 insertions, 1 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43519.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43519.cs new file mode 100644 index 00000000..43f1d84f --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43519.cs @@ -0,0 +1,66 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 43519, "[UWP] MasterDetail page ArguementException when nested in a TabbedPage and returning from modal page", PlatformAffected.UWP)] + public class Bugzilla43519 : TestTabbedPage + { + protected override void Init() + { + var modalPage = new ContentPage + { + Title = "ModalPage", + Content = new StackLayout + { + Children = + { + new Button + { + Command = new Command(() => Navigation.PopModalAsync()), + Text = "Pop modal page -- should not crash on UWP" + } + } + } + }; + + var mdp = new MasterDetailPage + { + Title = "Page 1", + Master = new ContentPage + { + Title = "Master", + Content = new StackLayout() + }, + Detail = new ContentPage + { + Title = "Detail", + Content = new StackLayout() + } + }; + + Children.Add(mdp); + Children.Add(new ContentPage + { + Title = "Page 2", + Content = new StackLayout + { + Children = + { + new Button + { + Command = new Command(() => Navigation.PushModalAsync(modalPage)), + Text = "Click to display modal" + } + } + } + }); + } + } +}
\ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index 28763194..99f2bf81 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -146,6 +146,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43313.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43469.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43516.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43519.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43527.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44047.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43941.cs" /> diff --git a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs index 56dd4d94..65cdf713 100644 --- a/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs +++ b/Xamarin.Forms.Platform.UAP/MasterDetailControl.cs @@ -96,7 +96,7 @@ namespace Xamarin.Forms.Platform.UWP width -= _masterPresenter.ActualWidth; } - return new Windows.Foundation.Size(width, height); + return new Windows.Foundation.Size(width >= 0 ? width : 0, height); } } |