开发者

MVVM- Is there any way I can bind the visual of a visual brush to another window?

开发者 https://www.devze.com 2022-12-28 14:58 出处:网络
I have a settings window and am trying to set it up so that there is a live preview what the main window will look like with the c开发者_Go百科urrent settings.

I have a settings window and am trying to set it up so that there is a live preview what the main window will look like with the c开发者_Go百科urrent settings. Here is a picture of what the settings dialog looks like at the moment. The big black rectangle will be the preview.

MVVM- Is there any way I can bind the visual of a visual brush to another window?


This is really an implementation detail of the View, so you could look for ways to do this within the XAML (Move the brush to a shared dynamic resource?) or, if there is a direct dependency relationship, by using code-behind in the View to update the 'child' View with the Visual. There may also be other refactorings you could do that don't require this type of coupling, but it's hard to say without more detail. I wouldn't try to route any of this through the ViewModel.

0

精彩评论

暂无评论...
验证码 换一张
取 消