if (table != null)
{
_table = table;
- _globalCloser = new GlobalCloseContextGestureRecognizer(scrollView, _buttons, close);
+ _globalCloser = new GlobalCloseContextGestureRecognizer(scrollView, close);
_globalCloser.ShouldRecognizeSimultaneously = (recognizer, r) => r == _table.PanGestureRecognizer;
table.AddGestureRecognizer(_globalCloser);
{
internal class GlobalCloseContextGestureRecognizer : UIGestureRecognizer
{
- List<UIButton> _buttons;
UIScrollView _scrollView;
- public GlobalCloseContextGestureRecognizer(UIScrollView scrollView, List<UIButton> buttons, NSAction activated) : base(activated)
+ public GlobalCloseContextGestureRecognizer(UIScrollView scrollView, NSAction activated) : base(activated)
{
_scrollView = scrollView;
- _buttons = buttons;
ShouldReceiveTouch = OnShouldReceiveTouch;
}
if (disposing)
{
- _buttons = null;
_scrollView = null;
}
}
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
+
#if __UNIFIED__
using CoreGraphics;
using Foundation;
using ObjCRuntime;
using UIKit;
+using RectangleF = CoreGraphics.CGRect;
+using SizeF = CoreGraphics.CGSize;
+using PointF = CoreGraphics.CGPoint;
+
#else
using MonoTouch;
using MonoTouch.CoreAnimation;
using MonoTouch.CoreFoundation;
using MonoTouch.CoreGraphics;
using MonoTouch.UIKit;
-using System.Drawing;
-using MonoTouch.CoreAnimation;
using MonoTouch.Foundation;
using MonoTouch.ObjCRuntime;
-using MonoTouch.UIKit;
-#endif
-#if __UNIFIED__
-using RectangleF = CoreGraphics.CGRect;
-using SizeF = CoreGraphics.CGSize;
-using PointF = CoreGraphics.CGPoint;
-#else
-using nfloat=System.Single;
-using nint=System.Int32;
-using nuint=System.UInt32;
+using nfloat = System.Single;
+using nint = System.Int32;
+using nuint = System.UInt32;
#endif
namespace Xamarin.Forms.Platform.iOS
{
#region Static Fields
const int DefaultMinimumDimension = 44;
- static readonly UIColor DefaultBackgroundColor = UIColor.White;
#endregion
#region Fields
void Bind(object item, int position)
{
- //if (position != this.position)
- // controller.SendPositionDisappearing (this.position);
+ //if (position != this._position)
+ // controller.SendPositionDisappearing (this._position);
_position = position;
- OnBind?.Invoke(position);
+ OnBind?.Invoke(_position);
_controller.BindView(_view, item);
}
_view = controller.CreateView(itemType);
// bind view
- Bind(item, position);
+ Bind(item, _position);
// render view
_renderer = Platform.CreateRenderer(_view);
ContentView.AddSubview(uiView);
}
else
- Bind(item, position);
+ Bind(item, _position);
}
public Action<int> OnBind;
_size = size;
_attributes = attributes;
}
-
+#pragma warning disable 0414 // these are not called explicitly, but they are used to establish uniqueness. allow it!
string _family;
float _size;
FontAttributes _attributes;
+#pragma warning restore 0414
}
}
}
\ No newline at end of file
if (span == null)
return null;
-#pragma warning disable 618
+#pragma warning disable 0618 //retaining legacy call to obsolete code
var font = span.Font != Font.Default ? span.Font : defaultFont;
-#pragma warning restore 618
-
+#pragma warning restore 0618
var fgcolor = span.ForegroundColor;
if (fgcolor.IsDefault)
fgcolor = defaultForegroundColor;
set { _nameLabel.Text = value; }
}
- public Action Selected { get; set; }
+ public new Action Selected { get; set; }
public override void LayoutSubviews()
{
void HandlePropertyChanged(object sender, PropertyChangedEventArgs e)
{
-#pragma warning disable 618
+#pragma warning disable 0618 //retaining legacy call to obsolete code
if (e.PropertyName == NavigationPage.TintProperty.PropertyName)
-#pragma warning restore 618
+#pragma warning restore 0618
UpdateTint();
if (e.PropertyName == NavigationPage.BarBackgroundColorProperty.PropertyName)
UpdateBarBackgroundColor();
void UpdateTint()
{
-#pragma warning disable 618
+#pragma warning disable 0618 //retaining legacy call to obsolete code
var tintColor = ((NavigationPage)Element).Tint;
-#pragma warning restore 618
-
+#pragma warning restore 0618
if (Forms.IsiOS7OrNewer)
{
NavigationBar.BarTintColor = tintColor == Color.Default ? UINavigationBar.Appearance.BarTintColor : tintColor.ToUIColor();
get { return _innerDelegate == null ? null : _innerDelegate.PresentButton; }
}
- public void Dispose()
+ protected override void Dispose(bool disposing)
{
- if (_disposed)
- return;
-
- if (Element != null)
- {
- ((Page)Element).SendDisappearing();
- Element.PropertyChanged -= HandlePropertyChanged;
- Element = null;
- }
-
- if (_tracker != null)
- {
- _tracker.Dispose();
- _tracker = null;
- }
-
- if (_events != null)
- {
- _events.Dispose();
- _events = null;
- }
-
- if (_masterController != null)
- {
- _masterController.WillAppear -= MasterControllerWillAppear;
- _masterController.WillDisappear -= MasterControllerWillDisappear;
- }
-
- _disposed = true;
+ if (!_disposed && disposing)
+ {
+ if (Element != null)
+ {
+ ((Page)Element).SendDisappearing();
+ Element.PropertyChanged -= HandlePropertyChanged;
+ Element = null;
+ }
+
+ if (_tracker != null)
+ {
+ _tracker.Dispose();
+ _tracker = null;
+ }
+
+ if (_events != null)
+ {
+ _events.Dispose();
+ _events = null;
+ }
+
+ if (_masterController != null)
+ {
+ _masterController.WillAppear -= MasterControllerWillAppear;
+ _masterController.WillDisappear -= MasterControllerWillDisappear;
+ }
+
+ _disposed = true;
+ }
+ base.Dispose(disposing);
}
public VisualElement Element { get; private set; }
WebNavigationEvent _lastBackForwardEvent;
VisualElementPackager _packager;
- VisualElementTracker _tracker;
-
public WebViewRenderer() : base(RectangleF.Empty)
{
}
AutosizesSubviews = true;
AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
- _tracker = new VisualElementTracker(this);
-
_packager = new VisualElementPackager(this);
_packager.Load();
<MtouchDebug>true</MtouchDebug>
<CodesignKey>iPhone Developer</CodesignKey>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0169;0114;0108;0105;0414;0649</NoWarn>
+ <NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<CodesignKey>iPhone Developer</CodesignKey>
<DefineConstants>TRACE;__IOS__;__MOBILE__;</DefineConstants>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0169;0114;0108;0105;0414;0649</NoWarn>
+ <NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0169;0114;0108;0105;0414;0649</NoWarn>
+ <NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'AppStore|AnyCPU'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0169;0114;0108;0105;0414;0649</NoWarn>
+ <NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Xamarin.Forms.Core\Properties\GlobalAssemblyInfo.cs">
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0108;0114;0414;0649</NoWarn>
+ <NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0108;0114;0414;0649</NoWarn>
+ <NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0108;0114;0414;0649</NoWarn>
+ <NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'AppStore|AnyCPU'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0108;0114;0414;0649</NoWarn>
+ <NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />