Exemplo n.º 1
0
 private void DataContextChangedEventHandler(object sender, DependencyPropertyChangedEventArgs e)
 {
     if (DataContext != null && DataContext is AllUserTasksViewModel)
     {
         _viewModel             = DataContext as AllUserTasksViewModel;
         _viewModel.SetDialog  += ShowDialogEventHandler;
         _viewModel.HideDialog += HideDialogEventHandler;
         CheckDialogsState();
     }
 }
Exemplo n.º 2
0
        public AllUserTasks()
        {
            InitializeComponent();
            InitializeDialogs();

            if (DataContext is AllUserTasksViewModel)
            {
                _viewModel             = DataContext as AllUserTasksViewModel;
                _viewModel.SetDialog  += ShowDialogEventHandler;
                _viewModel.HideDialog += HideDialogEventHandler;
                CheckDialogsState();
            }
            else
            {
                DataContextChanged += new DependencyPropertyChangedEventHandler(DataContextChangedEventHandler);
            }
        }