如何将UIelements设为只读 [英] How to Make the UIelements Readonly
问题描述
我需要在Mainwindow顶部显示诸如popup 之类的userconrol,...同时显示我正在破坏所有UI元素,如
I have a requirement to display the userconrol like popup on top of Mainwindow,...while displaying i am disabuling the all UI elements like
foreach(UIElementitem inmodalGrid.Children)
foreach (UIElementitem inmodalGrid.Children)
item.IsEnabled = false;
modalGrid.Children.Add(uc);
item.IsEnabled = false;
modalGrid.Children.Add(uc);
代码工作正常,但是问题是我也要在散布后显示所有UIelements看起来也很正常.它不应该更改颜色(它应该看起来像Readonly)
Code is working fine,but the problem is i want to display all the UIelements looks like normal after disabuling also.it should not change the color(it should looks Like Readonly )
请让我知道是否可以在WPF中更改消失的UIElement的颜色?
Please let me know is it posibule to change the color for disabuled UIElements in WPF ?
推荐答案
在您的MainWindow中,只需设置IsEnabled = "False",这将禁用与Window内容的所有交互.
In your MainWindow, just set the IsEnabled="False", this will disable all interaction with the content of the Window.
这篇关于如何将UIelements设为只读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!