1 回答
TA贡献1804条经验 获得超3个赞
您可以为您的 StackLayout 添加一个名称,以便在您的代码隐藏中引用。
<ScrollView>
<StackLayout x:Name="mainLayout" Padding="20, 20, 20, 20">
<local:TimeSheetAccordion HeaderText="Customer #1" BackgroundColor="#FAFAFA" Padding="20, 20, 20, 20" />
<local:TimeSheetAccordion HeaderText="Customer #2" BackgroundColor="#FAFAFA" Padding="20, 20, 20, 20" />
<StackLayout Margin="0, 30, 0, 0" Orientation="Horizontal" HorizontalOptions="End">
<Button Text="Reset" BorderRadius="6" />
<Button Text="Submit Time Sheet" BackgroundColor="Blue" TextColor="White" BorderRadius="6" />
</StackLayout>
</StackLayout>
</ScrollView>
在此之后,在您的 Page.xaml.cs
mainLayout.Children.Add(new TimeSheetAccordion());
- 1 回答
- 0 关注
- 105 浏览
添加回答
举报