public SelectedViewModel(Xamarin.Forms.Page _element, Action Recalc, Action RecalcPaidPrice, Xamarin.Forms.StackLayout spSelectedList, Xamarin.Forms.ControlTemplate ctSelectedControlTemplate, Xamarin.Forms.StackLayout spRequestList, Xamarin.Forms.ControlTemplate ctRequestControlTemplate, Xamarin.Forms.StackLayout spBalanceList, Xamarin.Forms.ControlTemplate ctBalanceControlTemplate) { this._element = _element; this._spSelectedList = spSelectedList; this._ctSelectedControlTemplate = ctSelectedControlTemplate; // 列表变化时重置一下编号 CurrentSelectedList.CollectionChanged += (sender, args) => { ResetNo(); }; RequestView = new RequestViewModel(null, this, spRequestList, ctRequestControlTemplate); ChangeCountView = new ChangeCountViewModel(null, this, Recalc); ChangePriceView = new ChangePriceViewModel(null, this, Recalc); ChangePaidPriceView = new ChangePaidPriceViewModel(null, RecalcPaidPrice, spBalanceList, ctBalanceControlTemplate); ChangeTimeView = new ChangeTimeViewModel(null, this, Recalc); foreach (var item in Res.Instance.AllLangList.OrderBy(x => x.Value.LangOrder)) { Dict dict = new Dict() { Name = Res.Instance.GetString("LangName", item.Value.Culture), Value = item.Value.LangIndex }; AllLang.Add(dict); } }
internal RequestViewModel(Xamarin.Forms.View element, SelectedViewModel SelectedViewModel, Xamarin.Forms.StackLayout spList, Xamarin.Forms.ControlTemplate ctControlTemplate) { this._element = element; this.SelectedViewModel = SelectedViewModel; this._spList = spList; this._ctControlTemplate = ctControlTemplate; }
public ProductsViewModel(Xamarin.Forms.Page _element, Xamarin.Forms.StackLayout spProductTypeList, Xamarin.Forms.StackLayout spProductList, Xamarin.Forms.ControlTemplate ctProductControlTemplate, bool IsImport = false) { this._element = _element; this._spProductTypeList = spProductTypeList; Notification.Instance.NotificationLanguage += (obj, value, args) => { Xamarin.Forms.Device.BeginInvokeOnMainThread(() => { SetCurrentName(); }); }; this.IsImport = IsImport; this._spProductList = spProductList; this._ctProductControlTemplate = ctProductControlTemplate; // 设置语言 SetCurrentName(); InitialProductType(); }