开发者

Getting the value of string variable

开发者 https://www.devze.com 2023-01-14 11:22 出处:网络
How can the string literal - \"ErrorLabel\" be replaced with string variable style in the second 开发者_JAVA技巧line ? FYI ..The style names will be stored in a xml file.

How can the string literal - "ErrorLabel" be replaced with string variable style in the second 开发者_JAVA技巧line ? FYI ..The style names will be stored in a xml file.

 string style = "ErrorLabel";
 Style styItem = LayoutRoot.Resources["ErrorLabel"] as Style;
 fld.Settings.CellValuePresenterStyle = styItem;


This should do it:

string style = "ErrorLabel";
Style styItem = LayoutRoot.Resources[style] as Style;
fld.Settings.CellValuePresenterStyle = styItem;
0

精彩评论

暂无评论...
验证码 换一张
取 消