I'm creating a small application for windows phone 8.1, in which the user selects as many checkboxes as necessary, and from there the app loops through all the checkboxes to check which ones are selected, and then pick up their value by playing one and sending it to the next form, so that the selected items are displayed in list form, populating 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 a listview with the respective data, which I can not actually receive is this data. (Detail: I changed it to C # WP a few months ago, and it changes some things from C # winforms to xaml) and for that reason I can no longer work in the old way to receive this data. Thank you in advance.