WPF loading page into frame but missing button?

Waller, Reece (Student) 1 Reputation point
2020-08-06T17:47:07.35+00:00

Hi everyone,

I'm creating a very basic application that lets you flick between pages using buttons. It starts off by loading each page onto a frame, however it only seems to be loading the image and not the buttons?

Here is my MainWindow.xaml.cs that controls the frame:

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        Loaded += MyWindow_Loaded;
    }

    public void MyWindow_Loaded(object sender, RoutedEventArgs e)
    {
        FrameElement.NavigationService.Navigate(new Home());


    }

}

After that, it navigates you to a page called "Home" and displays two buttons. The buttons appear in the preview for the page but not when I click Run. Any advice?

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,783 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.