MVVM-有什么方法可以将视觉画笔的视觉效果绑定到另一个窗口吗?
我有一个设置窗口,我正在尝试对其进行设置,以便实时预览主窗口在当前设置下的外观。 这是设置对话框目前的样子的图片。大黑色矩形将是预览。
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 current settings.
Here is a picture of what the settings dialog looks like at the moment. The big black rectangle will be the preview.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这实际上是视图的实现细节,因此您可以寻找在 XAML 中执行此操作的方法(将画笔移动到共享动态资源?),或者,如果存在直接依赖关系,则通过在视图用视觉更新“子”视图。您可能还可以进行其他不需要这种类型的耦合的重构,但如果没有更多细节,很难说。我不会尝试通过 ViewModel 路由任何这些。
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.