2012-02-22

Articles

DW.SharpTools

 

DW.SharpTools

This library contains many object you need for all your C# applications for example a ServiceLocator, an ObservableObject which is the ideal base class for MVVM objects, or a generic Mediator.

With this library you can create your applications in a much easier way.


 

alt ControlFocus
 

This object helps you for change the focus to an control.


alt DelegateCommand[<T>]
 

The DelegateCommand is an implementation of the ICommand with the possibility to define which method will be called on execution of the ICommand. This is one of the most useful classes in MVVM environments. Such an object sometimes will be called RelayCommand.


alt EnhancedObservableCollection
 

This is an enhancement of the ObservableCollecton. It brings additional behaviors like the AddRange, RemoveAll, Sort and you also can get a command if one of the inner elements sends the property changed.


alt EventArgs<T [,T]>
 

Every application uses custom events, and in the most cases any kind of parameter has to pass with. To do this a new object derived from the EventArgs have to create. This is a generic representation of such an EventArgs, you can pass any kind of parameter with it.


alt Localizer
 

The localizer helps you manage your localized application. You can just switch the language or replace the resource by the culture.


alt Mediator
 

This mediator is a generic implementation of the Mediator pattern, you can send and receive any messages and pass an object with it. You also can send and receive an object directly.


alt NamedFormat
 

Strings with C# placeholders inside are hard to translate, the translator doesn't know what can be placed in and the grammar can go wrong. Therefore you should use named placeholder like "[APPLICATION_NAME]". With this object you easily can work with such placeholders.


alt ObservableDictionary
 

Represents a collection of keys and values that provides notifications when items get added, removed, or when the whole list is refreshed


alt ObservableObject
 

The ObservableObject is the ideal base class for ViewModel objects, it just implements the INotifyPropertyChanged and provides a good method for sending the property change.


alt PathCalculator
 

As soon you need the length of a path you can use this object. It can calculate the length of any path no matter of the shape.


alt PopupHandler
 

The PopupHandler helps you closing a popup control. It will be closed as soon the user clicks somewhere else, resize or move the window.


alt ServiceLocator
 

In the ServiceLocator, sometimes called ServiceProvider, services for interacting with the users or working with files can be registered. With this it is possible to create a clean MVVM environment and unit tests with faking user inputs. If you work with MVVM, you need such a ServiceProvier.


alt Translation
 

In XAML files you can dynamic load string by using the DynamicResource. This doesn't exist in C#, therefore you need your own method for loading a string by the key. This object helps you doing this.


alt VisualTreeAssist
 

This object brings you a better access to controls inside the visual tree. You can navigate up and down and and seach for controls.


alt WindowGlassActivator
 

Window glass, called Aero glass, is available since Windows Vista, with the WindowGlassActivator you can enable it.


alt WindowObserver
 

If you need the WinAPI events like the resize, click in the title bar or moving the window you can use this observer object. Just let observe a window and catch the incoming events.


alt Xml.AttributeParser
 

The AttributeParser reads an attribute from a given XElement by the name and returns the value converted like requested.


alt Xml.DescendantsParser
 

The DescendantsParser reads all descendant elements from a given XElement by the name and returns the value converted like requested.


alt Xml.ElementsParser
 

The ElementsParser reads all child elements from a given XElement by the name and returns the value converted like requested.


alt Xml.ParserSettings
 

This object holds the settings used for converting values by the parser objects.


alt Xml.Serializer
 

The serializer provides fast methods for serialize or deserialize a stored XML file to and from an object.