4.0 ABI Fixes (#6133) fixes #6123
authorShane Neuville <shane94@hotmail.com>
Thu, 9 May 2019 16:17:59 +0000 (10:17 -0600)
committerRui Marinho <me@ruimarinho.net>
Thu, 9 May 2019 16:17:59 +0000 (09:17 -0700)
* fix background image type

* additional abi fixes

* updated 4915 to test nav icon

* uwp fixes

* Update Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml

22 files changed:
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1583.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue4138.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue4915.xaml.cs
Xamarin.Forms.Controls/GalleryPages/ImageSourcesGallery.cs
Xamarin.Forms.Controls/GalleryPages/NavigationBarGallery.cs
Xamarin.Forms.Controls/GalleryPages/TitleView.xaml.cs
Xamarin.Forms.Core/Button.cs
Xamarin.Forms.Core/NavigationPage.cs
Xamarin.Forms.Core/Page.cs
Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs
Xamarin.Forms.Platform.Android/AppCompat/TabbedPageRenderer.cs
Xamarin.Forms.Platform.Android/Platform.cs
Xamarin.Forms.Platform.MacOS/Renderers/TabbedPageRenderer.cs
Xamarin.Forms.Platform.UAP/FormsSlider.cs
Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
Xamarin.Forms.Platform.UAP/NavigationPageRenderer.cs
Xamarin.Forms.Platform.UAP/Platform.cs
Xamarin.Forms.Platform.UAP/SliderRenderer.cs
Xamarin.Forms.Platform.UAP/SliderStyle.xaml
Xamarin.Forms.Platform.UAP/TabbedPageStyle.xaml
Xamarin.Forms.Platform.iOS/Extensions/ColorExtensions.cs
Xamarin.Forms.Platform.iOS/Renderers/NavigationRenderer.cs

index 149bd31..3d23f8e 100644 (file)
@@ -19,7 +19,7 @@ namespace Xamarin.Forms.Controls.Issues
                        Title = "Test";
                        BackgroundColor = Color.Pink;
                        Content = new Label { Text = "Hello", AutomationId ="lblHello" };
-                       NavigationPage.SetTitleIcon(this, "bank.png");
+                       NavigationPage.SetTitleIconImageSource(this, "bank.png");
                }
 
 #if UITEST
index 38515bc..aeffed0 100644 (file)
@@ -26,7 +26,7 @@ namespace Xamarin.Forms.Controls.Issues
         {
             ContentPage contentPage = new ContentPage();
 
-            NavigationPage.SetTitleIcon(contentPage, "coffee.png");
+            NavigationPage.SetTitleIconImageSource(contentPage, "coffee.png");
 
             PushAsync(contentPage);
         }
index 4b5ba96..db1553c 100644 (file)
@@ -28,13 +28,19 @@ namespace Xamarin.Forms.Controls.Issues
                        navPage.BindingContext = new Issue4915ContentPage.ViewModel();
 
 
-                       var urlNavPage = new NavigationPage(new Issue4915ContentPage()) { Title = "nav page 1" };
+                       var urlNavPage = new NavigationPage(new Issue4915ContentPage()) { Title = "nav page 2" };
                        urlNavPage.SetBinding(Page.IconImageSourceProperty, "ImageUrl");
                        urlNavPage.BindingContext = new Issue4915ContentPage.ViewModel();
 
+                       var titleIconPage = new Issue4915ContentPage();
+                       var justSetOnNavPage = new NavigationPage(titleIconPage) { Title = "nav page 3" };
+#pragma warning disable CS0618 // Type or member is obsolete
+                       NavigationPage.SetTitleIcon(titleIconPage, "coffee.png");
+#pragma warning restore CS0618 // Type or member is obsolete
 
                        Children.Add(navPage);
                        Children.Add(urlNavPage);
+                       Children.Add(justSetOnNavPage);
                        Children.Add(new Issue4915ContentPage() { Title = "page 2" });
 
 
index dd010a9..9f404bc 100644 (file)
@@ -112,7 +112,7 @@ namespace Xamarin.Forms.Controls
                                                Spacing = 10,
                                                Children =
                                                {
-                                                       CreateImageSourcePicker("Change Title Icon", getter => NavigationPage.SetTitleIcon(this, getter())),
+                                                       CreateImageSourcePicker("Change Title Icon", getter => NavigationPage.SetTitleIconImageSource(this, getter())),
                                                        new Button
                                                        {
                                                                Text = "Page & Toolbar",
index d40e551..8115f07 100644 (file)
@@ -19,7 +19,7 @@ namespace Xamarin.Forms.Controls
 
                        ToolbarItems.Add(new ToolbarItem { Text = "Save" });
 
-                       NavigationPage.SetTitleIcon(this, "coffee.png");
+                       NavigationPage.SetTitleIconImageSource(this, "coffee.png");
 
                        SearchBar searchBar = new SearchBar { HeightRequest = 44, WidthRequest = 100 };
 
@@ -111,14 +111,14 @@ namespace Xamarin.Forms.Controls
                                                        Text = "Toggle TitleIcon",
                                                        Command = new Command (() => {
 
-                                                               var titleIcon = NavigationPage.GetTitleIcon(this);
+                                                               var titleIcon = NavigationPage.GetTitleIconImageSource(this);
 
                                                                if (titleIcon == null)
                                                                        titleIcon = "coffee.png";
                                                                else
                                                                        titleIcon = null;
 
-                                                               NavigationPage.SetTitleIcon(this, titleIcon);
+                                                               NavigationPage.SetTitleIconImageSource(this, titleIcon);
                                                        })
                                                },
                                                new Button {
index 1b6dec4..668da19 100644 (file)
@@ -185,12 +185,12 @@ namespace Xamarin.Forms.Controls.GalleryPages
 
                static void toggleTitleIcon(Page page)
                {
-                       var titleIcon = NavigationPage.GetTitleIcon(page);
+                       var titleIcon = NavigationPage.GetTitleIconImageSource(page);
 
                        if (titleIcon == null)
-                               NavigationPage.SetTitleIcon(page, "coffee.png");
+                               NavigationPage.SetTitleIconImageSource(page, "coffee.png");
                        else
-                               NavigationPage.SetTitleIcon(page, null);
+                               NavigationPage.SetTitleIconImageSource(page, null);
                }
 
                void masterDetailsPageIcon_Clicked(object sender, EventArgs e)
index 3151e98..abeb9ce 100644 (file)
@@ -136,7 +136,7 @@ namespace Xamarin.Forms
 
                [Obsolete("Image is obsolete as of 4.0.0. Please use ImageSource instead.")]
                [EditorBrowsable(EditorBrowsableState.Never)]
-               public ImageSource Image
+               public FileImageSource Image
                {
                        get { return GetValue(ImageProperty) as FileImageSource; }
                        set { SetValue(ImageProperty, value); }
index 2f7a040..28a68cc 100644 (file)
@@ -26,7 +26,11 @@ namespace Xamarin.Forms
 
                public static readonly BindableProperty BarTextColorProperty = BarElement.BarTextColorProperty;
 
-               public static readonly BindableProperty TitleIconProperty = BindableProperty.CreateAttached("TitleIcon", typeof(ImageSource), typeof(NavigationPage), default(ImageSource));
+               public static readonly BindableProperty TitleIconImageSourceProperty = BindableProperty.CreateAttached("TitleIconImageSource", typeof(ImageSource), typeof(NavigationPage), default(ImageSource));
+
+               [Obsolete("TitleIconProperty is obsolete as of 4.0.0. Please use TitleIconImageSourceProperty instead.")]
+               [EditorBrowsable(EditorBrowsableState.Never)]
+               public static readonly BindableProperty TitleIconProperty = TitleIconImageSourceProperty;
 
                public static readonly BindableProperty TitleViewProperty = BindableProperty.CreateAttached("TitleView", typeof(View), typeof(NavigationPage), null, propertyChanging: TitleViewPropertyChanging);
 
@@ -138,9 +142,16 @@ namespace Xamarin.Forms
                        return (bool)page.GetValue(HasNavigationBarProperty);
                }
 
-               public static ImageSource GetTitleIcon(BindableObject bindable)
+               [Obsolete("GetTitleIcon is obsolete as of 4.0.0. Please use GetTitleIconImageSource instead.")]
+               [EditorBrowsable(EditorBrowsableState.Never)]
+               public static FileImageSource GetTitleIcon(BindableObject bindable)
+               {
+                       return bindable.GetValue(TitleIconImageSourceProperty) as FileImageSource;
+               }
+
+               public static ImageSource GetTitleIconImageSource(BindableObject bindable)
                {
-                       return (ImageSource)bindable.GetValue(TitleIconProperty);
+                       return (ImageSource)bindable.GetValue(TitleIconImageSourceProperty);
                }
 
                public static View GetTitleView(BindableObject bindable)
@@ -250,9 +261,16 @@ namespace Xamarin.Forms
                        page.SetValue(HasNavigationBarProperty, value);
                }
 
-               public static void SetTitleIcon(BindableObject bindable, ImageSource value)
+               [Obsolete("SetTitleIcon is obsolete as of 4.0.0. Please use SetTitleIconImageSource instead.")]
+               [EditorBrowsable(EditorBrowsableState.Never)]
+               public static void SetTitleIcon(BindableObject bindable, FileImageSource value)
+               {
+                       bindable.SetValue(TitleIconImageSourceProperty, value);
+               }
+
+               public static void SetTitleIconImageSource(BindableObject bindable, ImageSource value)
                {
-                       bindable.SetValue(TitleIconProperty, value);
+                       bindable.SetValue(TitleIconImageSourceProperty, value);
                }
 
                public static void SetTitleView(BindableObject bindable, View value)
index 5e0b282..4873495 100644 (file)
@@ -64,7 +64,7 @@ namespace Xamarin.Forms
 
                [Obsolete("BackgroundImage is obsolete as of 4.0.0. Please use BackgroundImageSource instead.")]
                [EditorBrowsable(EditorBrowsableState.Never)]
-               public FileImageSource BackgroundImage
+               public string BackgroundImage
                {
                        get { return GetValue(BackgroundImageProperty) as FileImageSource; }
                        set { SetValue(BackgroundImageProperty, value); }
index 2aa4356..1f0afa3 100644 (file)
@@ -529,7 +529,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
                                UpdateToolbar();
                        else if (e.PropertyName == NavigationPage.HasBackButtonProperty.PropertyName)
                                UpdateToolbar();
-                       else if (e.PropertyName == NavigationPage.TitleIconProperty.PropertyName ||
+                       else if (e.PropertyName == NavigationPage.TitleIconImageSourceProperty.PropertyName ||
                                         e.PropertyName == NavigationPage.TitleViewProperty.PropertyName)
                                UpdateToolbar();
                }
@@ -1011,7 +1011,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
                void UpdateTitleIcon()
                {
                        Page currentPage = Element.CurrentPage;
-                       ImageSource source = NavigationPage.GetTitleIcon(currentPage);
+                       ImageSource source = NavigationPage.GetTitleIconImageSource(currentPage);
 
                        if (source == null || source.IsEmpty)
                        {
@@ -1032,7 +1032,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
                        {
                                _imageSource = source;
                                _titleIconView.SetImageResource(global::Android.Resource.Color.Transparent);
-                               _ = this.ApplyDrawableAsync(currentPage, NavigationPage.TitleIconProperty, Context, drawable =>
+                               _ = this.ApplyDrawableAsync(currentPage, NavigationPage.TitleIconImageSourceProperty, Context, drawable =>
                                {
                                        _titleIconView.SetImageDrawable(drawable);
                                });
index cbfaf01..c2a3610 100644 (file)
@@ -18,6 +18,7 @@ using ADrawableCompat = Android.Support.V4.Graphics.Drawable.DrawableCompat;
 using AView = Android.Views.View;
 using AMenu = Android.Views.Menu;
 using AColor = Android.Graphics.Color;
+using System.Threading.Tasks;
 
 namespace Xamarin.Forms.Platform.Android.AppCompat
 {
@@ -535,10 +536,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
                                else
                                {
                                        TabLayout.Tab tab = _tabLayout.GetTabAt(index);
-                                       _ = this.ApplyDrawableAsync(page, Page.IconImageSourceProperty, Context, icon =>
-                                       {
-                                               SetTabIcon(tab, icon);
-                                       });
+                                       SetTabIconImageSource(page, tab);
                                }
                        }
                }
@@ -681,19 +679,42 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
                        {
                                Page child = Element.Children[i];
                                TabLayout.Tab tab = tabs.GetTabAt(i);
-                               _ = this.ApplyDrawableAsync(child, Page.IconImageSourceProperty, Context, icon =>
-                               {
-                                       SetTabIcon(tab, icon);
-                               });
+                               SetTabIconImageSource(child, tab);
                        }
                }
 
-               void SetTabIcon(TabLayout.Tab tab, Drawable icon)
+               [Obsolete("GetIconDrawable is obsolete as of 4.0.0. Please override SetTabIconImageSource instead.")]
+               [EditorBrowsable(EditorBrowsableState.Never)]
+               protected virtual Drawable GetIconDrawable(FileImageSource icon) =>
+                       Context.GetDrawable(icon as FileImageSource);
+
+
+               [Obsolete("SetTabIcon is obsolete as of 4.0.0. Please use SetTabIconImageSource instead.")]
+               [EditorBrowsable(EditorBrowsableState.Never)]
+               protected virtual void SetTabIcon(TabLayout.Tab tab, FileImageSource icon)
+               {
+               }
+
+
+               protected virtual void SetTabIconImageSource(TabLayout.Tab tab, Drawable icon)
                {
                        tab.SetIcon(icon);
                        SetIconColorFilter(tab);
                }
 
+               void SetTabIconImageSource(Page page, TabLayout.Tab tab)
+               {
+                       _ = this.ApplyDrawableAsync(page, Page.IconImageSourceProperty, Context, icon =>
+                       {
+                               SetTabIconImageSource(tab, icon);
+
+#pragma warning disable CS0618 // Type or member is obsolete
+                               SetTabIcon(tab, page.Icon as FileImageSource);
+#pragma warning restore CS0618 // Type or member is obsolete
+
+                       });
+               }
+
                void UpdateBarBackgroundColor()
                {
                        if (IsDisposed)
index 020ad63..f58eb5a 100644 (file)
@@ -1077,12 +1077,12 @@ namespace Xamarin.Forms.Platform.Android
                        if (ShouldShowActionBarTitleArea())
                        {
                                actionBar.Title = view.Title;
-                               _ = _context.ApplyDrawableAsync(view, NavigationPage.TitleIconProperty, icon =>
+                               _ = _context.ApplyDrawableAsync(view, NavigationPage.TitleIconImageSourceProperty, icon =>
                                {
                                        if (icon != null)
                                                actionBar.SetLogo(icon);
                                });
-                               var titleIcon = NavigationPage.GetTitleIcon(view);
+                               var titleIcon = NavigationPage.GetTitleIconImageSource(view);
                                useLogo = titleIcon != null && titleIcon.IsEmpty;
                                showHome = true;
                                showTitle = true;
index 95d1973..f8d6d63 100644 (file)
@@ -204,7 +204,7 @@ namespace Xamarin.Forms.Platform.MacOS
                        {
                                if (icon != null)
                                {
-                                       var image = GetTabViewItemIcon(icon);
+                                       var image = GetTabViewItemIconImageSource(icon);
                                        if (image != null)
                                                tvi.Image = image;
                                }
@@ -212,7 +212,9 @@ namespace Xamarin.Forms.Platform.MacOS
                        return tvi;
                }
 
-               protected virtual NSImage GetTabViewItemIcon(NSImage image)
+               protected virtual NSImage GetTabViewItemIcon(string imageName) => GetTabViewItemIconImageSource(NSImage.ImageNamed(imageName));
+
+               protected virtual NSImage GetTabViewItemIconImageSource(NSImage image)
                {
                        if (image == null)
                                return null;
index a8b6dc6..c7d2239 100644 (file)
@@ -1,4 +1,5 @@
 using System;
+using System.ComponentModel;
 using Windows.UI.Xaml;
 using Windows.UI.Xaml.Controls.Primitives;
 using Windows.UI.Xaml.Media.Imaging;
@@ -10,11 +11,15 @@ namespace Xamarin.Forms.Platform.UWP
        {
                internal Thumb Thumb { get; set; }
                internal Thumb ImageThumb { get; set; }
-
-               public static readonly DependencyProperty ThumbImageProperty = 
-                       DependencyProperty.Register(nameof(ThumbImage), typeof(WImageSource), 
+                          
+               public static readonly DependencyProperty ThumbImageSourceProperty = 
+                       DependencyProperty.Register(nameof(ThumbImageSource), typeof(WImageSource), 
                        typeof(FormsSlider), new PropertyMetadata(null, PropertyChangedCallback));
 
+               [Obsolete("ThumbImageProperty is obsolete as of 4.0.0. Please use ThumbImageSourceProperty instead.")]
+               [EditorBrowsable(EditorBrowsableState.Never)]
+               public static readonly DependencyProperty ThumbImageProperty = ThumbImageSourceProperty;
+
                static void PropertyChangedCallback(DependencyObject dependencyObject,
                        DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
                {
@@ -29,7 +34,7 @@ namespace Xamarin.Forms.Platform.UWP
                                return;
                        }
 
-                       if (slider.ThumbImage != null)
+                       if (slider.ThumbImageSource != null)
                        {
                                slider.Thumb.Visibility = Visibility.Collapsed;
                                slider.ImageThumb.Visibility = Visibility.Visible;
@@ -41,10 +46,18 @@ namespace Xamarin.Forms.Platform.UWP
                        }
                }
 
-               public WImageSource ThumbImage
+               public WImageSource ThumbImageSource
+               {
+                       get { return (WImageSource)GetValue(ThumbImageSourceProperty); }
+                       set { SetValue(ThumbImageSourceProperty, value); }
+               }
+
+               [Obsolete("ThumbImage is obsolete as of 4.0.0. Please use ThumbImageSource instead.")]
+               [EditorBrowsable(EditorBrowsableState.Never)]
+               public BitmapImage ThumbImage
                {
-                       get { return (WImageSource)GetValue(ThumbImageProperty); }
-                       set { SetValue(ThumbImageProperty, value); }
+                       get { return GetValue(ThumbImageSourceProperty) as BitmapImage; }
+                       set { SetValue(ThumbImageSourceProperty, value); }
                }
 
                internal event EventHandler Ready;
index 40080bf..84f72ca 100644 (file)
@@ -269,7 +269,7 @@ namespace Xamarin.Forms.Platform.UWP
                {
                        if (e.PropertyName == Page.TitleProperty.PropertyName)
                                UpdateDetailTitle();
-                       else if (e.PropertyName == NavigationPage.TitleIconProperty.PropertyName)
+                       else if (e.PropertyName == NavigationPage.TitleIconImageSourceProperty.PropertyName)
                                UpdateDetailTitleIcon();
                        else if (e.PropertyName == NavigationPage.TitleViewProperty.PropertyName)
                                UpdateDetailTitleView();
@@ -343,7 +343,7 @@ namespace Xamarin.Forms.Platform.UWP
                        if (_detail == null)
                                return;
 
-                       Control.DetailTitleIcon = await NavigationPage.GetTitleIcon(GetCurrentPage()).ToWindowsImageSourceAsync();
+                       Control.DetailTitleIcon = await NavigationPage.GetTitleIconImageSource(GetCurrentPage()).ToWindowsImageSourceAsync();
                        Control.InvalidateMeasure();
                }
 
index 83643eb..3bf9dd0 100644 (file)
@@ -344,7 +344,7 @@ namespace Xamarin.Forms.Platform.UWP
                                UpdateTitleVisible();
                        else if (e.PropertyName == Page.TitleProperty.PropertyName)
                                UpdateTitleOnParents();
-                       else if (e.PropertyName == NavigationPage.TitleIconProperty.PropertyName)
+                       else if (e.PropertyName == NavigationPage.TitleIconImageSourceProperty.PropertyName)
                                UpdateTitleIcon();
                        else if (e.PropertyName == NavigationPage.TitleViewProperty.PropertyName)
                                UpdateTitleView();
@@ -368,7 +368,7 @@ namespace Xamarin.Forms.Platform.UWP
                                UpdateToolbarPlacement();
                        else if (e.PropertyName == ToolbarDynamicOverflowEnabledProperty.PropertyName)
                                UpdateToolbarDynamicOverflowEnabled();
-                       else if (e.PropertyName == NavigationPage.TitleIconProperty.PropertyName)
+                       else if (e.PropertyName == NavigationPage.TitleIconImageSourceProperty.PropertyName)
                                UpdateTitleIcon();
                        else if (e.PropertyName == NavigationPage.TitleViewProperty.PropertyName)
                                UpdateTitleView();
@@ -539,7 +539,7 @@ namespace Xamarin.Forms.Platform.UWP
                        if (_currentPage == null)
                                return;
 
-                       ImageSource source = NavigationPage.GetTitleIcon(_currentPage);
+                       ImageSource source = NavigationPage.GetTitleIconImageSource(_currentPage);
 
                        _titleIcon = await source.ToWindowsImageSourceAsync();
 
index 2f024b4..657e438 100644 (file)
@@ -410,7 +410,7 @@ namespace Xamarin.Forms.Platform.UWP
 
                                var button = new AppBarButton();
                                button.SetBinding(AppBarButton.LabelProperty, "Text");
-                               button.SetBinding(AppBarButton.IconProperty, "Icon", _imageSourceIconElementConverter);
+                               button.SetBinding(AppBarButton.IconProperty, "IconImageSource", _imageSourceIconElementConverter);
                                button.Command = new MenuItemCommand(item);
                                button.DataContext = item;
                                button.SetValue(NativeAutomationProperties.AutomationIdProperty, item.AutomationId);
index d6f0fc3..4d7efe8 100644 (file)
@@ -176,11 +176,11 @@ namespace Xamarin.Forms.Platform.UWP
 
                        if (thumbImage == null)
                        {
-                               Control.ThumbImage = null;
+                               Control.ThumbImageSource = null;
                                return;
                        }
 
-                       Control.ThumbImage = await thumbImage.ToWindowsImageSourceAsync();
+                       Control.ThumbImageSource = await thumbImage.ToWindowsImageSourceAsync();
                }
 
                protected override void UpdateBackgroundColor()
index b156b4f..51ff12f 100644 (file)
                                                                                Background="{ThemeResource SystemControlForegroundAccentBrush}"
                                                                                Style="{StaticResource SliderThumbImageStyle}"
                                                                                DataContext="{TemplateBinding Value}"
-                                                                               Tag="{Binding ThumbImage, RelativeSource={RelativeSource TemplatedParent}}"
+                                                                               Tag="{Binding ThumbImageSource, RelativeSource={RelativeSource TemplatedParent}}"
                                                                                Height="24"
                                                                                Width="24"
                                                                                Grid.Row="0"
index 3f64464..ca00b5d 100644 (file)
@@ -7,7 +7,7 @@
                        <Setter.Value>
                                <DataTemplate>
                                        <StackPanel Orientation="Vertical" Name="TabbedPageHeaderStackPanel">
-                                               <Image Name="TabbedPageHeaderImage" DataContext="{Binding Icon, Converter={StaticResource ImageConverter}}" Source="{Binding Value}" Width="16" Height="16" Visibility="Collapsed" Margin="0,12,0,0"/>
+                                               <Image Name="TabbedPageHeaderImage" DataContext="{Binding IconImageSource, Converter={StaticResource ImageConverter}}" Source="{Binding Value}" Width="16" Height="16" Visibility="Collapsed" Margin="0,12,0,0"/>
                                                <TextBlock Name="TabbedPageHeaderTextBlock" Text="{Binding Title}" Style="{ThemeResource BodyTextBlockStyle}"/>
                                        </StackPanel>
                                </DataTemplate>
                        </Setter.Value>
                </Setter>
        </Style>
-</ResourceDictionary>
\ No newline at end of file
+</ResourceDictionary>
index 6dc9e3b..9238607 100644 (file)
@@ -32,6 +32,17 @@ namespace Xamarin.Forms.Platform.MacOS
 #endif
                }
 
+#if __MOBILE__
+               public static UIColor FromPatternImageFromBundle(string bgImage)
+               {
+                       var image = UIImage.FromBundle(bgImage);
+                       if (image == null)
+                               return UIColor.White;
+
+                       return UIColor.FromPatternImage(image);
+               }
+#endif
+
                public static Color ToColor(this UIColor color)
                {
                        nfloat red;
index 3436edc..50ef319 100644 (file)
@@ -1037,7 +1037,7 @@ namespace Xamarin.Forms.Platform.iOS
                                        UpdatePrefersStatusBarHidden();
                                else if (e.PropertyName == LargeTitleDisplayProperty.PropertyName)
                                        UpdateLargeTitles();
-                               else if (e.PropertyName == NavigationPage.TitleIconProperty.PropertyName ||
+                               else if (e.PropertyName == NavigationPage.TitleIconImageSourceProperty.PropertyName ||
                                         e.PropertyName == NavigationPage.TitleViewProperty.PropertyName)
                                        UpdateTitleArea(Child);
                        }
@@ -1066,7 +1066,7 @@ namespace Xamarin.Forms.Platform.iOS
                        }
 
 
-                       public bool NeedsTitleViewContainer(Page page) => NavigationPage.GetTitleIcon(page) != null || NavigationPage.GetTitleView(page) != null;
+                       public bool NeedsTitleViewContainer(Page page) => NavigationPage.GetTitleIconImageSource(page) != null || NavigationPage.GetTitleView(page) != null;
 
                        internal void UpdateBackButtonTitle(Page page) => UpdateBackButtonTitle(page.Title, NavigationPage.GetBackButtonTitle(page));
 
@@ -1087,7 +1087,7 @@ namespace Xamarin.Forms.Platform.iOS
                                if (page == null)
                                        return;
 
-                               ImageSource titleIcon = NavigationPage.GetTitleIcon(page);
+                               ImageSource titleIcon = NavigationPage.GetTitleIconImageSource(page);
                                View titleView = NavigationPage.GetTitleView(page);
                                bool needContainer = titleView != null || titleIcon != null;