我有一个窗口:
<Window x:Class="Sensor_Z.View.Windows.CameraSelectorWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Sensor_Z.View.Windows"
xmlns:vm="clr-namespace:Sensor_Z.ViewModels"
mc:Ignorable="d" Title="Camera selection" Height="450" Width="800">
<Window.DataContext>
<vm:CameraSelectorVM/>
</Window.DataContext>
<Grid><Grid/>
</Window>
我的CameraSelectorVM
实例中需要WndPtr,因为我的ViewModel正在使用RegisterDeviceNotification
中的user32.dll
。
我可以通过某种方式将窗口实例传递给XAML中的ViewModel吗?