添加项目文件。
This commit is contained in:
38
XXCpzs/ViewModels/SaleViewModel.cs
Normal file
38
XXCpzs/ViewModels/SaleViewModel.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text;
|
||||
using Xamarin.Forms;
|
||||
using XXCpzs.Models;
|
||||
using XXCpzs.Views;
|
||||
|
||||
namespace XXCpzs.ViewModels
|
||||
{
|
||||
class SaleViewModel : BaseViewModel
|
||||
{
|
||||
public ObservableCollection<ResultModel> Items { set; get; }
|
||||
string companyName = string.Empty;
|
||||
public string CompanyName
|
||||
{
|
||||
get { return companyName; }
|
||||
set { SetProperty(ref companyName, value); }
|
||||
}
|
||||
|
||||
public int CustomerId = 0;
|
||||
|
||||
public SaleViewModel()
|
||||
{
|
||||
Title = "产品销售";
|
||||
Items = new ObservableCollection<ResultModel>
|
||||
{
|
||||
new ResultModel { Data = "序列号", Msg = "提交结果" }
|
||||
};
|
||||
MessagingCenter.Subscribe<PageCustomerSelect, Customer>(this, "SelectCustomer", async (obj, item) =>
|
||||
{
|
||||
var newItem = item as Customer;
|
||||
this.CompanyName = newItem.company + ">>" + newItem.contacts;
|
||||
this.CustomerId = newItem.id;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user