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. 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.
- 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{////// Interaction logic for MainWindow.xaml///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();}}}
how do i do this?
Any help would be greatly appreciated .
Cheers
V
Amit GuptaPosted Sep 1, 2017, 3:07 AM
Viren MartinsPosted Sep 1, 2017, 4:55 PM