private async void PART_Stepper_ContinueNavigation(object sender, MaterialDesignExtensions.Controls.StepperNavigationEventArgs args) { // 发送申请 DonationMaterialListViewModel selected = (DonationMaterialListViewModel)MaterialSelectListBox.SelectedItem; if (selected == null) { MainWindow.SetSnackBarContentAndPopup("请选择要捐赠的物资"); args.Cancel = true; return; } else if (QuantityInputBox.Value == null || QuantityInputBox.Value <= 0) { MainWindow.SetSnackBarContentAndPopup("不合法的数目"); args.Cancel = true; return; } NewDonationResponse response = await NetworkHelper.GetAsync(new NewDonationRequest() { MaterialId = selected.OriginItem.Id, Quantity = (int)QuantityInputBox.Value, Address = UserInfo.HomeAddress }).Progress(ParentWindow.PART_ProgressBar); DonationViewModel = new DonationListViewModel(response.Item); DonationDetailViewModel = new DonationDetailViewModel(await NetworkHelper.GetAsync(new GetDonationDetailRequest() { UserId = UserInfo.Id, DonationId = DonationViewModel.OriginalItem.ID }).Progress(ParentWindow.PART_ProgressBar)); RefreshApplicationCardView(); }
public DonationPage(MainWindow parent, DonationListViewModel userDonationViewModel) { InitializeComponent(); ParentWindow = parent; DonationViewModel = userDonationViewModel; }
private void UserDonationList_MouseDoubleClick(object sender, MouseButtonEventArgs e) { DonationListViewModel userDonationViewModel = (DonationListViewModel)UserDonationList.SelectedItem; if (userDonationViewModel != null) { ParentWindow.NavigateToDonationPageAndDisplay(userDonationViewModel); } }