Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
Navigate pages in a frame when clicking on menu items
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Viren Martins
7y
206
1
Reply
Hi Guys,
I am new to WPF and having trouble with the basics of menuitems and frames.
I have a main window where i have created menu items and a frame. what i am trying to do is on clicking any menu item i want the corresponding page to load up in the frame. I have called the frame "Main"
one of my menu items is task updates and i have created a click event "Taskupdates". is this correct?
<
MenuItem
Header
=
"TASK UPDATES"
Click
=
"taskupdates"
/>
The mainwindow xaml.cs has the code below.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace LES
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Application.Current.MainWindow.WindowState = WindowState.Maximized;
}
private void taskupdates(object sender, RoutedEventArgs e)
{
Main.Content = new CFM_Task_Updates();
}
}
}
What i am trying to do is on clicking task updates , i want the CFM _Task_updates.xaml page to load in the frame called "main" in my main window.
how do i do this?
Any help would be greatly appreciated .
Cheers
V
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Find duplicate Rows and highlights in WPF
Creating an animated line using WPF