Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class IntAggregator
- {
- public static void Transmit(int data)
- {
- if (OnDataTransmitted != null)
- {
- OnDataTransmitted(data);
- }
- }
- public static Action<int> OnDataTransmitted;
- }
- public class ModifyUsersViewModel : INotifyPropertyChanged
- {
- private void Send_Data()
- {
- IntAggregator.Transmit(2);
- }
- }
- public class MainWindowViewModel : INotifyPropertyChanged
- {
- private int _Tab_SelectedIndex = 0;
- public int Tab_SelectedIndex
- {
- get
- {
- return _Tab_SelectedIndex;
- }
- set
- {
- _Tab_SelectedIndex = value;
- OnPropertyChanged(new PropertyChangedEventArgs("Tab_SelectedIndex"));
- }
- }
- public MainWindowViewModel()
- {
- IntAggregator.OnDataTransmitted += OnDataReceived;
- }
- private void OnDataReceived(int data)
- {
- Tab_SelectedIndex = 2;
- }
- }
Add Comment
Please, Sign In to add comment