public override void OnPageLoad(object sender, EventArgs e) { base.OnPageLoad(sender, e); this._voucherProductVM = new GiftCardProductVM(); this._facade = new GiftCardFacade(this); selected = new List <int>(); this.voucherProduct.ProductSelected += voucherProduct_ProductSelected; _facade.GetGiftCardC3SysNo((no) => { _c3SysNo = no; }); if (RequestSysNo.HasValue) { this._voucherProductVM.SysNo = RequestSysNo.Value; _facade.GetGiftVoucherProductInfo(RequestSysNo.Value, (ret) => { this._voucherProductVM = ret; foreach (var item in this._voucherProductVM.RelationProducts) { item.IsChecked = false; } SetDataContext(); }); } else { //this.voucherProductgd SetDataContext(); } }
void UCGiftCardProductMaintain_Loaded(object sender, RoutedEventArgs e) { Loaded -= new RoutedEventHandler(UCGiftCardProductMaintain_Loaded); facade = new GiftCardFacade(CPApplication.Current.CurrentPage); giftCardProductVM = giftCardProductVM ?? new GiftCardProductVM(); this.LayoutRoot.DataContext = giftCardProductVM; voucherProduct.ProductSelected += voucherProduct_ProductSelected; facade.GetGiftCardC3SysNo((no) => { C3SysNo = no; }); }