Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/271.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 双击命令和双击事件处理程序的执行顺序_C#_Wpf_Xaml_Datagrid_Command - Fatal编程技术网

C# 双击命令和双击事件处理程序的执行顺序

C# 双击命令和双击事件处理程序的执行顺序,c#,wpf,xaml,datagrid,command,C#,Wpf,Xaml,Datagrid,Command,我想将UI与程序逻辑分离,因此为DataGridRow引入双击命令。我设法使我的DataGrid在双击一行时执行命令。在xaml中,我现在可以像这样使用我的DataGrid: <DataGrid h:Commands.DataGridRowDoubleClickCommand="{Binding SomeCommand}"> ... </DataGrid> ... 技术是相似的 双击一行即可执行该命令。现在,我想要一个DataGridRow的事件处理程序,它

我想将UI与程序逻辑分离,因此为DataGridRow引入双击命令。我设法使我的DataGrid在双击一行时执行命令。在xaml中,我现在可以像这样使用我的DataGrid:

<DataGrid h:Commands.DataGridRowDoubleClickCommand="{Binding SomeCommand}">
    ...
</DataGrid>

...
技术是相似的

双击一行即可执行该命令。现在,我想要一个DataGridRow的事件处理程序,它通过
ShowDialog()
打开一个新窗口


现在的问题是:事件处理程序在命令之前执行。是否有任何方法可以更改MouseDoubleClick等事件中处理程序的顺序?

在我看来,打开带有警告/info/data的对话框是程序逻辑的一部分。在事件处理程序中操作ui是ui逻辑,但不显示信息。

为什么要为同一个控件拆分双击逻辑?是否有必要?在事件处理程序中,我只想打开一个新窗口。这只是ui逻辑。在命令中,应修改ViewModels,以便以后窗口可以将其用作DataContext。