Tab item Double click

Topics: Questions
Jun 26, 2012 at 11:25 PM
Edited Jun 26, 2012 at 11:28 PM

 

<TabControl Name="CompanyTab" ItemsSource="{Binding CompanyCollection}" TabStripPlacement="Right">
            <TabControl.ItemTemplate>
                <DataTemplate >
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Path=_companyName}"> 
                            <i:Interaction.Triggers>
                               <i:EventTrigger EventName="MouseDoubleClick"  >
  <!--does not respond -->       <catel:EventToCommand  Command="{Binding  ShowCompanyDetailsClick}"  DisableAssociatedObjectOnCannotExecute="False"/> 
                                </i:EventTrigger>
                            </i:Interaction.Triggers>
                        </TextBlock>
                        <TextBlock Text="{Binding Title}"/>                                                             
                    </StackPanel>                   
                </DataTemplate>
            </TabControl.ItemTemplate>
            <TabControl.ContentTemplate>
                <DataTemplate >
                    <DockPanel LastChildFill="True">
                        <Views:EmployeeList >  <!-- how pass _companyName here? --> 
			</Views:EmployeeList>
                    </DockPanel>
                </DataTemplate>
            </TabControl.ContentTemplate>
        </TabControl>
it seems i may be doing something wrong? 
1. basically, i need the tabitem to respond to 'doubleclick', but it does not. 
2. next is how do i pass a _companyName on instance of child control viewmodel?
Coordinator
Jun 27, 2012 at 6:27 AM

1) What version of Catel are you using? If MouseDoubleClick is a RoutedEventHandler, you might want to try Catel 3.2 RC 1 (which should support this). 

2) You can simply bind like this:

<Views:EmployeeList DataContext="{Binding _companyName}" />
Then in your view model constructor, accept a string because the company name will be passed into your view model constructor.