0
修改這是我收集:WPF observablecollection。從子窗口
public ObservableCollection<CheckOutData> _CheckOutCollection = new ObservableCollection<CheckOutData>();
public ObservableCollection<CheckOutData> CheckOutCollection
{
get { return _CheckOutCollection; }
}
public class CheckOutData
{
public int ID { get; set; }
public string RoomType { get; set; }
public string RoomNumber { get; set; }
public decimal RoomPrice { get; set; }
public string RoomPriceWithCurrency { get; set; }
public decimal Discount { get; set; }
public decimal DiscountedPrice { get; set; }
public string DiscountedPriceWithCurrency { get; set; }
public string CheckIn { get; set; }
public string CheckOut { get; set; }
public int TotalDay { get; set; }
public string CheckOutHour { get; set; }
}
我有另外一個窗口,在這裏我想要做以下操作:添加CheckOutData公共字符串服務名{獲得;設置} 怎麼能這樣做呢?我甚至不會在我的子窗口中看到checkoutdata。 所以我的主要任務是在checkoutdata中添加新的集合,然後重新綁定datagrid。誰能幫我?
private CheckOut m_parent;
public AddActionService(CheckOut parent)
{
InitializeComponent();
m_parent = parent;
}