--- /dev/null
+using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+using Xamarin.Forms.PlatformConfiguration;
+using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
+
+#if UITEST
+using Xamarin.UITest;
+using NUnit.Framework;
+#endif
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Bugzilla, 41778, "Slider Inside ScrollView Will Open MasterDetailPage.Master", PlatformAffected.iOS)]
+ public class Bugzilla41778 : TestMasterDetailPage // or TestMasterDetailPage, etc ...
+ {
+ protected override void Init()
+ {
+ Master = new ContentPage
+ {
+ Title = "Menu",
+ BackgroundColor = Color.Blue
+ };
+
+ Detail = new DetailPageCS();
+ }
+ }
+
+ public class DetailPageCS : ContentPage
+ {
+ public DetailPageCS()
+ {
+ var scrollView = new ScrollView { Content = new Slider() };
+ scrollView.On<iOS>().SetShouldDelayContentTouches(false);
+
+ Content = scrollView;
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
+{
+ using FormsElement = Forms.ScrollView;
+
+ public static class ScrollView
+ {
+ public static readonly BindableProperty ShouldDelayContentTouchesProperty = BindableProperty.Create(nameof(ShouldDelayContentTouches), typeof(bool), typeof(ScrollView), true);
+
+ public static bool GetShouldDelayContentTouches(BindableObject element)
+ {
+ return (bool)element.GetValue(ShouldDelayContentTouchesProperty);
+ }
+
+ public static void SetShouldDelayContentTouches(BindableObject element, bool value)
+ {
+ element.SetValue(ShouldDelayContentTouchesProperty, value);
+ }
+
+ public static bool ShouldDelayContentTouches(this IPlatformElementConfiguration<iOS, FormsElement> config)
+ {
+ return GetShouldDelayContentTouches(config.Element);
+ }
+
+ public static IPlatformElementConfiguration<iOS, FormsElement> SetShouldDelayContentTouches(this IPlatformElementConfiguration<iOS, FormsElement> config, bool value)
+ {
+ SetShouldDelayContentTouches(config.Element, value);
+ return config;
+ }
+ }
+}
\ No newline at end of file
using System.ComponentModel;
using Xamarin.Forms.Internals;
using UIKit;
+using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
using PointF = CoreGraphics.CGPoint;
using RectangleF = CoreGraphics.CGRect;
((IScrollViewController)element).ScrollToRequested += OnScrollToRequested;
if (_packager == null)
{
- DelaysContentTouches = true;
-
_packager = new VisualElementPackager(this);
_packager.Load();
});
}
+ UpdateDelaysContentTouches();
UpdateContentSize();
UpdateBackgroundColor();
void HandlePropertyChanged(object sender, PropertyChangedEventArgs e)
{
- if (e.PropertyName == ScrollView.ContentSizeProperty.PropertyName)
+ if (e.PropertyName == PlatformConfiguration.iOSSpecific.ScrollView.ShouldDelayContentTouchesProperty.PropertyName)
+ UpdateDelaysContentTouches();
+ else if (e.PropertyName == ScrollView.ContentSizeProperty.PropertyName)
UpdateContentSize();
else if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName)
UpdateBackgroundColor();
Controller.SendScrollFinished();
}
+ void UpdateDelaysContentTouches()
+ {
+ DelaysContentTouches = ((ScrollView)Element).OnThisPlatform().ShouldDelayContentTouches();
+ }
+
void UpdateBackgroundColor()
{
BackgroundColor = Element.BackgroundColor.ToUIColor(Color.Transparent);
--- /dev/null
+<Type Name="ScrollView" FullName="Xamarin.Forms.PlatformConfiguration.iOSSpecific.ScrollView">
+ <TypeSignature Language="C#" Value="public static class ScrollView" />
+ <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit ScrollView extends System.Object" />
+ <AssemblyInfo>
+ <AssemblyName>Xamarin.Forms.Core</AssemblyName>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <Base>
+ <BaseTypeName>System.Object</BaseTypeName>
+ </Base>
+ <Interfaces />
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ <Members>
+ <Member MemberName="GetShouldDelayContentTouches">
+ <MemberSignature Language="C#" Value="public static bool GetShouldDelayContentTouches (Xamarin.Forms.BindableObject element);" />
+ <MemberSignature Language="ILAsm" Value=".method public static hidebysig bool GetShouldDelayContentTouches(class Xamarin.Forms.BindableObject element) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Boolean</ReturnType>
+ </ReturnValue>
+ <Parameters>
+ <Parameter Name="element" Type="Xamarin.Forms.BindableObject" />
+ </Parameters>
+ <Docs>
+ <param name="element">To be added.</param>
+ <summary>To be added.</summary>
+ <returns>To be added.</returns>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="ShouldDelayContentTouches">
+ <MemberSignature Language="C#" Value="public static bool ShouldDelayContentTouches (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.ScrollView> config);" />
+ <MemberSignature Language="ILAsm" Value=".method public static hidebysig bool ShouldDelayContentTouches(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.iOS, class Xamarin.Forms.ScrollView> config) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Boolean</ReturnType>
+ </ReturnValue>
+ <Parameters>
+ <Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.ScrollView>" RefType="this" />
+ </Parameters>
+ <Docs>
+ <param name="config">To be added.</param>
+ <summary>To be added.</summary>
+ <returns>To be added.</returns>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="ShouldDelayContentTouchesProperty">
+ <MemberSignature Language="C#" Value="public static readonly Xamarin.Forms.BindableProperty ShouldDelayContentTouchesProperty;" />
+ <MemberSignature Language="ILAsm" Value=".field public static initonly class Xamarin.Forms.BindableProperty ShouldDelayContentTouchesProperty" />
+ <MemberType>Field</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>Xamarin.Forms.BindableProperty</ReturnType>
+ </ReturnValue>
+ <Docs>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="SetShouldDelayContentTouches">
+ <MemberSignature Language="C#" Value="public static void SetShouldDelayContentTouches (Xamarin.Forms.BindableObject element, bool value);" />
+ <MemberSignature Language="ILAsm" Value=".method public static hidebysig void SetShouldDelayContentTouches(class Xamarin.Forms.BindableObject element, bool value) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>System.Void</ReturnType>
+ </ReturnValue>
+ <Parameters>
+ <Parameter Name="element" Type="Xamarin.Forms.BindableObject" />
+ <Parameter Name="value" Type="System.Boolean" />
+ </Parameters>
+ <Docs>
+ <param name="element">To be added.</param>
+ <param name="value">To be added.</param>
+ <summary>To be added.</summary>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ <Member MemberName="SetShouldDelayContentTouches">
+ <MemberSignature Language="C#" Value="public static Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.ScrollView> SetShouldDelayContentTouches (this Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.ScrollView> config, bool value);" />
+ <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.iOS, class Xamarin.Forms.ScrollView> SetShouldDelayContentTouches(class Xamarin.Forms.IPlatformElementConfiguration`2<class Xamarin.Forms.PlatformConfiguration.iOS, class Xamarin.Forms.ScrollView> config, bool value) cil managed" />
+ <MemberType>Method</MemberType>
+ <AssemblyInfo>
+ <AssemblyVersion>2.0.0.0</AssemblyVersion>
+ </AssemblyInfo>
+ <ReturnValue>
+ <ReturnType>Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.ScrollView></ReturnType>
+ </ReturnValue>
+ <Parameters>
+ <Parameter Name="config" Type="Xamarin.Forms.IPlatformElementConfiguration<Xamarin.Forms.PlatformConfiguration.iOS,Xamarin.Forms.ScrollView>" RefType="this" />
+ <Parameter Name="value" Type="System.Boolean" />
+ </Parameters>
+ <Docs>
+ <param name="config">To be added.</param>
+ <param name="value">To be added.</param>
+ <summary>To be added.</summary>
+ <returns>To be added.</returns>
+ <remarks>To be added.</remarks>
+ </Docs>
+ </Member>
+ </Members>
+</Type>