Skip to content
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

[Proposal] SideMenuView #117

Open
1 of 10 tasks
TheCodeTraveler opened this issue Sep 28, 2021 · 0 comments
Open
1 of 10 tasks

[Proposal] SideMenuView #117

TheCodeTraveler opened this issue Sep 28, 2021 · 0 comments
Labels
new proposal A fully fleshed out proposal describing a new feature in syntactic and semantic detail

Comments

@TheCodeTraveler
Copy link
Collaborator

SideMenuView

  • 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

Adds a swipe-able side menu

Detailed Design

SideMenuView.shared.cs

[ContentProperty(nameof(Children))]
public class SideMenuView : BaseTemplatedView<AbsoluteLayout>
{
  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<View> 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

XAML Usage

<StackLayout
    xct:SideMenuView.ParallaxValue="50"
    xct:SideMenuView.MenuAppearanceType="SlideIn"
    xct:SideMenuView.Position="LeftMenu"
    xct:SideMenuView.MenuWidthPercentage=".5"
    xct:SideMenuView.MainViewScaleFactor=".95"
    xct:ShadowEffect.Color="Black"
    BackgroundColor="Orange">
    <Label Text="LEFT MENU" />
</StackLayout>

C# Usage

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" }
    }
  }
@TheCodeTraveler TheCodeTraveler added new proposal A fully fleshed out proposal describing a new feature in syntactic and semantic detail labels Sep 28, 2021
@TheCodeTraveler TheCodeTraveler added this to the v1.0.0 milestone Sep 28, 2021
@TheCodeTraveler TheCodeTraveler removed this from the v1.0.0 milestone Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new proposal A fully fleshed out proposal describing a new feature in syntactic and semantic detail
Projects
None yet
Development

No branches or pull requests

1 participant