I have a custom control. In custom control i have used tab control to display the some list items. In tab control i have 3 tab items. If i click first tab item some operation will happen. i have treeview structure in second tab. If i expand the treeview the tree view is not expanded instead of that i was navigated to first tab. I have used interaction event trigger for selectionchanged event. but i faced the problem. I hope i will get solution or some idea after post this.
Hi, if i use other than tree view inside the tabitem i faced the same error. I think i done mistake in xaml part. Please find the xaml part of my code,
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<action:TabSelectionAction TargetObject="{Binding ElementName=DataTabName}" />
</i:EventTrigger>
</i:Interaction.Triggers>
In this DataTabName is the name of the tab control. I have tried with CustomControlName as TargetObject if i used this i have faced "Target = 'Target' threw an exception of type 'System.InvalidOperationException'"
exception so i have set the tabcontrol name as targetobject.
My action class like this: (I have used this action class at the time of getting exception)
internal class TabSelectionAction : TargetedTriggerAction<ClassNameofCustomControl>
{
protected override void Invoke(object parameter)
{
if ((parameter as SelectionChangedEventArgs).OriginalSource is TabControl)
{
Thanks in advance.
Regards, Devi