c# - Windows Phone 8.1 SolidColorBrush and Trigger -
i'm using vs2013 creating windows phone 8.1 app, want change color property of controls cs files, , have encountered 2 problems:
1.i create <application.resources> in app.xaml, never find <style.triggers> instructions online says(is taken out recently?
2.i want change foreground color of particular button in .cs file, , used button_1.foreground = new solidcolorbrush(colors.red), compiler reports error saying "the name 'colors' not exist in current context", tried rgb , #ffffffff , on, nothing works.
screenshot of second problem:

you need use qualified name of colors, this.
button_1.foreground = new solidcolorbrush(windows.ui.colors.red); or add using directive top of code window.
using windows.ui; see using directives on msdn
Comments
Post a Comment