public TLListView() { isolatedStorageProvider = new IsolatedStorageProvider(); _tLsService = SmObjectFactory.Container.GetInstance <ITLsService>(); InitializeComponent(); Loaded += (s, ea) => { _accessUtility = SmObjectFactory.Container.GetInstance <AccessUtility>(); _viewModel = DataContext as TLListViewModel; _viewModel.Error += OnError; _viewModel.LoadTLs(); // RaiseCanExecuteChanged(); //NavStateFalse(); //var addNewTLCommand = RadDataFormCommands.AddNew as RoutedUICommand; TLDataForm.CommandProvider = new CustomCommandProvider(); //addNewTLCommand.Execute(null, TLDataForm); TLRadGridView.SelectedItem = null; detailRadTabItem.IsSelected = true; // DataContext = _viewModel; isolatedStorageProvider.LoadFromStorage(); }; Unloaded += (s, ea) => { _viewModel.Error -= OnError; isolatedStorageProvider.SaveToStorage(); }; }
public AddEditTLViewModel(ITLsService tLsService, IGLsService gLsService, ISystemAccountingSettingsService systemAccountingSettingsService) { _tLsService = tLsService; _gLsService = gLsService; CancelCommand = new RelayCommand(OnCancel); SaveCommand = new RelayCommand(OnSave, CanSave); GLsDropDownOpenedCommand = new RelayCommand(OnGLsDropDownOpened, () => GLs != null && GLs.Any()); _systemAccountingSettingsService = systemAccountingSettingsService; }
public SystemAccountingSettingViewModel(IAppContextService appContextService, IGLsService gLsService, ITLsService tLsService, ISLsService sLsService, IDLsService dLsService, ISystemAccountingSettingsService systemAccountingSettingsService) { _gLsService = gLsService; _tLsService = tLsService; _sLsService = sLsService; _dLsService = dLsService; _appContextService = appContextService; _systemAccountingSettingsService = systemAccountingSettingsService; SystemAccountingSettingModel = AutoMapper.Mapper.Map <SystemAccountingSettingModel, EditableSystemAccountingSettingModel>(_systemAccountingSettingsService.GetSystemAccountingSettingModel()); SystemAccountingSettingModel.ValidationDelegate += SystemAccountingSettingModel_ValidationDelegate; SaveCommand = new RelayCommand(onSave); _accessUtility = SmObjectFactory.Container.GetInstance <AccessUtility>(); }
public AddSLTreeItemWindowViewModel(ISLsService sLsService, ITLsService tLsService, IDLTypesService dLTypesService, ISystemAccountingSettingsService systemAccountingSettingsService, IPropertiesService propertiesService, IAccountsNaturesService accountsNaturesService) { _dLTypesService = dLTypesService; _sLsService = sLsService; _tLsService = tLsService; _systemAccountingSettingsService = systemAccountingSettingsService; _propertiesService = propertiesService; _accountsNaturesService = accountsNaturesService; // CancelCommand = new RelayCommand(OnCancel); SaveCommand = new RelayCommand(OnSave, CanSave); TLsDropDownOpenedCommand = new RelayCommand(OnTLsDropDownOpened, () => TLs != null && TLs.Any()); PropertiesDropDownOpenedCommand = new RelayCommand(OnPropertiesDropDownOpened, () => Properties != null && Properties.Any()); AccountsNaturesDropDownOpenedCommand = new RelayCommand(OnAccountsNaturesDropDownOpened, () => AccountsNatures != null && AccountsNatures.Any()); SelectedDLTypes1 = new ObservableCollection <DLType>(); SelectedDLTypes2 = new ObservableCollection <DLType>(); // SLStandardDescriptionListViewModel = SmObjectFactory.Container.GetInstance<SLStandardDescriptionListViewModel>(); SL = new SL(); }