コード例 #1
0
        public ResourcePage()
        {
            _resourceController      = (Application.Current as App).ResourceController;
            _medicalSupplyController = (Application.Current as App).MedicalSupplyController;
            ResourceList             = new ObservableCollection <ResourceView>();
            SupplyList = new ObservableCollection <SupplyView>();

            InitializeComponent();

            List <Resource> resources = _resourceController.GetAll();

            for (var i = 0; i < resources.Count; i++)
            {
                ResourceList.Add(new ResourceView(resources[i]));
            }

            List <MedicalSupply> supplies = _medicalSupplyController.GetAll();

            for (var i = 0; i < supplies.Count; i++)
            {
                SupplyList.Add(new SupplyView(supplies[i]));
            }

            resourceDataGrid.ItemsSource = ResourceList;
            supplyDataGrid.ItemsSource   = SupplyList;
        }