XAML<Window x:Class="OddEvenRows.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
Height="400" Width="300"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" Title="JackSlater" x:Name="jackWindow">
<dxg:GridControl x:Name="gridControl" ItemsSource="{Binding MyList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="Index">
<dxg:GridColumn.CellTemplate>
<DataTemplate>
<dxe:ComboBoxEdit EditValue="{Binding Data.Index,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" IsTextEditable="False" >
<dxe:ComboBoxEditItem x:Name="readyCombox" Content="ClickDownComboxItem">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseDown">
<!--Method 01-->
<!--<cmd:EventToCommand
Command="{Binding Path=View.DataContext.ImportCommand}"
CommandParameter="{Binding Path=Title,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Window}}}"/>-->
<!--Method 02-->
<cmd:EventToCommand
Command="{Binding Path=View.DataContext.ImportCommand}"
CommandParameter="{Binding Path=Title,ElementName=jackWindow}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</dxe:ComboBoxEditItem>
</dxe:ComboBoxEdit>
</DataTemplate>
</dxg:GridColumn.CellTemplate>
</dxg:GridColumn>
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:TableView AutoWidth="True"/>
</dxg:GridControl.View>
</dxg:GridControl>
</Window>
I'd like to pass Title property in Window as CommandParameter ,but CommandParameter is always to be null. Why ? How to solute it?
I've try Method01 && Method02 ,but failed.