[iOS] Additional Preserve Attributes (#8721)
authorShane Neuville <shneuvil@microsoft.com>
Sun, 1 Dec 2019 18:37:40 +0000 (11:37 -0700)
committerGitHub <noreply@github.com>
Sun, 1 Dec 2019 18:37:40 +0000 (11:37 -0700)
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
Xamarin.Forms.Platform.iOS/Cells/CellRenderer.cs
Xamarin.Forms.Platform.iOS/Cells/EntryCellRenderer.cs
Xamarin.Forms.Platform.iOS/Cells/ImageCellRenderer.cs
Xamarin.Forms.Platform.iOS/Cells/SwitchCellRenderer.cs
Xamarin.Forms.Platform.iOS/Cells/TextCellRenderer.cs
Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs
Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs
Xamarin.Forms.Platform.iOS/ResourcesProvider.cs

index fcbe8e2..c229914 100644 (file)
   <ItemGroup>
     <EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue6693.xaml">
       <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
+      <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
     </EmbeddedResource>
   </ItemGroup>
 </Project>
index c83f624..0752bfc 100644 (file)
@@ -14,6 +14,11 @@ namespace Xamarin.Forms.Platform.iOS
                PropertyChangedEventHandler _onPropertyChangedEventHandler;
                readonly UIColor _defaultCellBgColor = Forms.IsiOS13OrNewer ? UIColor.Clear : UIColor.White;
 
+               [Preserve(Conditional = true)]
+               public CellRenderer()
+               {
+               }
+
                public virtual UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
                {
                        Performance.Start(out string reference);
index 870a9a5..270c615 100644 (file)
@@ -1,5 +1,6 @@
 using System;
 using System.ComponentModel;
+using Foundation;
 using UIKit;
 using RectangleF = CoreGraphics.CGRect;
 
@@ -9,6 +10,11 @@ namespace Xamarin.Forms.Platform.iOS
        {
                static readonly Color DefaultTextColor = Color.Black;
 
+               [Preserve(Conditional = true)]
+               public EntryCellRenderer()
+               {
+               }
+
                public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
                {
                        var entryCell = (EntryCell)item;
index c3f7de4..0c4ba37 100644 (file)
@@ -7,6 +7,11 @@ namespace Xamarin.Forms.Platform.iOS
 {
        public class ImageCellRenderer : TextCellRenderer
        {
+               [Preserve(Conditional = true)]
+               public ImageCellRenderer()
+               {
+               }
+
                public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
                {
                        var result = (CellTableViewCell)base.GetCell(item, reusableCell, tv);
index 0cbaa12..3d485dc 100644 (file)
@@ -1,6 +1,7 @@
 using System;
 using System.ComponentModel;
 using System.Drawing;
+using Foundation;
 using UIKit;
 
 namespace Xamarin.Forms.Platform.iOS
@@ -11,6 +12,11 @@ namespace Xamarin.Forms.Platform.iOS
 
                UIColor _defaultOnColor;
 
+               [Preserve(Conditional = true)]
+               public SwitchCellRenderer()
+               {
+               }
+
                public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
                {
                        var tvc = reusableCell as CellTableViewCell;
index e635db9..897012a 100644 (file)
@@ -1,4 +1,5 @@
 using System.ComponentModel;
+using Foundation;
 using UIKit;
 
 namespace Xamarin.Forms.Platform.iOS
@@ -8,6 +9,11 @@ namespace Xamarin.Forms.Platform.iOS
                static readonly Color DefaultDetailColor = new Color(.32, .4, .57);
                static readonly Color DefaultTextColor = Color.Black;
 
+               [Preserve(Conditional = true)]
+               public TextCellRenderer()
+               {
+               }
+
                public override UITableViewCell GetCell(Cell item, UITableViewCell reusableCell, UITableView tv)
                {
                        var textCell = (TextCell)item;
index 0a99b2e..3658ee9 100644 (file)
@@ -9,6 +9,7 @@ namespace Xamarin.Forms.Platform.iOS
 {
        public class ViewCellRenderer : CellRenderer
        {
+               [Preserve(Conditional = true)]
                public ViewCellRenderer()
                {
                }
index 6744282..87ad692 100644 (file)
@@ -130,6 +130,11 @@ namespace Xamarin.Forms.Platform.iOS
 
        public sealed class FileImageSourceHandler : IImageSourceHandler, IAnimationSourceHandler
        {
+               [Preserve(Conditional = true)]
+               public FileImageSourceHandler()
+               {
+               }
+
                public Task<UIImage> LoadImageAsync(ImageSource imagesource, CancellationToken cancelationToken = default(CancellationToken), float scale = 1f)
                {
                        UIImage image = null;
@@ -160,6 +165,11 @@ namespace Xamarin.Forms.Platform.iOS
 
        public sealed class StreamImagesourceHandler : IImageSourceHandler, IAnimationSourceHandler
        {
+               [Preserve(Conditional = true)]
+               public StreamImagesourceHandler()
+               {
+               }
+
                public async Task<UIImage> LoadImageAsync(ImageSource imagesource, CancellationToken cancelationToken = default(CancellationToken), float scale = 1f)
                {
                        UIImage image = null;
@@ -195,6 +205,11 @@ namespace Xamarin.Forms.Platform.iOS
 
        public sealed class ImageLoaderSourceHandler : IImageSourceHandler, IAnimationSourceHandler
        {
+               [Preserve(Conditional = true)]
+               public ImageLoaderSourceHandler()
+               {
+               }
+
                public async Task<UIImage> LoadImageAsync(ImageSource imagesource, CancellationToken cancelationToken = default(CancellationToken), float scale = 1f)
                {
                        UIImage image = null;
@@ -233,6 +248,11 @@ namespace Xamarin.Forms.Platform.iOS
                //should this be the default color on the BP for iOS? 
                readonly Color _defaultColor = Color.White;
 
+               [Preserve(Conditional = true)]
+               public FontImageSourceHandler()
+               {
+               }
+
                public Task<UIImage> LoadImageAsync(
                        ImageSource imagesource,
                        CancellationToken cancelationToken = default(CancellationToken),
index 0bccc60..ce9e336 100644 (file)
@@ -10,6 +10,7 @@ using Xamarin.Forms.Internals;
 namespace Xamarin.Forms.Platform.MacOS
 #endif
 {
+       [Preserve(AllMembers = true)]
        internal class ResourcesProvider : ISystemResourcesProvider
        {
                ResourceDictionary _dictionary;