使用页面导航的WPF应用程序中的功能区控制 [英] Ribbon control in a WPF Application using page navigation

查看:106
本文介绍了使用页面导航的WPF应用程序中的功能区控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!


我对功能区控制和利用页面的wpf应用程序有疑问.

我对该应用程序的最初设计是利用框架中的页面来控制内容.我希望使用功能区来处理按钮功能,但不确定如何将页面中的值绑定到包含功能区控件的父窗口.

任何建议或与有用材料的链接将不胜感激.


谢谢!

-Ethan

Hey everyone!


I have a question regarding ribbon control and a wpf application that utilizes pages.

My initial design of this application was to utilizes pages within a frame to control content. I was hoping to use a ribbon to handle button functionality but am not sure how to bind values from the page to the parent window which contains the ribbon control.

Any advice or links to helpful material would be appreciated.


Thanks!

-Ethan

推荐答案

只要页面的DataContext相同,就不必担心.我可能要做的是将页面的特定数据上下文(ViewModel)设为Frame的属性,并且所有这些都继承自一个接口,该接口将使按钮ICommand方法可以访问页面的特定方法ViewModel来执行问题.实际上,您可以创建一个IValueConverter,该IValueConverter将根据用于页面的DataContext的属性的类来指定框架的页面视图.我希望我能在互联网上找到一些例子来向您展示如何做到这一点.猜猜我将为此创建一个提示.
As long as the DataContext for the page is the same, you do not have to worry about it. What I might do is have the specific datacontext (ViewModel) for page be a property on Frame, and all inherit from an interface that will let the buttons ICommand methods access the specific methods for the page ViewModel to perform the issues. You can actually create a IValueConverter that will specify the Page View for the Frame depending on the class of the property used for the DataContext of the Page. I wish I could find some example on the internet to show you how to do it. Guess I will have to create a tip on this.


这篇关于使用页面导航的WPF应用程序中的功能区控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆