0

Hello my lists have turned white I do not have an error message and the deployment fails. I saw somewhere that it happened when we first created the items or the opposite I do not know anymore. Maybe I do not create the classes the right way Thank you

enter code here

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         x:Class="jaune.Views.ContactPage">
<ContentPage.Content>
    <StackLayout Orientation="Vertical" >
        <Label Text="page des contacts" HorizontalOptions="Center"/>
       <ScrollView>
            <StackLayout HeightRequest="400">                    
                <ListView x:Name="ListContact" >
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell>
                                <StackLayout Orientation="Horizontal" 
BackgroundColor="Gray" VerticalOptions="Center" Margin="25,0" 
Padding="10">
                                    <Image Source="carre"/>
                                    <Label Text="{Binding Nom}"/>
                                    <Label Text="{Binding Prenom}"/>
                                </StackLayout>
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                 </ListView>
            </StackLayout>
       </ScrollView>
        <StackLayout VerticalOptions="End">
            <Label Text="Lorsque X personnes auront validé votre 
proposition vos contacts pourront partager votre idée"
                   HorizontalOptions="Center"
                   Margin="15" FontSize="20"/>
            <Label Text=" X contact minimum" HorizontalOptions="Center"/>
            <Button Text="valider"/>
    </StackLayout>
    </StackLayout>
</ContentPage.Content>
</ContentPage>

I dont know if i use the good way to make a list view

namespace jaune.Views
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
     public class Contact
        {
          public string Nom { get; set; }
          public string Prenom { get; set; }
        }
    public partial class ContactPage : ContentPage
    {
        List<Contact> contacts;
        public ContactPage()
        {

            InitializeComponent();

            contacts = new List<Contact>
            {
                new Contact { Nom = "le roi", Prenom = "Arthur" },
                new Contact { Nom = "Deja ", Prenom = "Boyd" },
                new Contact { Nom = "Jairo ", Prenom = "Alvarez" },
                new Contact { Nom = "Kaylee ", Prenom = "Spence" },
                new Contact { Nom = "Hana ", Prenom = "Ponce" },
                new Contact { Nom = "Aubree  ", Prenom = "Lynch" },
                new Contact { Nom = "Logan  ", Prenom = "Knight" },
                new Contact { Nom = "Caitlyn  ", Prenom = "Davila" },
                new Contact { Nom = "Elisha ", Prenom = "Howell" },
                new Contact { Nom = "Rayan  ", Prenom = "Moyer" },
                new Contact { Nom = "Harper  ", Prenom = "Summers" },
                new Contact { Nom = "Natalia  ", Prenom = "Jefferson" },
                new Contact { Nom = "Olive  ", Prenom = "Ponce" },
                new Contact { Nom = "Adan   ", Prenom = "Wilkerson" },
                new Contact { Nom = "Logan  ", Prenom = "Knight" },
                new Contact { Nom = "Darren   ", Prenom = "Mack" }
            };

            ListContact.ItemsSource = contacts;
        }
    }
}

Finally the solution was to return to VS 2017

Stan Bomin
  • 19
  • 8
  • if the "deployment fails" then how do you know that your "lists have turned white"? Is there also XAML for this page? – Jason Apr 25 '19 at 23:45
  • yes but even the page microsoft items that I had it in my project and white – Stan Bomin Apr 25 '19 at 23:55
  • I added the xaml and cleaned the code – Stan Bomin Apr 26 '19 at 00:08
  • if you are truly having a deployment failure you need to solve that problem FIRST, otherwise debugging your UI is pointless. Your code looks OK, but your XAML seems overly complex. Your ListView is nested in a StackLayout and a ScrollView. – Jason Apr 26 '19 at 00:15
  • I found but I'm not sure how. I had a problem with "initialize component" I repaired by changing the file properties of: C # compiler to embeded resources. as cited here (https://stackoverflow.com/questions/6925584/the-name-initializecomponent-does-not-exist-in-the-current-context) Also my Resource.designer.cs file had been modified I could recover the old version.Git thank you Jason for your help I would be very interested to see the good method for the old list I am self-taught and my deficiencies defaults thank you – Stan Bomin Apr 26 '19 at 01:31
  • finally thats dosnt work :/ – Stan Bomin Apr 26 '19 at 03:01
  • I copy and post your code to my VS 2019, I can running it like this screenshot.https://imgur.com/a/pAweDpz, If you still cannot deployment, you could delete `bin` and `obj` folder, then rebuild you project. – Leon Apr 26 '19 at 09:07
  • I did I also erase all my views list exepted that of the microsoft example stay blank i have any error in my project but if i deploy i have this message in blue bar : UpdateLayeredWindowIndirect failed for ptDst=(1069, 229), size=(300x96), dirty=(300x96 0, 0) I deleted all my device and create a new one – Stan Bomin Apr 26 '19 at 12:49
  • i have the same https://developercommunity.visualstudio.com/content/problem/404956/android-emulator-wont-connect-after-hot-boot.html And the emulator restart 3 times when i close him – Stan Bomin Apr 26 '19 at 13:07
  • in my setting build i found this An error occurred while attempting to load the page. Can not load file or assembly 'Microsoft.VSDesigner, Version = 16.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a' or one of its dependencies. The specified file can not be found. – Stan Bomin Apr 26 '19 at 13:38
  • After repair visual studio add " developpement .net desktop " delete obj + bin clear the adb delete all device and create a new one the emularot works and compile but the list stay blank – Stan Bomin Apr 27 '19 at 00:28
  • finally the problem was visual studio 2019 i switched back to 2017and is working . i tryed 2019 because i have other beug like qtimezone and mscorlib but is working thank for you help – Stan Bomin Apr 27 '19 at 01:41
  • Please post your solution to the answer, it will help others who have similar issue. – Leon Apr 29 '19 at 02:52
  • of course what is the good way to do thats please – Stan Bomin Apr 29 '19 at 03:43

0 Answers0