.NET
基于 .NET 软件框架的 Microsoft 技术。
91 个问题
我要在我的界面中实现点击或者选中某个项就从下面弹出操作框,框内有按钮点击就关闭了,不需要太复杂的操作。如何实现。
xmlns:bottomSheet="clr-namespace:Syncfusion.Maui.Toolkit.BottomSheet;assembly=Syncfusion.Maui.Toolkit"
<bottomSheet:SfBottomSheet x:Name="sfbs1" >
<bottomSheet:SfBottomSheet.Content>
<VerticalStackLayout>
<Button x:Name="btnbsopen1" Text="弹出下提示框1" Clicked="btnbsopen1_Clicked"/>
--这个按钮放外面或者里面有什么区别。我都测试了没有弹出的效果。
</VerticalStackLayout>
</bottomSheet:SfBottomSheet.Content>
<bottomSheet:SfBottomSheet.BottomSheetContent
>
<Grid RowDefinitions="*,*,*">
<Label Grid.Row="0" Text="下弹出内容" TextColor="Red"/>
<Label Grid.Row="1" Text="{Binding imgname}" TextColor="Blue"/>
<Button Grid.Row="2" Text="关闭" WidthRequest="100"/>
</Grid>
</bottomSheet:SfBottomSheet.BottomSheetContent>
</bottomSheet:SfBottomSheet>
--
private void btnbsopen1_Clicked(object sender, EventArgs e)
{
this.sfbs1.BottomSheetContent.BindingContext = new clsImgInfo() { imgname = "testimgname1", imgurl = "http://abc.com/aa.jpg" };
if (this.sfbs1.IsOpen)
{
this.sfbs1.State = BottomSheetState.HalfExpanded;
}
this.sfbs1.Show();
}