0

こんにちは、フォームに消耗品リストがあり、クリック時の効果を拡張可能リスト内の項目にバインドしたいと考えています。ここまでは順調ですね。エキスパンドを正しく表示することはできましたが、ダブルクリックをバインドできません。私はMVVM Catelでプロジェクトを行っています。

私のXAML:

<Grid>
    <ItemsControl ItemsSource="{Binding Source={StaticResource cvsRoutes}}">
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <Expander Header="{Binding Name}" MinHeight="50">
                    <ListBox>
                       <TextBlock Text="Something" >
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="MouseDoubleClick">
                                <cmd:EventToCommand Command="{Binding OpenNewWindow}"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        </TextBlock>
                        <TextBlock Text="Something" />
                        <TextBlock Text="Something" />
                        <TextBlock Text="Something" />
                        <TextBlock Text="Something" />
                    </ListBox>
                </Expander>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>
</Grid>

そしてModelViewクラスには次のものがあります:

 public RouteViewModel(IMessageService messageService,
        IPleaseWaitService pleaseWaitService, IMapService mapService)
    {
       this.mapService = mapService;
       OpenNewWindow = new Command(CreateNewWindow);
    }

    public Command OpenNewWindow { get; private set; }
    //Method To Open the new window
    public void CreateNewWindow()
    {
        NewWindow.ShowNewWindowMap();
    }
4

1 に答える 1