Guest User

Untitled

a guest
Jun 5th, 2018
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.08 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using SQLite;
  6.  
  7. namespace OrganizeSe
  8. {
  9.     public class PickerMVVMViewModel
  10.     {
  11.         public List<listIng> listarIng { get; set; }
  12.  
  13.         public PickerMVVMViewModel()
  14.         {
  15.             listarIng = GetIngs().OrderBy(t => t.Value).ToList();
  16.         }
  17.  
  18.         public List<listIng> GetIngs()
  19.         {
  20.             var ing = new List<listIng>()
  21.             {   // essa parte supostamente receberia os dados da tabela, mas fiz esses itens para checar o funcionamento.
  22.                 new listIng(){Key = 1, Value= "Pão"},
  23.                 new listIng(){Key = 1, Value= "Carne"},
  24.                 new listIng(){Key = 1, Value= "Ovo"},
  25.                 new listIng(){Key = 1, Value= "Presunto"},
  26.                 new listIng(){Key = 1, Value= "Queijo"},
  27.                 new listIng(){Key = 1, Value= "Bacon"}
  28.             };
  29.             return ing;
  30.         }
  31.     }
  32.  
  33.  
  34.     public class listIng
  35.     {
  36.         public int Key { get; set; }
  37.         public string Value { get; set; }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment