2

I am trying to make a brain exercise app, and I want to make the buttons on my home screen [of the app] to a different view. This is my apps home screen: Home Screen UI

For example if I click the "Math" button, I want the app to lead me to the MathScreen.xaml. I looked into this online, and found a few key words like MVVM. I am unable to add such things into my app because I found most instructions unclear. So does anyone know how to make the Math Button lead me to my next screen [WPF Window]? It would be better if the new window doesn't have to open in a new Window and could just stay on the same window.

Code Of My Math Button:

 <Button Margin="49,47,850,315" BorderThickness="0" Background="#933861" Cursor="Hand" Click="Math_Button_Click" x:Name="MathButton">
            <Button.Resources>
                <Style TargetType="{x:Type Border}">
                    <Setter Property="CornerRadius" Value="50"/>
                </Style>
            </Button.Resources>
            <Button.Effect>
                <DropShadowEffect BlurRadius="100" Color="#FFBF477D"/>
            </Button.Effect>
            <TextBlock HorizontalAlignment="Center" Text="MATH" Foreground="#dfa7e4" TextWrapping="Wrap" VerticalAlignment="Center" FontFamily="Trebuchet MS" Height="78" Width="195" FontSize="78"/>
        </Button>

Code for "Math_Button_Click":

        // MATH BUTTON
        private void Math_Button_Click(object sender, RoutedEventArgs e)
        {

        }

[Just empty]

Prabhdeep Singh
  • 176
  • 1
  • 16
  • 1
    Looks like your brain exercise app itself is the true exercise. You can take a look at this solutions: [How do I toggle between pages in a WPF application?](https://stackoverflow.com/a/58849975/3141792), [C# WPF Page Navigation Class](https://stackoverflow.com/a/61323201/3141792). – BionicCode Aug 21 '21 at 08:03
  • 1
    I found that this video series explains well the way to navigate between different views respecting the MVVM patern [link](https://www.youtube.com/watch?v=N26C_Cq-gAY) – Bruno Aug 30 '21 at 20:13

0 Answers0