Posts

Showing posts from February, 2014

Switching out the background image based on the Windows Phone theme

To pass certification you have to cater for the dark and light theme in Windows Phone. You should already be using MVVM, so this is quite an easy and a quick fix. Here is an example of how to do this on your panorama view: In the xaml for your panorama view, add a binding to the background property < phone : Panorama Title = "App Title" Background = "{Binding Path=PanoramaBackgroundImage}" Name = "MainPanorama" > Then in the viewmodel for your panorama view, add the property that you just wired up public ImageBrush PanoramaBackgroundImage { get { if (( Visibility ) Application . Current . Resources [ "PhoneDarkThemeVisibility" ] == Visibility . Visible ) { return new ImageBrush () { ImageSource = new BitmapImage ( new Uri ( "/Assets/back

SA Fuel Price for Windows Phone

Image
A major update is coming for this already, much loved app. Watch this space. In the meantime, go check out the current version on the  windows phone store Edit: Version 2 of the previously named "SA Petrol Price" has just been approved and published by the Windows Phone Store. Loads of new features and a new design. Go and get it at on the  windows phone store !

Smart usage of the DEBUG preprocessor macro in Obj-C

XCode automatically generates a preprocessor macro for debug mode, for you, i.e: DEBUG = 1 So, if you want a piece of code to only be compiled into the app when debugging, you would wrap it in a #ifdef block:. #ifdef DEBUG //<your code here> #endif And inversely, if you only wanted to compile in a piece of code for release mode, you would wrap it in a #ifndef block: #ifndef DEBUG //<your code here> #endif You could also include the #else if you wanted to switch between certain pieces of code for debug and release respectively: #ifdef DEBUG //<your code here> #else //<your code here> #endif Thus whatever block you have running now in debug mode, will only be compiled in debug mode and the other part of the block will only be compiled in release mode. What you were doing here is looking to see if a preprocessor macro has been defined or not defined, and compiling in pieces of code based on that. However, if you noticed at the top,

SA Fuel Price out on iTunes

The iOS version of SA Fuel Price has been released. With the first round of bug fixes out already. Go check it out on  iTunes