I have a Main form with a tab control where I am trapping the tab change event in the view model.
<
i:Interaction.Triggers
>
<
i:EventTrigger
EventName
=
"SelectionChanged"
>
<
i:InvokeCommandAction
Command
=
"{Binding TabChanged}"
CommandParameter
=
"{Binding ElementName=TCMain}"
/>
</
i:EventTrigger
>
</
i:Interaction.Triggers
>
Note the element name
In my view model I successfully trap the event for processing relying on the name to identify the tab control
private
void
tabChanged(
object
o)
{
if
(o ==
null
) {
return
; }
if
(o.GetType() ==
typeof
(Telerik.Windows.Controls.RadTabControl))
{
if
((o
as
Telerik.Windows.Controls.RadTabControl).Name !=
"TCMain"
)
{
return
;
}
}
}
One of the main window tab items also has a user control which has a tab control called UCTab, it has no tabchanged event processing.
When I change tabs on the UCTab the event on TCMain fires and the name passed to the event in the view model is the TCMain tab.
Is it possible to isolate the UCTab from the event processing.
(I have solved this by changing the UCTab to a standard MS tab control but it is very unsatisfactory).
I have a sample project to demonstrate the problem if required.