Markiert: WPF

0

Define Enums as ItemsSource in WPF

Enumerations are often used in applications to enable the user to select an item from a list of predefined values. This can be handled in the ViewModel by publishing a list of the enum...

0

Creating a WPF Spinner Control

In this post I will show how to create a spinning progress control in WPF. This is often used to notify the user that a long-running operation is still in progress, without without knowing...

0

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 supposed to be localized should be added to the Resources.resx file located under Properties...

0

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 { return (System.ComponentModel.LicenseManager.UsageMode == System.ComponentModel.LicenseUsageMode.Designtime); } } In WPF applications the following code can be...

0

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 is bound to a SelectedFont property of the ViewModel.