If I try to cast the Selected item to the binding type its always null. I'm using hierarchicial databinding. If i try to cast object to level 1 or level 2 in the hierarchary, cast always fails or is null.
if (m_CatQuestionBar.HasSelectedItem())
{
Category selectedCategory = m_CatQuestionBar.SelectedItem as Category
if(selectedCategory != null)
{
//do something
}
else
{
//unable to cast
}
}
I can provide a sample app if needed