Esempio n. 1
0
        private async void Components_ComponentAddButton_Click(object sender, RoutedEventArgs e)
        {
            var newComponent = new ComponentPOCO()
            {
                ComponentName = "ComponentName",
                ComponentType = "ComponentType"
            };
            await DatabaseProvider.Database.AddComponent(newComponent);

            AllComponents.Add(newComponent);
            var newStorage = new StoragePOCO()
            {
                ComponentId = newComponent.Id,
                Count       = 0
            };
            await DatabaseProvider.Database.AddComponentToStorage(newStorage);

            var storage = await FullStoragePOCO.BuildFullStorageDTO(newStorage);

            AllStorage.Add(storage);

            RefreshStorageDataGrid();
            RefreshComponentsDataGrid();
        }
Esempio n. 2
0
        private async void FillStorage()
        {
            AllStorage = (await Task.WhenAll((await DatabaseProvider.Database.GetAllComponentsInStorage()).Select(async x => await FullStoragePOCO.BuildFullStorageDTO(x)))).ToList();
            var _itemSourceList = new CollectionViewSource()
            {
                Source = AllStorage
            };
            ICollectionView storageDatagridItemList = _itemSourceList.View;

            storageDatagridItemList.Filter = StorageDataGridFilter;
            StorageDatagrid.ItemsSource    = storageDatagridItemList;
        }