Windows 8 metro app button behavior of foreground and background color -
in windows 8 metro apps added button using xaml follows
<button foreground="#fff51a1a" background="#ffeae23a" borderbrush="white" height="100" width="100" horizontalalignment="center" content="hello"/>
and same button tried add together dynamically below
button shelfbutton = new button(); shelfbutton.content = "hello"; shelfbutton.foreground = fff51a1a; shelfbutton.background = ffeae23a; shelfbutton.height = 100; shelfbutton.width = 100; grid.children.add(shelfbutton);
the behavior of buttons in regard foreground , background colors different. why ? , how have similar behavior xaml when adding buttons dynamically.
to equivalent behavior, can set foreground , background of shelfbutton solidcolorbrush in code. there hex ("#fff51a1a") solidcolorbrush converter @ http://social.msdn.microsoft.com/forums/en-us/winappswithcsharp/thread/befe7695-9458-4abb-b867-619df52b8183.
button windows-8
No comments:
Post a Comment