I finally got around it. I changed the object param to TreeView param as below
`
private void ShowView(TreeView param)
{
if (param.SelectedItem != null) //ItemId for View 2.01
{
var itemId = ((DataItem)param.SelectedItem).ItemId;
//should be able to manipulate the rest of the bits with the itemId
}
}
Make changes to the ShowViewCommand such that the ShowView param is cast to TreeView
Public ICommand ShowViewCommand
{
get
{
if (_showViewCommand == null)
{
_showViewCommand = new RelayCommand
(
p => ShowView(p as TreeView)
);
}
return _showViewCommand;
}
}