C
C#11mo ago
.tree

Make a view include itself

I have a view in Xamarin consisting of a picker and a button. Depending on the value in the picker I want to show this view again in place of the button (Grid.Row = 1). Just putting a <views:MyView> inside of MyView obviously just leads to infinite recursion and my app crashes. What is the correct way to go about this? MyView.xaml: <ContentView.Content> <Grid [...]> <controls:SinglePicker Grid.Row = 0 [...] /> <controls:XButton Grid.Row = 1 [...] /> </Grid> </ContentView.Content>
1 Reply
L. MS
L. MS11mo ago
Can you create a new instance of the same view when the button is clicked and navigate to that new instance? so add an Click="Button_Click" that will create a new instance of the view and switch to that view Should make you escape the matrix infinite recursion
Want results from more Discord servers?
Add your server