示例#1
0
 /// <summary>
 /// Edit the selected office
 /// </summary>
 /// <param name="item">user item</param>
 private void ExecuteEditCommand(Office office)
 {
     if (OfficeEditionRequested != null)
     {
         OfficeViewModel OfficeViewModel = new OfficeViewModel();
         OfficeViewModel.OnSaveCompleted += Model_OnSaveCompleted;
         OfficeViewModel.Initialize(office,_context,true);
         OfficeEditionRequested(this, new ContextEditionEventArgs<OfficeViewModel>(OfficeViewModel));
     }
 }
示例#2
0
        /// <summary>
        /// Execute the click event of the button new
        /// </summary>
        private void ExecuteNewCommand()
        {
            Office office = new Office();
            OfficeViewModel officeViewModel = new OfficeViewModel();

            if (OfficeEditionRequested != null)
            {
                officeViewModel.OnSaveCompleted += Model_OnSaveCompleted;
                officeViewModel.Initialize(office,_context);
                OfficeEditionRequested(this, new ContextEditionEventArgs<OfficeViewModel>(officeViewModel));
            }
        }
示例#3
0
 void OnWindowsLoaded(object sender, RoutedEventArgs e)
 {
     _model = DataContext as OfficeViewModel;
     Loaded -= OnWindowsLoaded;
 }