在microsoft Surface平台上使用WPF扩展器控件 [英] Using WPF expander control on microsoft surface platform

查看:31
本文介绍了在microsoft Surface平台上使用WPF扩展器控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在表面应用程序中使用 Expander 控件.我已经看到它不是表面控件,因此应用程序编译和控件显示但联系人不起作用.

I am trying to use the Expander control in the surface application. I have seen its not a surface control so application compiles and control shows up but the contacts are not working.

无论如何我可以修改接触事件并使其在表面应用程序中工作.

Is there anyway I can modify the contact events and make it work in surface applications.

推荐答案

为此,您只需更改 Expander 的模板以使用 Surface 控件而不是常规控件.

To do that, all you have to do is change the Expander's template to use Surface controls instead of the regular controls.

Expander 的默认模板可以在 http://msdn.microsoft.com/en-us/library/ms753296.aspx.

The Expander's default template can be found at http://msdn.microsoft.com/en-us/library/ms753296.aspx.

您需要更改的只是 ToggleButton:

All you need to change is the ToggleButton:

<ToggleButton OverridesDefaultStyle="True"
              Template="{StaticResource ExpanderToggleButton}"
              IsChecked="{Binding IsExpanded, Mode=TwoWay, 
              RelativeSource={RelativeSource TemplatedParent}}">

更改为

<s:SurfaceToggleButton OverridesDefaultStyle="True"
                       Template="{StaticResource ExpanderToggleButton}"
                       IsChecked="{Binding IsExpanded, Mode=TwoWay, 
                       RelativeSource={RelativeSource TemplatedParent}}">

(省略结束标记)

这假设 s 绑定到 Surface XML 命名空间:

This assumes s is bound to the Surface XML Namespace:

xmlns:s="http://schemas.microsoft.com/surface/2008"

这篇关于在microsoft Surface平台上使用WPF扩展器控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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