Ahmed Alblooshi
Ahmed Alblooshi

Reputation: 19

Making one menu for all the screens in wpf

I have been trying lately to have one constant menu for all the screens, but I couldn't find any solution for that! The only solution was to copy the menu code and paste it in every single screen with their click events code. Do you have any ideas about this?

I want one stable / constant menu in my whole project. Thanks.

Upvotes: 0

Views: 213

Answers (1)

Nikhil Vartak
Nikhil Vartak

Reputation: 5127

Approach 1: You can create a user control that wraps whole menu and its item commands. This seems more proper, flexible and straightforward approach than 2nd one below. Get started on how to create user controls in WPF.

Approach 2: Have a one main window in application with a Menu and a Frame that will host rest of the views of your application. These views will be result of the menu item command. Frame and Page are generally used in application where navigation is desired. For your case I repeat Approach 1 suits and sound logical more.

Upvotes: 2

Related Questions