robinmanuelthiel / flexbutton

Flexible button control for Xamarin.Forms
MIT License
240 stars 34 forks source link

Click event is called repeatedly when using flexbutton inside a TitleView #92

Closed fun-works closed 3 years ago

fun-works commented 4 years ago

Describe the bug Click event is called repeatedly when using flexbutton inside a TitleView

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

Page XAML:

...
    <NavigationPage.TitleView>
        <StackLayout Orientation="Horizontal" 
                     Spacing="0" 
                     VerticalOptions="Fill" 
                     HorizontalOptions="FillAndExpand" BackgroundColor="{DynamicResource ColorBackgroundButtonMenu}">

            <flex:FlexButton 
                    Icon="alarm.png"
                    Clicked="Alarm_Clicked"
                    >
            </flex:FlexButton>

...

Button Click event:

 private void Alarm_Clicked(object sender, EventArgs e)
        {
            Navigation.PushAsync(new Schedule(schedules));
        }

Please complete the following information:

robinmanuelthiel commented 3 years ago

I gave it a try and can't reproduce the issue. When counting up a number, the counter only gets increased by one for me, even when putting the FlexButton into a NavigationPage.TitleView. Can you share a sample project?