Bug 37238 - XAML CustomRenderer Portable library
Summary: XAML CustomRenderer Portable library
Status: RESOLVED DUPLICATE of bug 35884
Alias: None
Product: iOS
Classification: Xamarin
Component: BCL Class Libraries ()
Version: XI 9.4 (iOS 9.2)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-12-22 18:18 UTC by Sylvrec
Modified: 2015-12-23 11:12 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 35884

Description Sylvrec 2015-12-22 18:18:11 UTC
The portable library is not accessible in the xaml.
I have had need to create an instance object from my portable library in view.xaml.cs for create reference in view.xaml for forced only for iOS.
------------------------------------------------------------------------------------------
view.xaml.cs:
using Xamarin.CustomRenderer;
namespace Exemple.Views
{
    public partial class ListPatientsView
    {
        public ListPatientsView()
        {
            InitializeComponent();
            MyListView l = new MyListView(); // iOS to do better
            
        }
    }
}
------------------------------------------------------------------------------------------
view.xaml:
<mvvm:BaseView xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             [...]
             xmlns:controls="clr-namespace:Xamarin.CustomRenderer;assembly=Xamarin.CustomRenderer"
             [...]>
        <controls:MyListView ItemsSource="{Binding Patients}"
            ItemClickCommand="{Binding PatientCommand}"
            RowHeight="70"
            HasUnevenRows="True"
            IsPullToRefreshEnabled="True"
            RefreshCommand="{Binding LoadPatientCommand}"
            IsRefreshing="{Binding IsBusy, Mode=OneWay}">[...]</controls:MyListView>

[...]
</mvvm:BaseView>

------------------------------------------------------------------------------------------
StackTrace :
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00016] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:650 
  at System.RuntimeType.CreateInstanceMono (Boolean nonPublic) [0x000ca] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/ReferenceSources/RuntimeType.cs:113 
  at System.RuntimeType.CreateInstanceSlow (Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x0001a] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/corlib/ReferenceSources/RuntimeType.cs:87 
  at System.RuntimeType.CreateInstanceDefaultCtor (Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x0002a] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/rttype.cs:5734 
  at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00040] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/activator.cs:214 
  at System.Activator.CreateInstance (System.Type type) [0x00000] in /Users/builder/data/lanes/2377/73229919/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/external/referencesource/mscorlib/system/activator.cs:147 
  at XLabs.Forms.Mvvm.ViewFactory.CreatePage (System.Type viewModelType, System.Action`2 initialiser) [0x00098] in <filename unknown>:0 
  at XLabs.Forms.Mvvm.ViewFactory.CreatePage[TViewModel,TPage] (System.Action`2 initialiser) [0x0001a] in <filename unknown>:0 
  at DxAppMobile.Services.NavigationService+<NavigationToPhotoPatient>d__3a.MoveNext () [0x00081] in NavigationService.cs:341
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-12-23 11:12:34 UTC
This is the expected behavior.

See bug #35884 for a thorough explanation.

*** This bug has been marked as a duplicate of bug 35884 ***