1
I am creating a small application for windows phone 8.1, in which the user selects as many checkboxes as necessary, and from that the app goes through in a loop all the checkboxes to check which are selected, and so get its value, playing in one and sending to the next form, so that the selected items are displayed in list form, filling a listview control.
Page 1
List<ClassDados> lista = new List<ClassDados>();
ClassDados cDados = new ClassDados();
foreach (CheckBox c in checkboxes)
{
if (c.IsChecked == true)
{
cDados.Pedido = c.Content.ToString();
lista.Add(cDados);
}
}
Frame.Navigate(typeof(Carrinho), (lista));
My class
class ClassDados
{
public string Pedido { get; set; }
public int Valor { get; set; }
Page 2
public sealed partial class Carrinho : Page
{
List<ClassDados> lista = new List<ClassDados>();
public Carrinho()
{
this.InitializeComponent();
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
ClassDados c = e.Parameter as ClassDados;
Cardapio car = e.Parameter as Cardapio;
}
My point is: To receive this data from page 1 fill in a listview with the respective data, what I can’t actually, is to receive this data. (Detail: I switched to C# WP a few months ago, and changes some things from C# winforms to xaml) and for this reason I can no longer work the old way to receive this data. Thank you from now.