Exemplo n.º 1
0
        public MainWindowViewModel(
            IEnumerable <IViewModelBehavior <MainWindowViewModel> > behaviors,
            AddEditEntryViewModel addEntryViewModel,
            AddEditEntryViewModel editEntryViewModel,
            MasterPasswordEntryViewModel masterPassword,
            CommandBarViewModel commandBarViewModel)
        {
            AddEntryViewModel            = addEntryViewModel;
            EditEntryViewModel           = editEntryViewModel;
            MasterPasswordEntryViewModel = masterPassword;
            CommandBarViewModel          = commandBarViewModel;

            behaviors.InitializeAll(this);
        }
 public void Initialize(CommandBarViewModel viewModel)
 {
     _commandBarViewModel = viewModel;
     _commandBarViewModel.AddSaveCommand   = new RelayCommand(Save, CanSave);
     _commandBarViewModel.AddCancelCommand = new RelayCommand(Cancel, CanCancel);
 }