简体   繁体   中英

WinRT - Get all controls from codebehind

In certain matters I need all my controls to be set as ReadOnly.

All of my controls have ax:Name directive and its being used in order to set for each control.

Well when the Page starts to have a little more controls it becomes ineffective in my opinion to specify for each control that is readonly.

Is there a way to say in the code behind of the xmal that all controls are readonly or atleast the controls which are based on the same class.

The visual tree contains all logical elements including all visual elements of the template of each element. The visual tree is responsible for Propagate the IsEnabled property, So you can set IsEnabled property of your Page to false value and see all of child control will disabled. And not necessary to set this property for all control on the page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM