Passing current mouse position in ViewModel?

In my MVVM application, I have a Direct3d rendering window that shows a bunch of 3d grids in the scene. In this rendering window, I want to be able to click one of these three-dimensional grids in the scene and move it by following the mouse pointer. This is typical 3D editor material that moves the grid along the screen. Therefore, I need to get the current mouse position, preferably relative to the Direct3d rendering window.

What is the way to do this?

Thanks!

Change: a change in wording, as it was too general and confused.

+3
source share
3 answers

, MVVM. , .

, ViewModel?

, ?

, , 3D-? , DataTemplate, 3D-, X, Y, Z .

+1

I would declare a delegate on viewmodel and make a view register for it. thus viewModel does not need to know about the view and is easy to unit test.

0
source

Source: https://habr.com/ru/post/1709239/


All Articles