.NET/MVVM Light 썸네일형 리스트형 [MVVM-Light]Implementing Progress bar using WPF with MVVM pattern(using BackgroundWorker) ProgressbarSampleView.xaml ProgressarSampleViewModel.cs namespace MyProject { public class ProggressbarSampleViewModel: ViewModelBase { private readonly BackgroundWorker worker; private readonly ICommand instigateWorkCommand; public ProggressbarSampleViewModel() { this.instigateWorkCommand = new RelayCommand(o => this.worker.RunWorkerAsync(), o => !this.worker.IsBusy); this.worker = new Backgrou.. 더보기 [MVVM-Light] View와 View 사이 통신 In the constructor of your MainPage (or whatever): Messenger.Default.Register(this, MessageReceived); The MessageReceived method (also in MainPage): private void MessageReceived(string message) { if (message == "SomeTabWasClosed") { //Do the necessary clean-up } } Then when you need to send the message (maybe in your tab Views or their ViewModels): Messenger.Default.Send("SomeTabWasClosed"); 더보기 [MVVM-Light]ViewModel 간 values 전달 The easiest way is to pass MainWindowViewModel's instance to OpenFileViewModel: public class OpenFileViewModel { private MainWindowViewModel _parent; public OpenFileViewModel(MainWindowViewModel parent) { _parent = parent; } After that you can call/access any public method/property in MainWindowViewModel: foreach (var item in _parent.myList) { ... } After a bit research I got the Current instanc.. 더보기 이전 1 다음