コード例 #1
0
ファイル: UnitListViewModel.cs プロジェクト: xuanhnvt/XRMS
        /// <summary>
        /// Create new item and add into database
        /// </summary>
        protected override void CreateNewItem()
        {
            try
            {
                UnitViewModel viewModel = new UnitViewModel(this.MessageBoxService, (IUnitManager)ModelManager);

                // open dialog and return result when it is closed
                bool?result = this.UIVisualizerService.ShowDialog("UnitPopup", viewModel);

                // code to check result
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
ファイル: UnitListViewModel.cs プロジェクト: xuanhnvt/XRMS
        /// <summary>
        /// Edit an existing item and update in database
        /// </summary>
        protected override void EditItem(Unit selectedItem)
        {
            try
            {
                if (selectedItem == null)
                {
                    throw new ArgumentNullException("selectedItem");
                }

                UnitViewModel viewModel = new UnitViewModel(this.MessageBoxService, selectedItem, (IUnitManager)ModelManager);

                // open dialog and return result when it is closed
                bool?result = this.UIVisualizerService.ShowDialog("UnitPopup", viewModel);

                // code to check result
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }