我在Page1.xaml.cs(代碼隱藏)中有一個(gè)事件,該事件需要更改ViewModel中的所有屬性。這是一個(gè)示例:(Page1.xaml.cs)public Page1(){ InitializeComponent(); example.Event += example_Event;}private void example_Event(...){ // here I want to change all Properties in my ViewModel}我怎樣才能做到這一點(diǎn)?編輯我有一個(gè)顯示.ppt的WebBrowser-Control。觸發(fā)此事件后,我想更新ViewModel中的所有屬性:xaml.cs:private void powerPointBrowser1_LoadCompleted(object sender, NavigationEventArgs e) { //... oPPApplication.SlideShowNextSlide += ppApp_SlideShowNextSlide; //Event that gets triggered when i change the Slide in my WebBrowser-Control }private void ppApp_SlideShowNextSlide(PPt.SlideShowWindow Wn) { // here i dont know how to get access to my Properties in my VM (i want to call OnChangedProperty(//for all properties in my VM)) }
如何從視圖中調(diào)用ViewModel中所有屬性的OnChangedProperty?
千萬(wàn)里不及你
2021-05-19 13:14:38