Replies: 7 comments 6 replies
-
How would this apply to macOS and Windows? |
Beta Was this translation helpful? Give feedback.
-
Is this a feature that you are willing to contribute into the toolkit? |
Beta Was this translation helpful? Give feedback.
-
https://vladislavantonyuk.github.io/articles/Creating-a-bottom-sheet-using-.NET-MAUI |
Beta Was this translation helpful? Give feedback.
-
This library is widely used by a lot of developers, including myself. I highly recommend it since it used native implementation on each platform: https://github.com/the49ltd/The49.Maui.BottomSheet even our friend Gerald has mentioned it in 2 videos. I think we should not implement a Bottom Sheet in MCT since there are already out there some solid options. |
Beta Was this translation helpful? Give feedback.
-
You can create a simple BottomSheet appearance with minimal customization of
The rest is customizing the appearance to suit your requirements <toolkit:Popup
x:Class="MauiVariablePopup.ResizePopup"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
HorizontalOptions="Fill"
VerticalOptions="End"
Color="Transparent">
<Border BackgroundColor="White" MaximumWidthRequest="600" StrokeShape="RoundRectangle 10,10,0,0">
<VerticalStackLayout>
<Label Margin="10,10,10,10" HorizontalOptions="Center" Text="Bottom Sheet Title" />
<Border Margin="0,5,0,5" />
<VerticalStackLayout Margin="20,0,20,0">
<RadioButton Content="Yes" />
<RadioButton Content="No" />
</VerticalStackLayout>
<Border Margin="0,5,0,5" />
<Button Margin="20,10,20,10" HorizontalOptions="End" Text="Vote" />
</VerticalStackLayout>
</Border>
</toolkit:Popup> |
Beta Was this translation helpful? Give feedback.
-
Closed as answered, if closed in error please let us know to re-open. |
Beta Was this translation helpful? Give feedback.
-
@peruchali non-modal behavior can be configured by setting CanBeDismissedByTappingOutsideOfPopup to False. A non-modal BottomSheet/BottomBar can also be achieved with DockLayout. @peruchali as to the detents one way that you may achieve this is if you use an invisible rotated <!-- BottomSheetView.xaml -->
<?xml version="1.0" encoding="utf-8" ?>
<ContentView
x:Class="Maui.StackOverflow.BottomSheetView"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit">
<ContentView.Resources>
<toolkit:MathExpressionConverter x:Key="Math" />
<toolkit:MultiMathExpressionConverter x:Key="MultiMath" />
</ContentView.Resources>
<ContentView.ControlTemplate>
<ControlTemplate>
<Grid x:Name="bs">
<Border
x:Name="grip"
Padding="1"
BackgroundColor="{AppThemeBinding Light=White, Dark=Black}"
HeightRequest="40"
Stroke="Gray"
StrokeShape="RoundRectangle 20, 20, 0, 0"
StrokeThickness="{TemplateBinding BorderWidth}"
TranslationY="{MultiBinding {Binding Value, Source={Reference slider}},
{Binding Height, Source={Reference bs}},
Converter={StaticResource MultiMath},
ConverterParameter='x - x1 + 2'}"
VerticalOptions="End">
<Rectangle
BackgroundColor="Gray"
HeightRequest="4"
WidthRequest="40" />
</Border>
<Slider
x:Name="slider"
HeightRequest="{Binding Width, Source={Reference bs}}"
Maximum="{Binding Height, Source={Reference bs}}"
Minimum="{Binding Height, Source={Reference grip}}"
Opacity="0"
Rotation="90"
WidthRequest="{Binding Height, Source={Reference bs}}"
ZIndex="1"
Value="{Binding Height, Source={Reference bs}, Converter={StaticResource Math}, ConverterParameter='x/2'}" />
<Border
x:Name="content"
Padding="1"
BackgroundColor="{AppThemeBinding Light=White, Dark=Black}"
HeightRequest="{MultiBinding {Binding Height, Source={Reference bs}},
{Binding Value, Source={Reference slider}},
Converter={StaticResource MultiMath},
ConverterParameter='x - x1 + 2'}"
HorizontalOptions="Fill"
TranslationY="{Binding Value, Source={Reference slider}}"
VerticalOptions="Start"
ZIndex="2">
<ContentPresenter />
</Border>
</Grid>
</ControlTemplate>
</ContentView.ControlTemplate>
</ContentView> |
Beta Was this translation helpful? Give feedback.
-
Now a days in most apps Android and IOS bottom sheet used in lot of screens. You can VOT it to add in MCT.
Thanks
11 votes ·
Beta Was this translation helpful? Give feedback.
All reactions