Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Button click not firing with Nested Views

$
0
0

So the issue that I am having is I have ContentView nested in a ContentPage. The ContentView has a click event associated in the codebehind. (c#). But it does not fire. I'm thinking it's due to the fact that the click event doesn't actually reach the button.

Here is my xaml

<ContentPage.Content>
        <StackLayout>

            <views:NavBarView/>

            <StackLayout>
            <ScrollView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                    <!--<Button Text="Download Course" Clicked="DownloadClicked"/>-->
                    <!--<Button Text="Load Catalogue" Clicked="LoadCourses"/>-->
                   <StackLayout>
                <Label Text="{Binding Title}" StyleClass="pageTitle,fontColor"></Label>
                <StackLayout x:Name="Cat"></StackLayout>
                        <StackLayout x:Name="LP"></StackLayout>
                        <ActivityIndicator x:Name="CatalogueProgress" IsVisible="False" HeightRequest="20"/>
                    </StackLayout>            
        </ScrollView>
            </StackLayout>
        </StackLayout>
    </ContentPage.Content>

Here is the xaml for NavBarView

<ContentView.Content>
        <AbsoluteLayout>
        <StackLayout Style="{StaticResource headerContainer}" BackgroundColor="{Binding Source={x:Static constants:Constants.HeaderColour}}">
            <Grid HorizontalOptions="FillAndExpand" RowSpacing="0" ColumnSpacing="0" BackgroundColor="{Binding Source={x:Static constants:Constants.HeaderColour}}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="48"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="48"/>
                </Grid.RowDefinitions>
                <ImageButton Clicked="OpenMenu" Pressed="OpenMenu" x:Name="burger" Grid.Row="0" Grid.Column="0" Source="round_menu_white_48.png" HorizontalOptions="FillAndExpand"/>
                <ffimageloading:CachedImage Grid.Row="0" Grid.Column="1" Style="{StaticResource headerImage}" Source="{Binding Source={x:Static constants:Constants.Logo}}"></ffimageloading:CachedImage>
            </Grid>
        </StackLayout>
        </AbsoluteLayout>
    </ContentView.Content>

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>