开发者

Custom Menu UserControl WPF

开发者 https://www.devze.com 2023-03-11 21:43 出处:网络
I have created a custom Menu User control in WPF Browser application. How can I achieve Navigation fro开发者_C百科m one page to other page using this Custom Menu User control from Main page. The pages

I have created a custom Menu User control in WPF Browser application. How can I achieve Navigation fro开发者_C百科m one page to other page using this Custom Menu User control from Main page. The pages would be displayed in other Frame control of the Main page.


There are different options to achieve this. Can you provide more details on how you're loading your UI? (i.e. Prism regions/modules, Data Templates, etc.)

My general suggestion would be one of two options:

  1. Use a mediator pattern to have the menu control notify the frame control. MVVM Light has an easy to use Messenger implementation, which is a great toolkit to explore, in my opinion.
  2. Have both controls contained in one "parent" control (or view model if you're using MVVM) which can then communicate to the frame control since it contains both menu and frame controls.

HTH, Ben

0

精彩评论

暂无评论...
验证码 换一张
取 消