CommunityToolkit / CommunityToolkit/Maui
[Proposal] SideMenuView
- Dominant language
- C#
- Stars
- 2.7k
- Forks
- 500
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 7
Description
# SideMenuView
* [x] Proposed
* [ ] Prototype: Not Started
* [ ] Implementation: Not Started
* [ ] iOS Support
* [ ] Android Support
* [ ] macOS Support
* [ ] Windows Support
* [ ] Unit Tests: Not Started
* [ ] Sample: Not Started
* [ ] Documentation: Not Started
## Summary
[summary]: #summary
Adds a swipe-able side menu
## Detailed Design
[design]: #detailed-design
### SideMenuView.shared.cs
```cs
[ContentProperty(nameof(Children))]
public class SideMenuView : BaseTemplatedView
{
public static readonly BindableProperty ShiftProperty;
public static readonly BindableProperty CurrentGestureShiftProperty;
public static readonly BindableProperty GestureThresholdProperty;
public static readonly BindableProperty CancelVerticalGestureThresholdProperty;
public static readonly BindableProperty StateProperty;
public static readonly BindableProperty CurrentGestureStateProperty;
public static readonly BindableProperty PositionProperty;
public static readonly BindableProperty MenuWidthPercentageProperty;
public static readonly BindableProperty MenuGestureEnabledProperty;
public static readonly BindableProperty MainViewScaleFactorProperty;
public static readonly BindableProperty MainViewOpacityFactorProperty;
public static readonly BindableProperty MenuAppearanceTypeProperty;
public static readonly BindableProperty ParallaxValueProperty;
public new ISideMenuList Children { get; }
public double Shift { get; set; }
public double CurrentGestureShift { get; set; }
public double GestureThreshold { get; set; }
public double CancelVerticalGestureThreshold { get; set; }
public SideMenuState State { get; set; }
public SideMenuState CurrentGestureState { get; set; }
public static SideMenuPosition GetPosition(BindableObject bindable);
public static void SetPosition(BindableObject bindable, SideMenuPosition value);
public static double GetMenuWidthPercentage(BindableObject bindable);
public static void SetMenuWidthPercentage(BindableObject bindable, double value);
public static bool GetMenuGestureEnabled(BindableObject bindable);
public static void SetMenuGestureEnabled(BindableObject bindable, bool value);
public static double GetMainViewScaleFactor(BindableObject bindable);
public static void SetMainViewScaleFactor(BindableObject bindable, double value);
public static double GetMainViewOpacityFactor(BindableObject bindable);
public static void SetMainViewOpacityFactor(BindableObject bindable, double value);
public static SideMenuAppearanceType GetMenuAppearanceType(BindableObject bindable);
public static void SetMenuAppearanceType(BindableObject bindable, SideMenuAppearanceType value);
public static double GetParallaxValue(BindableObject bindable);
public static void SetParallaxValue(BindableObject bindable, double value);
}
```
## Usage Syntax
[usage]: #usage-syntax
### XAML Usage
```xml
```
### C# Usage
```cs
Content = new SideMenuView
{
ParallaxValue = 50,
MenuAppearanceType = SideMenuAppearanceType.SlideIn,
Position = SideMenuPosition.LeftMenu,
MenuWidthPercentage = 0.5,
MainViewScaleFactor = 0.95
Children = new StackLayout
{
BackgroundColor = Colors.Orange,
Children =
{
new Label { Text = "Left Menu" }
}
}
```
Contributor guide
Research direction
The issue provides a proposed SideMenuView API and XAML/C# usage, but names no implementation files or tests. Begin by prototyping the control and validating the listed iOS, Android, macOS, and Windows support requirements. Done means implementation, unit tests, sample, and documentation are complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop-dev, mobile-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100