How can I get Controls/UIElements from a TabItem itself in a TabItem or TabControl using wpf? -
i have tabcontrol using mvvm wpf c#. now, want default focus control when active tabitem doesnot lost focus when move tab. used live visual tree not active because paramater viewmodel. have used focusmanger focus control therefore need controls/ui tabitem itself.
can me?thanks
you can use method logical children recursively:
private void getallchildren(dependencyobject parent, list<dependencyobject> allchildren) { var children = logicaltreehelper.getchildren(parent); foreach (var child in children.oftype<dependencyobject>()) { allchildren.add(child); getallchildren(child, allchildren); } }
Comments
Post a Comment