Hello Team,
I wanted to pass the DependencyObject's object to the VisualTreeHelper.GetChilderCount() but it is showing error as:
Cannot convert from 'System.Windows.DependencyObject' to 'System.Windows.UIElement'
It was possible to pass these objects in SilverLight Application but in CSHTML5 project I could not.
Sample Code example from SilverLight Application:
public static T FindVisualChildByType<T>(DependencyObject parent) where T : DependencyObject
{
for (int count = 0; count < VisualTreeHelper.GetChildrenCount(parent); count++)
{
var child = VisualTreeHelper.GetChild(parent, count);
}
}
Kindly let me know how to pass the DependencyObject object instead of System.Windows.UIElement.
Regards,
Amrutha