Way back in WinForm days, I had a problem with the SelectionChanged event in the TabControl. I didn’t want to know when the TabControl Changed, I want to know if the Tab Control is changing!
Back in Winform, I inherited the old control, overrode the event, threw my own changing event, and if it was not canceled, then threw the changing event.
With all this work an issues documented on the net with WINFORM – did Telerik really miss this one as well? Any suggestions to overcome (like E.Cancel = True)?
Regards,
Richard
p.s. This is what I did, and I’m getting the previous tab, not even the currently selected tab… arrrgghh.
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding SetSelectedTabHeaderCommand, Mode=OneWay}" CommandParameter="{Binding SelectedItem.Header, ElementName=tc_MatterInfo}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
My view model:
#region SelectedTab
RelayCommand<String> _SelectedTabHeaderCommand = null;
public RelayCommand<string> SetSelectedTabHeaderCommand
{
get
{
if (_SelectedTabHeaderCommand == null)
_SelectedTabHeaderCommand = new RelayCommand<string>(SetSelectedTabHeader);
return _SelectedTabHeaderCommand;
}
}
private void SetSelectedTabHeader(string pTabHeader)
{
SelectedTabHeader = pTabHeader;
}
string _SelectedTabHeader = string.Empty;
public string SelectedTabHeader
{
get
{
return _SelectedTabHeader;
}
private set
{
_SelectedTabHeader = value;
this.RaisePropertyChanged("SelectedTabHeader");
}
}
#endregion