如果连接了触摸屏,则整个解决方案的替代滚动条样式 [英] Alternative Scrollbar Style for whole Solution if Touch-Screen attached

查看:81
本文介绍了如果连接了触摸屏,则整个解决方案的替代滚动条样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我在连接触控显示器时需要替代Scrollbar样式(然后滚动条更大)。



我检查后面的代码是否附有任何触摸:



Hello,

I Need an alternative Scrollbar Style for my whole Application when Touch Displays are attached (then the scrollbar is larger).

I check if there is any touch attached in code behind:

[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
static extern int GetSystemMetrics(int nIndex);

const int SM_MAXIMUMTOUCHES = 95;

static readonly bool isTouchAttached = GetSystemMetrics(SM_MAXIMUMTOUCHES) 

然后我计划使用Inherits在我的滚动条样式中创建一个附属属性,但由于可能存在性能问题,我不允许这样做。



我们的解决方案中有一个Scrollbar Style,它出现在MergedDictionary的XAML中,用于我们所有的控件,没有代码。



Any想法如何使用第二种替代风格的普通滚动条样式和切换某种方式使用那个?



是否有任何最佳做法或类似于这样的案例?



非常感谢!



Eric

Then I planned to create an attachedproperty in my scrollbarbar style with Inherits but I am not allowed to because of possible Performance issues.

We got a Scrollbar Style in our solution which is appearing in a XAML in a MergedDictionary for all our controls without a code behind.

Any idea how I can use a 2nd aternative style for the General scrollbar style and Switch somehow for using that one?

Are there any best practices or something for a case like this?

Thanks a lot!

Eric

推荐答案

如果有附加的tocuh设备或者有没有办法使用我的解决方案但没有继承的话,有没有办法切换滚动条样式operty?



或者有人可以告诉我,我的解决方案是否会导致性能问题以及如何找到它们?



非常感谢!



Eric
Is there any way to Switch the scrollbar style if there are tocuh devices attached or is there any way to use my solution but without "Inherits" for the property?

Or can anybody tell me if my solution causes Performance Problems or not and how to find those?

Thanks a lot!

Eric


这篇关于如果连接了触摸屏,则整个解决方案的替代滚动条样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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