对于日历应用程序(silverlight WP7.5),我使用wrappanel来包含日期(以Button为子级的边框)。现在我想在边框中添加另一个按钮。所以每一天都会有数字和额外的信息/图形。我刚刚注意到边框只能包含1个子元素。我该如何处理它?
Border border = new Border();
Button btn = new Button();
border.Child = btn;
//Button btn_notification = new Button();
// how to add the btn_notification????
CalendarWrapPanel.Children.Add(border);非常感谢!
发布于 2012-07-28 06:02:15
只需添加另一个容器(网格、StackPanel等)在你的边界内。这个示例使用一个StackPanel来演示它:
Border border = new Border();
Button btn = new Button();
Button btn_notification = new Button();
StackPanel panel = new StackPanel();
panel.Children.Add(btn);
panel.Children.Add(btn_notification);
border.Child = panel;
CalendarWrapPanel.Children.Add(border);https://stackoverflow.com/questions/11680346
复制相似问题