Xamarin Forms Picker in MVVM

Поділитися
Вставка
  • Опубліковано 17 гру 2024

КОМЕНТАРІ • 37

  • @rohanandgwen1221
    @rohanandgwen1221 5 років тому +1

    Tried so many eventhandlers, this was the only one that worked for me, thanks!!

  • @robertsalasidis7695
    @robertsalasidis7695 4 роки тому +1

    Excellent video. Only change I had to make was adding a foreach with a List.Add for dynamically adding the elements in the Picker at runtime. Worked on the first shot

    • @c_forcoding
      @c_forcoding  4 роки тому

      glad to hear that it is helpful for you.. :)

  • @nicoseaton4567
    @nicoseaton4567 3 роки тому +1

    Impressive how complicated this is in Xamarin. Thank you for this tutorial. I miss windows forms C# where it was as simple as Dropdown.content.

  • @juanchinchilla5482
    @juanchinchilla5482 4 роки тому +1

    Thanks! Great example!

  • @juliangaviria2998
    @juliangaviria2998 5 років тому +1

    Thanks guy, Great job

  • @pathworks
    @pathworks 6 років тому +1

    Thanks, helped a bunch.

  • @MrDoomWaffles
    @MrDoomWaffles 4 роки тому

    Cities not showing in the picker when I open the app. Like at 2:56 mark. It shows blank.

    • @c_forcoding
      @c_forcoding  4 роки тому

      May be some data binding issue.. please check your code once

  • @lohuynhucsla_1193
    @lohuynhucsla_1193 3 роки тому

    How to select all items in xamarin?

  • @shanmuhammad3818
    @shanmuhammad3818 4 роки тому +1

    how to set a value by default in picker in mvvm

    • @c_forcoding
      @c_forcoding  4 роки тому

      Set selectedItem to the default value, it will work.. like SelectedCity = CitiesList[1]; in the constructor

  • @shurooqaldaja912
    @shurooqaldaja912 3 роки тому

    Thank you, I have a question. Already my project has MainPage. Example: "MainPage = new NavigationPage(new Page1());" this is the root page; how can i add page for picker,
    for example I applied the picker in Page5() Example: "MainPage = new NavigationPage(new Page5());"

    • @c_forcoding
      @c_forcoding  3 роки тому

      I didn't understand your question clearly...
      If you mean navigating to a page on button click:
      await Navigation.PushAsync (new Page5());

    • @shurooqaldaja912
      @shurooqaldaja912 3 роки тому

      @@c_forcoding Thank you for response, NO need a button. when I applied your code in the same steps. it gave error.
      Can not resolve reference: `System.Diagnostics.PerformanceCounter`, referenced by `Microsoft.VisualStudio.Telemetry`. Please add a NuGet package or assembly reference for `System.Diagnostics.PerformanceCounter`, or remove the reference to `Microsoft.VisualStudio.Telemetry`.
      But, already 'System.Diagnostics.PerformanceCounter' NuGet package installed. In my project the NavigationPage (root) in App.xml.cs is "MainPage = new NavigationPage(new Page1());"

    • @c_forcoding
      @c_forcoding  3 роки тому +1

      @@shurooqaldaja912 This seems to be a project setup issue.. create a new project and try implementing Picker

    • @shurooqaldaja912
      @shurooqaldaja912 3 роки тому

      @@c_forcoding Thank you a lot

  • @josecarlosmacoratti
    @josecarlosmacoratti 6 років тому +1

    Great job man

  • @talhaekrem9741
    @talhaekrem9741 4 роки тому

    Hi Thanks for the video. Its help me too much. I have a question. I want clear label text with button click. How i can do this?

    • @c_forcoding
      @c_forcoding  3 роки тому

      use "Command" for click events.... go through the link it might help you
      docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/button#using-the-command-interface

  • @surens5887
    @surens5887 4 роки тому

    By selecting the items I want to hide or change my grid content ...how to do that ?

    • @stephanraab3648
      @stephanraab3648 3 роки тому

      Add that logic on the "SelectedItem" event

  • @cguajardo
    @cguajardo 4 роки тому

    Thanks,How the picker selection is cleaned?

    • @c_forcoding
      @c_forcoding  4 роки тому

      Set SelectedItem to NULL.. It clears the SelectedItem

  • @EleazarJSH
    @EleazarJSH 6 років тому +1

    Great video.

  • @carljohnlopez5425
    @carljohnlopez5425 3 роки тому

    This video helps me a lot just got a problem if I pass the i.d instead like what if i pass the selected id of the choices to the display method (like the choices are 1=isactive and 0=isnotactive but instead of passing the string , i pass the int id instead and display it) hope you or someone help me

  • @nageswarv5422
    @nageswarv5422 6 років тому +1

    Hi, Where can i find source code. Thanks.

    • @c_forcoding
      @c_forcoding  6 років тому

      @@loka1253 sure.. will update definetly

  • @vipinkrishna131
    @vipinkrishna131 6 років тому +1

    worked..thanks

  • @adinwashere
    @adinwashere 5 років тому +1

    👌

  • @CiceroChen
    @CiceroChen 6 років тому +2

    awesome

  • @flaviohenriquepessini8637
    @flaviohenriquepessini8637 6 років тому

    I'm learning Xamarin and would like to know how to populate the picker with data from an Enum from Item.
    public class Item
    {
    public string Id { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }
    public bool Done { get; set; }
    public ItemType ItemType { get; set; }
    public ItemPriority ItemPriority { get; set; }
    }
    public enum ItemType
    {
    Personal, Professional
    }
    public enum ItemPriority
    {
    High, Low
    }