-
Notifications
You must be signed in to change notification settings - Fork 20
Add first part of bottom sheet docs #1203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
63ae2ad
Add first part of bottom sheet docs
didiyordanova 735aec4
update articles
didiyordanova d364eb6
add additional info
didiyordanova b252905
update content
didiyordanova 0ce4091
update articles and add images part 2
didiyordanova cba03a9
Merge branch 'development' into didi/bottomsheet
didiyordanova 7cec3d6
add bottomsheet to toc
didiyordanova c383eff
Merge branch 'didi/bottomsheet' of https://github.com/telerik/maui-do…
didiyordanova 3d147d6
address comments
didiyordanova b71e0fe
Update controls/bottomsheet/configuration.md
didiyordanova File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| title: Animation | ||
| page_title: .NET MAUI BottomSheet Documentation - Animation | ||
| description: Learn how to configure animation settings for the Telerik BottomSheet for .NET MAUI, including duration, easing, and enable/disable options. | ||
| position: 5 | ||
| slug: bottomsheet-animation | ||
| --- | ||
|
|
||
| # .NET MAUI BottomSheet Animation | ||
|
|
||
| Adding an animation to the BottomSheet provides visual continuity and makes the interface feel more responsive and polished. The Telerik .NET MAUI BottomSheet provides an option to set the animation when opening/closing the bottom view. | ||
|
|
||
| ## Animation while Opening/Closing | ||
|
|
||
| To enable or disable the animation, use the `IsAnimationEnabled` (`bool`) property of `RadBottomSheet`. By default, the animation is enabled. | ||
|
|
||
| You can also customize the animation's duration and easing through the `AnimationDuration` and `AnimationEasing` properties. | ||
|
|
||
| * `AnimationDuration`(`uint`)—Defines the duration of the animation while opening/closing the bottom view. The default value is `1000` milliseconds. | ||
| * `AnimationEasing`(`Microsoft.Maui.Easing`)—Specifies animation acceleration over time. The default value is `Easing.CubicOut`. | ||
|
|
||
| > For a runnable example with the BottomSheet Animation scenario, see the [SDKBrowser Demo Application]({%slug sdkbrowser-app%}) and go to **BottomSheet > Features** category. | ||
|
|
||
| ## See Also | ||
|
|
||
| - [Configure the BottomSheet]({%slug bottomsheet-configuration%}) | ||
| - [Style the BottomSheet]({%slug bottomsheet-styling%}) | ||
| - [Events]({%slug bottomsheet-events%}) | ||
| - [Methods]({%slug bottomsheet-methods%}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| --- | ||
| title: Configuration | ||
| page_title: .NET MAUI BottomSheet Documentation - Configuration | ||
| description: Learn more about how to configure the Telerik UI for .NET MAUI BottomSheet control. | ||
| position: 3 | ||
| slug: bottomsheet-configuration | ||
| --- | ||
|
|
||
| # .NET MAUI BottomSheet Configuration | ||
|
|
||
| The Telerik UI for .NET MAUI BottomSheet control offers flexible configuration options for states, dimensions, and visual elements. You can define custom states with specific heights, control the sheet's dimensions using absolute or percentage values, and customize the draggable handle to match your application's design. | ||
|
|
||
| ## States | ||
|
|
||
| The BottomSheet control provides a flexible state system that determines how much of the screen the component occupies. You can use predefined states or create custom ones to present content at different visibility levels. | ||
|
|
||
| ### Predefined States | ||
|
|
||
| The control includes four built-in states with predefined heights: | ||
|
|
||
| * `Hidden` (default)—Represents a completely hidden bottom sheet. | ||
| * `Minimal`—Represents a minimal bottom sheet state with height `25%`. | ||
| * `Partial`—Represents a partial bottom sheet state with height `50%`. | ||
| * `Full`—Represents a full bottom sheet state with height `90%`. | ||
|
|
||
| ### Setting States | ||
|
|
||
| You can specify the current state using the `State` property of type `BottomSheetState`: | ||
|
|
||
| ```xaml | ||
| <telerik:RadBottomSheet x:Name="bottomSheet" | ||
| State="Partial"> | ||
| <!-- Content --> | ||
| </telerik:RadBottomSheet> | ||
| ``` | ||
|
|
||
| ### Custom States | ||
|
|
||
| Create custom states using the `BottomSheetState` class constructors: | ||
|
|
||
| * Using `BottomSheetLength` | ||
|
|
||
| ```csharp | ||
| public BottomSheetState(string name, BottomSheetLength height) | ||
| ``` | ||
|
|
||
| * Using `double value` | ||
|
|
||
| ```csharp | ||
| public BottomSheetState(string name, double size, bool isPercentage = false) | ||
| ``` | ||
|
|
||
| Example of creating custom states: | ||
|
|
||
| ```csharp | ||
| // Custom state with 30% height | ||
| var customState = new BottomSheetState("Custom", 30, true); | ||
|
|
||
| // Custom state with absolute height = 200 | ||
| var fixedState = new BottomSheetState("Fixed", 200, false); | ||
| ``` | ||
|
|
||
| ### Programmatic State Changes | ||
|
|
||
| Use the [`GoToBottomSheetState(string name)` method]({%slug bottomsheet-methods%}) to programmatically change states: | ||
|
|
||
| Here is an example setting the predefined name of the state inside the `GoToBottomSheetState(string name)` method: | ||
|
|
||
| <snippet id='open-bottomsheet-view' /> | ||
|
|
||
| Here is an example setting a custom state: | ||
|
|
||
| ```csharp | ||
| // Navigate to custom states | ||
| var customState = new BottomSheetState("Custom", 30, true); | ||
| bottomSheet.GoToBottomSheetState("Custom"); | ||
| ``` | ||
|
|
||
| ### Auto-Generated States | ||
|
|
||
| You can control the generation of default states using the `AutoGenerateStates` property. | ||
|
|
||
| ```xaml | ||
| <telerik:RadBottomSheet AutoGenerateStates="False"> | ||
|
|
||
| </telerik:RadBottomSheet> | ||
| ``` | ||
|
|
||
| The default value is `true`, which means the four predefined states are populated in the `States` collection. | ||
|
|
||
| ### States Collection | ||
|
|
||
| The BottomSheet provides a read-only `States` collection of type `ObservableCollection<BottomSheetState>` that contains all available states for the bottom sheet, including both predefined and custom states. | ||
|
|
||
| > For a runnable example with setting the BottomSheet States, see the [SDKBrowser Demo Application]({%slug sdkbrowser-app%}) and go to **BottomSheet > Features** category. | ||
|
|
||
| ## Width | ||
|
|
||
| You can specify the width for the bottom sheet content using the `BottomSheetContentWidth` property of type `BottomSheetLength`. The `BottomSheetLength` structure supports both absolute and percentage values: | ||
|
|
||
| ```xaml | ||
| <!-- Percentage width --> | ||
| <telerik:RadBottomSheet BottomSheetContentWidth="80%"> | ||
| <!-- Content --> | ||
| </telerik:RadBottomSheet> | ||
|
|
||
| <!-- Absolute width --> | ||
| <telerik:RadBottomSheet BottomSheetContentWidth="300"> | ||
| <!-- Content --> | ||
| </telerik:RadBottomSheet> | ||
| ``` | ||
| ```csharp | ||
| // Using percentage | ||
| bottomSheet.BottomSheetContentWidth = new BottomSheetLength(80, true); | ||
|
|
||
| // Using absolute value | ||
| bottomSheet.BottomSheetContentWidth = new BottomSheetLength(300, false); | ||
| ``` | ||
|
|
||
| > For a runnable example with setting the BottomSheet Width, see the [SDKBrowser Demo Application]({%slug sdkbrowser-app%}) and go to **BottomSheet > Features** category. | ||
|
|
||
| ## Handle | ||
|
|
||
| The BottomSheet exposes a visual cue which indicates the control can be dragged. You can customize the handle by using the `HandleStyle` (`Style` with target type `BottomSheetHandle`) property. | ||
|
|
||
| For more details, review the [BottomSheet Handle Styling]({%slug bottomsheet-styling%}#handle-styling) article. | ||
|
|
||
| ## See Also | ||
|
|
||
| - [Animation when opening and closing the bottom sheet]({%slug bottomsheet-animation%}) | ||
| - [Style the BottomSheet]({%slug bottomsheet-styling%}) | ||
| - [Events]({%slug bottomsheet-events%}) | ||
| - [Methods]({%slug bottomsheet-methods%}) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| --- | ||
| title: Content | ||
| page_title: .NET MAUI BottomSheet Documentation - Content | ||
| description: Learn more about how to set content inside the Telerik UI for .NET MAUI BottomSheet control. | ||
| position: 3 | ||
| slug: bottomsheet-content | ||
| --- | ||
|
|
||
| # .NET MAUI BottomSheet Content | ||
|
|
||
| The BottomSheet control has two distinct content areas: the _main content_ that serves as the background layer, and the _bottom sheet content_ that slides up to overlay additional information or functionality. You set the main content as the primary child of the control, while the `BottomSheetContent` (`View`) property defines what appears in the sliding panel. | ||
|
|
||
| Here is a sample scenario when using the Telerik .NET MAUI [`RadCollectionView`]({%slug collectionview-overview%}) in the main content of the BottomSheet and a detailed view in the `BottomSheetContent`. | ||
|
|
||
| **1.** Define the sample data model: | ||
|
|
||
| <snippet id='bottomsheet-data-model' /> | ||
|
|
||
| **2.** Define the `ViewModel`: | ||
|
|
||
| <snippet id='bottomsheet-view-model' /> | ||
|
|
||
| **3.** Define the BottomSheet in XAML with `RadCollectionView`: | ||
|
|
||
| <snippet id='bottomsheet-animation-swipe' /> | ||
|
|
||
| **4.** Add the `telerik` namespace: | ||
|
|
||
| ```XAML | ||
| xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui" | ||
| ``` | ||
|
|
||
| **5.** Add the following code for the `RadCollectionView.ItemTapped` event handler: | ||
|
|
||
| <snippet id='bottomsheet-content-tapped-event' /> | ||
|
|
||
| This is the result on Android: | ||
|
|
||
|  | ||
|
|
||
| > For a runnable example with the BottomSheet Content scenario, see the [SDKBrowser Demo Application]({%slug sdkbrowser-app%}) and review all **BottomSheet** example. | ||
|
|
||
| ## Setting Custom Control Template | ||
|
|
||
| > If you want to review the default BottomSheet templates, add the [TelerikTheming]({%slug themes-overview%}) to the project and go to `TelerikTheming/Styles/Platform/BottomSheet.xaml` file. | ||
|
|
||
|
|
||
| Here is an example setting custom `ControlTemplate`. | ||
|
|
||
| <snippet id='bottomsheet-custom-control-template' /> | ||
|
|
||
| This is the result on Android: | ||
|
|
||
|  | ||
|
|
||
| ## See Also | ||
|
|
||
| - [Animation when opening and closing the bottom sheet]({%slug bottomsheet-animation%}) | ||
| - [Style the BottomSheet]({%slug bottomsheet-styling%}) | ||
| - [Events]({%slug bottomsheet-events%}) | ||
| - [Methods]({%slug bottomsheet-methods%}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
| title: Events | ||
| page_title: .NET MAUI BottomSheet Documentation - Events | ||
| description: Learn about the PositionChanged event in Telerik UI for .NET MAUI BottomSheet and how to handle position changes when the bottom sheet is dragged or programmatically moved. | ||
| position: 9 | ||
| slug: bottomsheet-events | ||
| --- | ||
|
|
||
| # .NET MAUI BottomSheet Events | ||
|
|
||
| The BottomSheet `StateChanging` event is useful for tracking user interactions and responding to sheet movements. Use this event to update UI elements based on the sheet's state, implement custom animations, or trigger actions when the sheet reaches specific state during drag gestures or programmatic state changes. | ||
| The `StateChanging` event handler receives two parameters: | ||
| * The `sender` argument, which is of type `object`, but can be cast to the `RadBottomSheet` type. | ||
| * The `BottomSheetStateChangingEventArgs` object, which has a reference to the new position of the bottom sheet through its `Position` property (of type `double`). | ||
|
|
||
| ## See Also | ||
|
|
||
| - [Configure the BottomSheet]({%slug bottomsheet-configuration%}) | ||
| - [Animation when opening and closing the bottom sheet]({%slug bottomsheet-animation%}) | ||
| - [Style the BottomSheet]({%slug bottomsheet-styling%}) | ||
| - [Methods]({%slug bottomsheet-methods%}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| --- | ||
| title: Getting Started | ||
| page_title: .NET MAUI BottomSheet Documentation - Getting Started | ||
| description: Get started with the Telerik UI for .NET MAUI BottomSheet control and learn how to add the control to your .NET MAUI application. | ||
| position: 2 | ||
| slug: bottomsheet-getting-started | ||
| --- | ||
|
|
||
| # Getting Started with the .NET MAUI BottomSheet | ||
|
|
||
| This guide provides the information you need to start using the Telerik UI for .NET MAUI BottomSheet by adding the control to your project. | ||
|
|
||
| At the end, you will achieve the following result. | ||
|
|
||
|  | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Before adding the BottomSheet, you need to: | ||
|
|
||
| 1. [Set up your .NET MAUI application]({%slug maui-getting-started %}#step-1-set-up-your-net-maui-application). | ||
|
|
||
| 1. [Download Telerik UI for .NET MAUI]({% slug maui-getting-started %}#step-2-download-telerik-ui-for-net-maui). | ||
|
|
||
| 1. [Install Telerik UI for .NET MAUI]({%slug maui-getting-started %}#step-3-install-telerik-ui-for-net-maui). | ||
|
|
||
| ## Define the Control | ||
|
|
||
| **1.** When your .NET MAUI application is set up, you are ready to add the BottomSheet control to your page. | ||
|
|
||
| <snippet id='bottomsheet-getting-started-xaml' /> | ||
| <snippet id='bottomsheet-getting-started-csharp' /> | ||
|
|
||
| **2.** Add the `telerik` namespace: | ||
|
|
||
| ```XAML | ||
| xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui" | ||
| ``` | ||
| ```C# | ||
| using Telerik.Maui.Controls; | ||
| ``` | ||
|
|
||
| **3.** Add the code for opening the BottomSheet view: | ||
|
|
||
| <snippet id='open-bottomsheet-view' /> | ||
|
|
||
| **4.** Add the code for closing the BottomSheet view: | ||
|
|
||
| <snippet id='close-bottomsheet-view' /> | ||
|
|
||
| **5.** Register the Telerik controls through the `Telerik.Maui.Controls.Compatibility.UseTelerik` extension method called inside the `CreateMauiApp` method of the `MauiProgram.cs` file of your project: | ||
|
|
||
| ```C# | ||
| using Telerik.Maui.Controls.Compatibility; | ||
|
|
||
| public static class MauiProgram | ||
| { | ||
| public static MauiApp CreateMauiApp() | ||
| { | ||
| var builder = MauiApp.CreateBuilder(); | ||
| builder | ||
| .UseTelerik() | ||
| .UseMauiApp<App>() | ||
| .ConfigureFonts(fonts => | ||
| { | ||
| fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); | ||
| }); | ||
|
|
||
| return builder.Build(); | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| > For a runnable example with the BottomSheet Getting Started scenario, see the [SDKBrowser Demo Application]({%slug sdkbrowser-app%}) and go to **BottomSheet > Getting Started**. | ||
|
|
||
| ## Additional Resources | ||
|
|
||
| - [.NET MAUI BottomSheet Product Page](https://www.telerik.com/maui-ui/bottomsheet) | ||
| - [.NET MAUI BottomSheet Forum Page](https://www.telerik.com/forums/maui?tagId=1763) | ||
| - [Telerik .NET MAUI Blogs](https://www.telerik.com/blogs/mobile-net-maui) | ||
| - [Telerik .NET MAUI Roadmap](https://www.telerik.com/support/whats-new/maui-ui/roadmap) | ||
|
|
||
| ## See Also | ||
|
|
||
| - [Configure the BottomSheet]({%slug bottomsheet-configuration%}) | ||
| - [Animation when opening and closing the bottom sheet]({%slug bottomsheet-animation%}) | ||
| - [Style the BottomSheet]({%slug bottomsheet-styling%}) | ||
| - [Events]({%slug bottomsheet-events%}) | ||
| - [Methods]({%slug bottomsheet-methods%}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.