Blog

Adding Localization to .NET WPF Applications
Here I’d like to describe some approaches how .NET applications can be localized. General In general the texts that are
Read more.
Strip BOM from a File or Text
The following code removes the BOM (Byte Order Mark) from texts. Some text editors add that while saving files. Sometimes
Read more.
Check if Code is Executed at Design Time
Sometimes it is important to prevent certain code being executed at design time. public static bool IsDesignTime { get {
Read more.
Get the Path of the Executing Assembly
public static string GetExecutingAssemblyPath() { string codeBase = Assembly.GetExecutingAssembly().CodeBase; UriBuilder uri = new UriBuilder(codeBase); string path = Uri.UnescapeDataString(uri.Path); return Path.GetDirectoryName(path);
Read more.
Showing a ComboBox with Installed Fonts
<ComboBox ItemsSource="{Binding Source={x:Static Fonts.SystemFontFamilies}}" SelectedItem="{Binding SelectedFont, UpdateSourceTrigger=PropertyChanged}" /> The ComboBox is bound to the System Fonts enumeration. The SelectedItem DependencyProperty
Read more.
Using a Comparer to Sort CultureInfos by their Name
If you need to show a list of languages, or more general CultureInfos, you might want to sort them by
Read more.
Calendar tools and algorithms
Calculating a leap year The correct calculation of a leap year was first introduced by pope Gregor in 1582. The
Read more.
Use Text Wrapping in a WPF DataGrid TextColumn
You can simply use styles to enable text wrapping in a WPF DataGrid Column. This sets the element style of
Read more.
Check Availability of a Server
This checks the availability of a server by sending a ping to the given IP address and waiting a certain
Read more.
Change string into a valid file name
Not all possible characters are suitable for file names. For example path separators cannot be used for file names. This
Read more.