How to fire a Command when a window is loaded in wpf

前端 未结 4 1438
Happy的楠姐
Happy的楠姐 2020-12-14 23:08

Is it possible to fire a command to notify the window is loaded. Also, I\'m not using any MVVM frameworks (Frameworks in the sense, Caliburn, Onxy, MVVM Toolkit etc.,)

4条回答
  •  猫巷女王i
    2020-12-14 23:34

    A more generic way using behaviors is proposed at AttachedCommandBehavior V2 aka ACB and it even supports multiple event-to-command bindings,

    Here is a very basic example of use:

    
    

提交回复
热议问题