Click here to Skip to main content
16,016,580 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C#
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:
XML
<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.
Posted
Updated 27-Mar-16 21:56pm
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900