本文介绍了如何禁用XAML应用麦德龙一个网格(面板)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要仿效XAML应用麦德龙模态对话框。

I want to emulate modal dialog in XAML Metro App.

所以我将设置从其中一个会伪装成除了所有控件.IsEnabled = FALSE一个模态对话框。

So I was going to set .IsEnabled = false on all controls apart from the one which will pose as a modal dialog.

显然,在电网中的面板IsEnabled不可不不FrameworkElement的。 如何禁用它不会使用户控制出来的吗?

Apparently IsEnabled not in Grid not in Panel not in FrameworkElement. How to disable it not making a user control out of it?

我想辛诺夫斯基削减这么多的角落,整个事情现在更喜欢一个埃舍尔楼梯。我失去了我的信仰。请帮助

I guess Sinofsky cut so many corners that the whole thing is now more like an Escher staircases. I am loosing my faith. Please help

推荐答案

对不起,我有点迟到了......

Sorry, I am a little late to the party...

下面是我创建了一个模式弹出 - 我用了一个弹出式对话框,其中顶部和底部是透明的,这样它后面的任何内容都会显示出来。当弹出窗口打开时,我设置其大小以覆盖整个屏幕。

Here is how I created a modal popup - I used a popup dialog where the top and bottom portions are transparent so that anything behind it will show through. When the popup is opened, I set its size to cover the entire screen.

弹出也被设定为自动调整大小(高度= *)的顶部和底部,以使它们填满屏幕的整个顶部和底部。这防止任何输入从进入电网下方。

The top and bottom portions of the popup also are set to autosize (height = *), so that they fill up the entire top and bottom of the screen. This prevents any input from going into the grid underneath.

下面是我的弹出窗口在Visual Studio中的屏幕截图:

Here is a screen shot of my popup in Visual Studio:

弹出窗口是5行,3对话框本身和2个透明的顶部和底部的网格。

The popup is a grid with 5 rows, 3 for the dialog itself and 2 for the transparent top and bottom.

下面是弹出的样子在我的应用程序。显然,网格显示通过透明顶部和底部。由于弹出填满整个屏幕,任何输入(键盘或鼠标)前进到它,而不是在网格下方,使得像模态对话框弹出行为

Here is how the popup looks in my app. Obviously the grid shows through the transparent top and bottom. Since the popup fills the entire screen, any input (keyboard or mouse) goes to it rather than the grid underneath, making the popup act like a modal dialog.

被警告说,虽然这一战略,你必须处理这些事件:

Be warned though that with this strategy, you have to handle these events:


  • 屏幕尺寸调整(全屏,厉声道,看到里面视图) - 你需要调整弹出窗口适合在每个视图状态的

  • 屏幕旋转 - 再次,你必须处理此调整

  • 键盘弹出 - 你需要弹出的上移使屏幕键盘不会干扰它。

这篇关于如何禁用XAML应用麦德龙一个网格(面板)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 17:20
查看更多