I am having problems on making it so that, when you press the “Plus” button (on the Home.xaml page), it will trigger an event that will turn a StackLayout’s (on the Cart.xaml page) visibility property into True:
(Note: I am using VS 2022, .NET MAUI)
Home.xaml:
<Button Text="+"
BackgroundColor="Green"
TextColor="White"
FontSize="Large"
HorizontalOptions="EndAndExpand"
VerticalOptions="Center"
Margin="-10,0"
Clicked="Increased1"/>
Cart.xaml:
<StackLayout Orientation="Horizontal"
IsVisible="False">
<Label Text="Fried Chicken"
HorizontalOptions="Start"
FontSize="Large"
TextColor="Black">
</Label>
<Label Text="[AMOUNT]"
HorizontalOptions="EndAndExpand"
VerticalOptions="CenterAndExpand"
FontSize="Small"
TextColor="Green">
</Label>
</StackLayout>
I have tried using Messaging Centers, but realized they were outdated.
What I’m expecting to happen: When you press the button, it will turn the visibility option of a StackLayout from False to True.
Isaiah Josh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.