Hello,
Welcome to Microsoft Q&A!
Do not change the binding context. We could use source to complete the binding:
<TimePicker IsVisible="{Binding IsToggled, Source={x:Reference HorarioSwitch}}"
VerticalOptions="Center"
Format="HH:mm"
Time="{Binding BindingContext.HoraInicio, Source={x:Reference RootLayout}}"/>
So does another time picker:
<TimePicker IsVisible="{Binding IsToggled, Source={x:Reference HorarioSwitch}}"
VerticalOptions="Center"
Format="HH:mm"
Time="{Binding BindingContext.HoraFim, Source={x:Reference RootLayout}}"/>
RootLayout
here is your StackLayout
:
Name it as you want.
Thank you.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.