Engineering Solutions Blog

0

How to Implement a DependencyPropertyWatcher

Dependency properties are widely used in WPF controls. However there is no buid-in way to listen to changes of such properties. The following class is a generic watcher for dependecy properties: public class DependencyPropertyWatcher<T>...

0

Creating ComboBox with System Colors in XAML

This snippet shows how to display a list of system colors in XAML only. First we create ab object data source containing the list of colors: <ObjectDataProvider ObjectInstance=“{x:Type Colors}“ MethodName=“GetProperties“ x:Key=“ListOfColors“ /> This data...

0

Data Binding to Visibility Property

The following describes how to used a converter to directly bind your ViewModel properties to the Visibility of controls in your view. First we define a converter that converts a boolean value into a...

0

ViewModel Validation in MVVM

In WPF IValidatableObject, IDataErrorInfo interface implementations can be used to validate user input against validation rules. This blow shows a different approach that defines a IValidatingViewModel as interface for ViewModels that should use a...

0

Loading Files into a WPF FlowDocument

Das WPF FlowDocument ist eine einfache Möglichkeit, um Fließtext in WPF darzustellen. Hier zeige ich Methoden, um Textdateien in ein FlowDocument einzulesen. XAML: <FlowDocumentScrollViewer x:Name=“documentViewer“ /> Loading of a text file: string fileName =...

0

Using Data Annotations for Validation in WPF

The .NET Framework uses many different approaches for validation. The ASP.NET MVC for example uses Data Annotations to annotate the model classes with the definition of valid ranges, etc. In WPF on the other...

0

Prevent „Method not Allowed“ Error when using ASP.NET Web API

The error happens when the REST methods (POST, PUT, DELETE, etc). are already registered by another application. The following entries in the  web.config helped me to overcome the issue: <system.webServer> <validation validateIntegratedModeConfiguration=“false“ /> <modules...

0

Using the jQuery DatePicker in ASP.NET MVC

This post explains in detail the steps necessary to use the jQuery DatePicker with the ASP.NET MVC Framework to enter dates, instead of the standard Textbox. The description covers globalization, localization, as well as...