MohamedG's Log

TW9oYW1lZCBFbC1HZWlzaA==

Overriding an Abstract Property vs. Passing a Parameter

An abstract class may require a value to be passed through the constructor like the following example: public abstract class Node { private readonly Uri _uri; protected Node(string address, string relativePath) { _uri = new Uri(Path.Combine(address, relativePath)); } } public class Element : Node { private const string relativePath = "/path"; public Element(string address) :… Read more

Changing the Foreground Color of an Indeterminate ProgressBar

You would think that the following XAML changes the indeterminate progress bar’s foreground color: <ProgressBar IsIndeterminate="True" Foreground="Aquamarine" /> Unfortunately, that doesn’t work. You will need to override the following value in the default theme resource dictionary: <ResourceDictionary.ThemeDictionaries> <ResourceDictionary x:Key="Default"> <x:String x:Key="ProgressBarIndeterminateForegroundThemeBrush">Aquamarine</x:String> </ResourceDictionary> </ResourceDictionary.ThemeDictionaries> You can add that override to App.xaml, or to a new resource… Read more

Making HTML Elements Scrollable

I’ve been styling my blog recently to make it more Win8-like (thank you for noticing!). I created some custom CSS file, but I ran into a problem with code. I use wide screens at work and at home, so I tend to break the guidelines and write more than 120 characters in a line of… Read more

Windows Store App Settings Flyout

Prerequisites Please read the following articles first: Guidelines for app settings (Windows Store apps) Quickstart: Adding app settings using Windows Runtime In this post, I’ll be walking through how to create a custom UI for settings (required for C#, C++, and VB) that satisfies the UX design requirements. UI & UX The settings window may… Read more