我有一些以编程方式添加扩展器的代码:
foreach (Purchase p in purchases)
{
databaseView.panelPurchase.Children.Add(new Expander
{
Name = "exp" + p.ID,
Header = p.Model + " " + p.ReceiptDate.Value.ToShortDateString(),
Content = new PurchaseView { DataContext = p }
});
}
有人知道如何以编程方式将按钮添加到扩展器标题的右上角吗?