public SimpleEventDetailsView(ISimpleEventService service, SimpleEventViewModel entity, bool isNew) : base(service, entity, isNew) { InitializeComponent(); // init eventService = ServiceManager.ConfigureService <EventService>(); // load storages IStorageService storageService = ServiceManager.ConfigureService <StorageService>(); _storages = storageService.GetVisible(GlobalVariables.UserId, entity.StorageId); comboStorage.ItemsSource = _storages; // load currencies ICurrencyService currencyService = ServiceManager.ConfigureService <CurrencyService>(); var currencies = currencyService.GetActive(GlobalVariables.UserId, entity.CurrencyId, entity.Storage?.CurrencyId); // set currencies list compCurrencyExchangeRate.CurrencyIds = _storages.Select(_ => _.CurrencyId).Distinct().Concat(currencies.Select(c => c.Id)).Distinct().ToList(); // set header and commands panel context LabelHeader.Content = ViewHeader; CommandsPanel.DataContext = Commands; }
private void OpenDetails(SimpleEventViewModel model, bool isNew = false) { this.OpenDetailsWindow(new SimpleEventDetailsView(_simpleEventService, model, isNew), () => { // update grid if (isNew) { InsertNewEvent(_viewModel.SimpleEventsViewModel.Entities, model); } GridSimpleEvents.Items.Refresh(); NotifyDataChanged(); }); }