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?

try x:static markup extension

generic code:

<object property="{x:static prefix:typename.staticmembername}" .../> 

specific example:

<button textcolor="{x:static appconstants.textcolor}"/> 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -