0

i have a big knot in my brain. The current Situation is the following:

in my xamarin Forems App i have on some Pages a UserControl (House) witch Contains multiple Controls (Floor) and this has also multiple Controls (Rooms) in it.

This is all working perfectly and i have coll control for each room over a HouseControler Class

On my RoomControl i have:

    <Grid.GestureRecognizers>
       <TapGestureRecognizer Command="{Binding Source={x:Reference Root}, Path=RoomTappedCommand}" />
    </Grid.GestureRecognizers>

this is totally perfekt. and i got my command perfectly fired in the Breakpoint.

But what i want to acheve is to open nut just an alert but a custom Popup with a Navigation from the current Page with the Informations of the Tapped Room. So in need do pass somehow the informations from the RoomControl up to the Page. But i dont know how.

i would love to read some tipps. Thank you Guys =)

ToolmakerSteve
  • 18,547
  • 14
  • 94
  • 196
Kevin Plaul
  • 115
  • 1
  • 1
  • 12
  • 1
    Also note that Command allows a CommandParameter that you can pass data in, such as the room information – Andrew Jun 09 '22 at 13:49
  • Does this answer your question? [Xamarin - CollectionView, pass current item as a command parameter](https://stackoverflow.com/questions/63699399/xamarin-collectionview-pass-current-item-as-a-command-parameter). `CommandParameter={Binding .}` – ToolmakerSteve Jun 09 '22 at 16:22

1 Answers1

0

you can always get a reference to the currently active page using App.Current.MainPage. To display an alert, for example

App.Current.MainPage.DisplayAlert(...);
Jason
  • 86,222
  • 15
  • 131
  • 146
  • Hi, i am totally sorry. i want to open a compleate custom PopupPage with navigation. i forgott to mention this. but an alert is a good first step – Kevin Plaul Jun 09 '22 at 12:18
  • Using `PushModalAsync`, or something else? Your question is very short on details – Jason Jun 09 '22 at 12:20