hello guys.
I'm very beginner in windows 10 universal apps, I created app which has employee class for example in the models folder let us say like the following:
public class Employee
{
public int Id { get; set; }
public string Name { get; set; }
}
and in xaml I created AutoSuggestBox and listView which I bind to ObervableCollection list of type Employee and this as the following:
<listview itemssource="{x:Bind EmployeesList}"
HorizontalAlignment="Left">
<listview.itemtemplate>
<datatemplate x:datatype="data:Employee" xmlns:x="#unknown">
<stackpanel orientation="Horizontal">
<checkbox checked="StatusCB_Checked"
Margin="5,2,5,0">
<textblock name="EmpNametxtBlk"
Text="{x:Bind Name}"
VerticalAlignment="Center">
</textblock></checkbox></stackpanel>
</datatemplate>
</listview.itemtemplate>
</listview>
Now once I type name in the AutoSuggestBox the list view will show the checkBox and the employee name , I want to check the checkbox and I want to get the employee object to get deleted from the list view and then add to another list view let's say for chosen employees , my questions is how I can bind the checkBox to the employee ID and then i can use that object in the code behind for the check event ? I mean once i check the checkbox of any added employee on the Listview I wanted to do : deleted that employee from the ListView and add him in other list view the other list view will be hidden till I delete employees from the first Listview. how I can bind the checkbox to the ID of the employee and how I can extract the employee object in the check event or any other even, well I wish I explained what I want in clear way !
What I have tried:
I tried but I'm kinda stuck I'm new to Universal Windows Apps and XAML.