diff options
author | Paul DiPietro <pauldipietro@users.noreply.github.com> | 2017-03-03 06:51:28 -0600 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2017-03-03 12:51:28 +0000 |
commit | b53ccf0d474f4c4d4a2679a8c7ab6c793cc2458d (patch) | |
tree | e24870a94b0bd9fce33f52dc84627ac6ceb14c38 /Xamarin.Forms.Controls.Issues | |
parent | bc13d3cfeeea62214f0c6f434e5f21f7117e2e1a (diff) | |
download | xamarin-forms-b53ccf0d474f4c4d4a2679a8c7ab6c793cc2458d.tar.gz xamarin-forms-b53ccf0d474f4c4d4a2679a8c7ab6c793cc2458d.tar.bz2 xamarin-forms-b53ccf0d474f4c4d4a2679a8c7ab6c793cc2458d.zip |
[WinRT/UWP] Do not allow IsPresented use in Split mode on desktop (#707)
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
2 files changed, 105 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla51236.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla51236.cs new file mode 100644 index 00000000..46737414 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla51236.cs @@ -0,0 +1,104 @@ +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, 51236, "[WinRT/UWP] Setting a MasterDetailPage's IsPresented to false should not be allowed in Split mode", PlatformAffected.WinRT)] + public class Bugzilla51236 : TestMasterDetailPage + { + protected override void Init() + { + var listView = new ListView + { + ItemsSource = new string[] { "A", "B", "C" }, + ItemTemplate = new DataTemplate(() => + { + var cell = new ViewCell(); + cell.View = new StackLayout + { + Children = + { + new Label { Text = "Click to set IsPresented to false" } + } + }; + return cell; + }), + }; + + IsPresented = false; + listView.ItemTapped += (s, e) => + { + IsPresented = false; + listView.SelectedItem = null; + Detail = new ContentPage + { + Title = "Detail", + Content = new StackLayout + { + Children = + { + new Button + { + Text = "Set IsPresented to true", + Command = new Command(() => IsPresented = true) + } + } + } + }; + }; + + Master = new ContentPage + { + Title = "Master", + Content = new StackLayout + { + Children = + { + listView, + new Button + { + Text = "Set MasterBehavior to Popover", + Command = new Command(() => + { + MasterBehavior = MasterBehavior.Popover; + IsPresented = false; + }) + }, + new Button + { + Text = "Set MasterBehavior to Split", + Command = new Command(() => MasterBehavior = MasterBehavior.Split) + }, + new Button + { + Text = "Set MasterBehavior to SplitOnLandscape", + Command = new Command(() => MasterBehavior = MasterBehavior.SplitOnLandscape) + }, + } + } + }; + + Detail = new ContentPage + { + Title = "Detail", + Content = new StackLayout + { + Children = + { + new Button + { + Text = "Set IsPresented to true", + Command = new Command(() => IsPresented = true) + } + } + } + }; + } + } +}
\ 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 72c310fc..4490cf07 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 @@ -172,6 +172,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla47923.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla48236.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla47971.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla51236.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla51238.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla51642.xaml.cs"> <DependentUpon>Bugzilla51642.xaml</DependentUpon> |