什么是简单mvvm中wpf的窗口加载事件的替代方法 [英] What is alternative to window load event of wpf in simple mvvm
本文介绍了什么是简单mvvm中wpf的窗口加载事件的替代方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何生成事件并将其绑定到wpf mvvm中的视图模型。
我尝试了事件触发器。但它没有正常工作。
给我解决方案,它的xaml代码以及它所需的名称空间。
how can i generate events and bind it to the view model in wpf mvvm.
I tried event trigger. But it was not working fine.
Give me solution with it's xaml code and also which namespaces needed for it.
推荐答案
你可以使用来自xaml代码的Window的已加载或 ContentRendered 事件。
相同的内容在下面的链接中解释。
< a href =http://stackoverflow.com/questions/18452756/whats-the-difference-between-the-window-loaded-and-window-contentrendered-event> http://stackoverflow.com/questions/18452756 /什么是窗口加载和窗口内容渲染事件之间的差异[ ^ ]
You can use the Loaded or ContentRendered event of the Window from xaml code.
Same is explained at below link.
http://stackoverflow.com/questions/18452756/whats-the-difference-between-the-window-loaded-and-window-contentrendered-event[^]
这篇关于什么是简单mvvm中wpf的窗口加载事件的替代方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文