diff options
author | Paul DiPietro <pauldipietro@users.noreply.github.com> | 2017-02-17 04:42:33 -0600 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2017-02-17 10:42:33 +0000 |
commit | de3fdf57c7ee0af98e5d958a1a62595636b885f0 (patch) | |
tree | 93083e73ef169184ff0151d568c9459c31ec3608 /Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared | |
parent | f449b31918fbc2d3525cd151ff36c27b175887a0 (diff) | |
download | xamarin-forms-de3fdf57c7ee0af98e5d958a1a62595636b885f0.tar.gz xamarin-forms-de3fdf57c7ee0af98e5d958a1a62595636b885f0.tar.bz2 xamarin-forms-de3fdf57c7ee0af98e5d958a1a62595636b885f0.zip |
[WinRT/UWP] Insert missing SendScrollFinished call (#751)
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared')
2 files changed, 95 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44940.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44940.cs new file mode 100644 index 00000000..57c686b7 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44940.cs @@ -0,0 +1,94 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; +using System.Threading.Tasks; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +#endif + +// Apply the default category of "Issues" to all of the tests in this assembly +// We use this as a catch-all for tests which haven't been individually categorized +#if UITEST +[assembly: NUnit.Framework.Category("Issues")] +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 44940, "[WinRT/UWP] ScrollView.ScrollToAsync does not return from await", PlatformAffected.WinRT)] + public class Bugzilla44940 : TestContentPage + { + Label _statusLabel; + Entry _firstEntry; + Entry _secondEntry; + StackLayout _verticalStackLayout; + ScrollView _scrollView; + + protected override void Init() + { + _statusLabel = new Label + { + Text = "With focus on first Entry, hit Return key", + HorizontalOptions = LayoutOptions.CenterAndExpand, + LineBreakMode = LineBreakMode.WordWrap + }; + + _firstEntry = new Entry + { + HorizontalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.CenterAndExpand, + }; + + _secondEntry = new Entry + { + HorizontalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.CenterAndExpand, + }; + + _firstEntry.Completed += FirstEntryCompleted; + + _verticalStackLayout = new StackLayout + { + HorizontalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.FillAndExpand, + Padding = new Thickness(0, 0, 0, 0), + Margin = new Thickness(0, 0, 0, 0), + Spacing = 5, + Children = + { + _statusLabel, + _firstEntry, + _secondEntry + } + }; + + _scrollView = new ScrollView + { + Orientation = ScrollOrientation.Vertical, + HorizontalOptions = LayoutOptions.CenterAndExpand, + VerticalOptions = LayoutOptions.FillAndExpand, + Margin = new Thickness(10, 5, 10, 0), + Padding = new Thickness(0, 0, 0, 0), + Content = _verticalStackLayout + }; + + Content = _scrollView; + + Device.BeginInvokeOnMainThread(async () => + { + await Task.Delay(100); + _firstEntry.Focus(); + }); + } + + async void FirstEntryCompleted(object sender, System.EventArgs e) + { + _firstEntry?.Unfocus(); + _statusLabel.Text = "Attempting scroll. Return from await pending..."; + await _scrollView.ScrollToAsync(_secondEntry, ScrollToPosition.MakeVisible, false); + _statusLabel.Text = "This should be visible on WinRT/UWP"; + _secondEntry?.Focus(); + } + } +}
\ 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 f6100c66..8aa72175 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 @@ -152,6 +152,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43735.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla43783.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44453.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44940.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44944.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44166.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla44461.cs" /> |