Recent Posts

2
Comments

Formating in WPF binding by marianor

Some time ago I wrote a post about how to format fields in a binding expression. It included the use of an IValueConverter to apply the format, now with .NET framework 3.5 SP1 that is not necessary anymore, because it  provides a new parameter in...
Filed under:
3
Comments

Simulating command line parameters in Click Once applications by marianor

The impossibility of send command line arguments to an application in a standard way is one disappointed thing about ClickOnce. However we can send query string arguments in order to simulate command line arguments. First, we will need to enable the application...
Filed under:
4
Comments

Multiselect ListView with checkboxes in WPF by marianor

The main idea to accomplish this is replace the item template in the ListView and the default behavior in the item selection. The first thing we need is generate an item template containing the checkbox an the text we want to show it. The template is...
Filed under:
0
Comments

Generic expression IComparer by marianor

This provides a generic IComparer using Linq expressions, the aim of the ExpressionComparer<T> is allow you sort collections or arrays of classes through its properties. The constructor of the expression comparer receives a: params Func <T, IComparable...
Filed under:
2
Comments

Sorting a ListView Data Source in WPF by marianor

When you bind a collection to a selector control (Like a ListBox or ListView), internally, WPF creates a CollectionViewSource and a CollectionWiew, so you can sort an filter the data easily inside the control. The first that you need to do is define two...
3
Comments

Get Active Directory entry from SID by marianor

In order to get the DirectoryEntry we need create an NTAccount object with the domain user account we can get and traslate it to a SecurityIdentifier:     NTAccount account =         new NTAccount ( @"<Domain...
Filed under:
0
Comments

Synchronizing control properties with the parent control properties in WPF by marianor

Sometimes you need synchronize the properties of a control with the properties of the parent control, in order to accomplish this you can use a binding by element name. In the example below you can see how to make the size of a control equal to its parent...
Filed under:
4
Comments

A WPF wrapper around Windows Form NotifyIcon by marianor

Because WPF do not have a Notify Icon control, I decided implement a WPF control that wraps the Windows Form control. It only covers the basic functionality, but I believe that it is enough for mostly scenarios. Enjoy it ! The control and the sample are...
Filed under:
2
Comments

Unhandled exceptions in children threads by marianor

When an exception is thrown in a thread that is not the main thread, it can be catch with the event UnhandledException of the AppDomain class. However attaching this event can not avoid the application to crash. There are two ways to workaround this issue...
Filed under:
0
Comments

Publish a ClickOnce deploy with Visual Studio and assemblies not referenced by marianor

When you build a ClickOnce deploy Visual Studio do not get assemblies not referenced in the project or any other dependent project. Basically the problem are assemblies located in other folders than the project folder. But you can workaround this issue...
Filed under:
More Posts Next page »