visual studio - Using self created dll in Xamarin.Forms showing white screen on device -


i trying create , use dll in xamarin.forms project. given in charles petzold's book 'creating mobile apps using xamarin.form'. gives following method access library have created

"from pcl project of application solution, add reference library pcl assembly dynamic-link library generated library project"

my library project this

file: hslcolorextension.cs

using system; using xamarin.forms; using xamarin.forms.xaml;  namespace xamarin.formsbook.toolkit {     public static class toolkit     {         public static void init()         {         }     }      public class hslcolorextension : imarkupextension     {         public hslcolorextension()         {                    }          public double h { set; get; }         public double s { set; get; }         public double l { set; get; }         public double { set; get; }          public object providevalue(iserviceprovider serviceprovider)         {             return color.fromhsla(h, s, l, a);         }     }           } 

the actual project customextensiondemo in mainpage.xaml is

<?xml version="1.0" encoding="utf-8" ?> <contentpage xmlns="http://xamarin.com/schemas/2014/forms"              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"              xmlns:toolkit="clr-namespace:xamarin.formsbook.toolkit;assemby=xamarin.formsbook.toolkit"              x:class="customextensiondemo.mainpage">     <stacklayout>         <label text="utkarsh">             <label.backgroundcolor>                 <toolkit:hslcolorextension h="0" s="1" l="0.5"/>             </label.backgroundcolor>         </label>     </stacklayout> </contentpage> 

the method how added dll application library took path generated dll c:\users\admin\desktop\xamarin.formsbook.toolkit\xamarin.formsbook.toolkit\obj\debug name of dll xamarin.formsbook.toolkit.dll enter image description here

i added reference actual project. browsed path c:\users\admin\desktop\xamarin.formsbook.toolkit\xamarin.formsbook.toolkit\obj\debug , added dll : xamarin.formsbook.toolkit.dll enter image description here

everything compiled correctly but getting complete white screen on android phone having . points: 1. have set mainpage.xaml mainpage in app.xaml.cs.. have tried put label without property element syntax , worked.

i have not checked on ios think there have same problem problem in method of using dll in application. ide:vs 2017

the error discussed in below discussion enter image description here

now require way remove "windows phone silverlight 8.1" , not give option remove that. enter image description here

i'm problem incompatible targets of pcl.

instead of adding reference browsing dll, add selecting project. approach check compatibility of dll. need change targets, fool around nuget, etc.

secondly recommend first platform testing uwp. there seems better diagnostics on uwp. when tried code, got white screen on android, when using uwp platform got exception said hslcolorextension not found in dll.


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -