Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Bug] SideView does not open if Bind State property in XAML #822

@acaliaro

Description

@acaliaro

Description

I am uning SideView.

If I use

        <xct:SideMenuView  x:DataType="viewmodel:InventarioViewModel"
            State="{Binding IsMenuVisible, Converter={StaticResource BoolToSideMenuViewStateConverter}}"> 

and convert the boolean IsMenuVisibile with something like this:

   public class BoolToSideMenuViewStateConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            SideMenuState sideMenuState;
            if (value != null && value is bool)
                sideMenuState = ((bool)value) ? SideMenuState.LeftMenuShown : SideMenuState.MainViewShown;
            else 
                sideMenuState = SideMenuState.MainViewShown;

            System.Diagnostics.Debug.WriteLine("SideMenuState = " + sideMenuState, "BoolToSideMenuViewStateConverter");

            return sideMenuState;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

When I change IsMenuVisible, the SideView does not appear.

If I use

<xct:SideMenuView x:Name="sidemenu" x:DataType="viewmodel:InventarioViewModel">

and in then codebehind

        if (((InventarioViewModel)BindingContext).IsMenuVisible)
            sidemenu.State = SideMenuState.LeftMenuShown;
        else
            sidemenu.State = SideMenuState.MainViewShown;

The SideView appears

Steps to Reproduce

See above

Expected Behavior

The SideView should show / hide depending by a value

Actual Behavior

Nothing happens

Basic Information

  • Version with issue: 1.0.2
  • Last known good version: unknown
  • IDE:
  • Platform Target Frameworks:
    • iOS:
    • Android: 10
    • UWP:
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Workaround

Reproduction imagery

Reproduction Link

Metadata

Metadata

Labels

a/SideMenuViewbugSomething isn't working. Breaky break.s/unverifiedThis issue needs verification/reproduction by a team member. PRs cannot be accepted/merged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions