c# - Apply to Static Class Variable to Xaml Attribute -
how refer/use static class variable xaml attribute value?
for example; appconstants.cs
public class appconstants { public static readonly color textcolor = color.fromhex("aaaaaa"); }
homepage.xaml (the below code invalid)
.... <button textcolor="appconstants.textcolor"/> ....
what correct syntax 'reference' appconstants.textcolor
inside attribute textcolor
?
generic code:
<object property="{x:static prefix:typename.staticmembername}" .../>
specific example:
<button textcolor="{x:static appconstants.textcolor}"/>
Comments
Post a Comment