WPF C# - Fill binded data depending on which previous data was selected
I have a View/ViewModel which contains a UserControl for each item the
data generates.
What I would like to do is: if a user clicks on one of these items' button
i inserted in the userControl, it should show the next tab of the
TabControl and fill all of the boxes and controls in the new tab depending
on which item was clicked.
For example: if I click the item John Doe, all of John's information
should populate the next tab's boxes.
How can this be done via DataBinding? Hopefully in XAML. Does it have to
be coded in the ViewModel?
I am also having trouble showing the next tab on a command click as it
says that the TabControl is a non-static field and that I am calling it
from a static context:
public void ToggleNewItem(Item e)
{
if (e.New)
{
e.New = !e.New;
}
MainView.mainTabControl.SelectedIndex = 3;
}
No comments:
Post a Comment