Refresh combobox list from other window, MVVM

前端 未结 6 1952
长情又很酷
长情又很酷 2021-01-21 10:53

I\'m working on some application and I have one problem. I have two windows (Bookings - parent and Guests - child). In the parent window, I have one combo box with list of guest

6条回答
  •  甜味超标
    2021-01-21 11:12

    If I understand problem correctly - you want to get a new guest from child window and update your collection in parent window - then there are many ways to do it.

    For example:

    1. Add event "OnSuccessful" to your GuestsViewModel and then attach BookingsViewModel.

    2. Implement EventAggregator pattern (subscriber - listener)

    3. Just refresh guests after closing child window (show it as a modal dialog).

提交回复
热议问题