When developing Windows Phone apps I love to use the theme accent colors in my apps. Since there are some new theme colors in Windows Phone 8 I started searching for their color codes. Lucky me I found them on msdn "Theme for Windows Phone").
Now you may be thinking how to use the colors in your own Windows Phone apps. The Color object doesn't contain a color called Emerald. So I created a small class to help me out with this issue. First of all I created a small static helper method to convert the hexa colors to a color object. So we are able to put in the hexa color string and the function returns a color for us.
Then I made some properties that caches the colors for us on their first use. The Color properties looks like this.
So this is the complete class I came up with.
When you want to use it in a MVVM solution you probably want to create a SolidColorBrush to bind your control to. You could use my class like this to make a bindable property for your ViewModel.
I hope you found this article useful. Please fork my gist on Github or past the file in your own project and share it with your friends.
You have disabled cookies. To leave me a comment please allow cookies at functionality level.
The year 2012 was for me a year that went way to fast. In the year 2012 I learned a lot new stuff, wrote several blog posts and read lots of blog posts and articles. First of all I want you to give a list of all blog posts I wrote this year. You can find the complete list here http://marcofranssen.nl/2012/ and here http://marcofranssen.nl/2012/page/2/.
JavaScript
http://marcofranssen.nl/writing-modular-javascript-without-polluting-the-global-namespace/
http://marcofranssen.nl/knockout-js-mapp…
Knockout JS is a JavaScript library for creating MVVM JavaScript libraries. In a previous post I already showed some of the cool features of Knockout.
http://marcofranssen.nl/knockout-that-cascading-dropdown/
If you want to spike your knowledge on Knockout a little more first, please visit Knockout's documentation.
In this article I want to zoom in on the Knockout mapping plugin. The Knockout mapping plugin enables you to easy map your JSON object into an observable JavaScript object. So here…
Have you ever got in the situation that you downloaded a zip-file and figured out to late the files are blocked? So you extracted the zip file into a folder with existing items. It will be damn hard to figure out which files needs to be unblocked. Besides that it will cost you many work to do so by right-clicking all of the files and clicking the unblock button.
Unblock file
Luckily we have PowerShell and we can easily write a little script to execute the unblock operation on the files in a sp…
This is the fourth time I installed Windows 8. This time I installed it on my personal notebook instead of a VHD, because Windows 8 is finally ready to market. So I started with downloading the enterprise edition from my MSDN subscription. Unfortunately my USB drive died so I had no storage large enough to put the image on and boot from. So I started thinking to install it over the network. Luckily me I still had my rusty 10 year old 256MB USB drive which perfectly fits a Windows PE image. So I…