none
Debugging mobile app on Xamarin.forms won't run RRS feed

  • Question

  • I am trying to develop a mobile app with xamarin.forms with a multi-platform application.

    Every time I try to create a <listview> element with databound info in C#, the application pulls up a black screen and crashes both on the emulator and mobile device.

    Here is the code:

    XAML

    <?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:local="clr-namespace:JumperAssemblies_Mobile"
                 x:Class="JumperAssemblies_Mobile.MainPage">
    
        <ContentPage.Padding>
            <OnPlatform x:TypeArguments="Thickness"                     
                        iOS="10, 20, 10, 0"                     
                        Android="10, 0"                     
                        WinPhone="10, 0"/>
        </ContentPage.Padding>
        
        <StackLayout HorizontalOptions="CenterAndExpand">
            <Label Text="Jumper Assemblies Mobile ~ OFS" HorizontalOptions="Center" FontSize="14"/>
    
            <Label Text="Jumper ID: " FontSize="14" FontAttributes="Bold"/>
            <Label Text="XXXXXXXXXX" FontSize="22" FontAttributes="Bold"/>
            <Button Text="Cable Design" BackgroundColor="Red" TextColor="DarkGray" Clicked="ButtonClicked"/>
            <Button Text="Fiber Type" BackgroundColor="Red" TextColor="DarkGray" Clicked="ButtonClicked"/>
            <Button Text="Fiber Count" BackgroundColor="Red" TextColor="DarkGray" Clicked="ButtonClicked"/>
    
    
            <ListView x:Name = "cableDesign" />


    C#

    namespace JumperAssemblies_Mobile
    {
        public partial class MainPage : ContentPage
        {
            List<string> aaaDataL = new List<string>();//list for item population
            int aItems = 0;//Number of A items in the product list used for loop-loading/clearing lists
            List<string> idDesign = new List<string>(); //aaa cable id
    
            public MainPage()
            {
                InitializeComponent();            
    
                cableDesign.ItemsSource = new List<String>
                {   "Select a Cable Design",
                    "JRA  Riser 1.2 mm",
                    "JR1  Riser 1.6 mm",
                    "JR2  Riser 2.0 mm",
                    "JR3  Riser 3.0 mm",
                    "JP1  Plenum 1.6 mm",
                    "JP2  Plenum 2.0 mm",
                    "JP3  Plenum 3.0 mm",
                    "JRV  Riser 3.0 mm I/O RUG",
                    "JR4 Riser 4.8 mm",
                    "JR5 Riser 4.8 mm I/O",
                    "JV9 = Low Smoke PVC 900 µm"
                };

    Am I missing a package? I've read hours of documentation and the function I'm implementing is so simple.

    Thanks for your help!!

    • Moved by CoolDadTx Friday, August 11, 2017 2:36 PM Xamarin related
    Friday, August 11, 2017 1:42 PM

All replies