hi everyone, I want the user to select an item in a combobox and when they press a button, that they will be redirected to the specific page. How can I achieve this?
<pre><Grid>
<ComboBox x:Name="Campus_Selector" HorizontalAlignment="Center" Margin="0,414,0,0" VerticalAlignment="Top" PlaceholderText="Select a Campus " Width="233">
<ComboBoxItem Content="Auckland Park" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100" />
<ComboBoxItem Content="Bloemfontein" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100"/>
<ComboBoxItem Content="Boksburg" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100"/>
<ComboBoxItem Content="Cape Town" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100"/>
<ComboBoxItem Content="Durban" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100"/>
<ComboBoxItem Content="Nelspruit" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100"/>
<ComboBoxItem Content="Polokwane" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100"/>
<ComboBoxItem Content="Port Elizabeth" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100"/>
<ComboBoxItem Content="Potchefstroom" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100"/>
<ComboBoxItem Content="Pretoria" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100"/>
<ComboBoxItem Content="Roodepoort" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100"/>
<ComboBoxItem Content="Sandton" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100"/>
<ComboBoxItem Content="Stellenbosch" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100"/>
<ComboBoxItem Content="Vereeniging" HorizontalAlignment="Center" Height="100" Margin="0,0,0,0" VerticalAlignment="Center" Width="100"/>
</ComboBox>
<Button x:Name="Navtocapus" Content="Navigate to selected Campus" HorizontalAlignment="Left" Margin="100,504,0,0" VerticalAlignment="Top" Click="Navtocapus_Click"/>
</Grid>
Note this is for UWP
What I have tried:
I tried using an if statement, and I tried all the Campus_Selector.Selected(statements) if that makes sence