Recent Posts

0
Comments

Sticky notes add-in for Visual Studio by marianor

My coworker Pablo has released a nice Visual Studio add-in called Sticky Notes . Basically this add-in allows to write sticky notes in your code , that can be private notes or team notes.
Filed under:
2
Comments

Easy way to compare two XMLs for equality by marianor

The first thing to do is normalize to two XMLs, for this you can use a small method using Linq:   private static XElement Normalize( XElement element) {     if (element.HasElements)     {        ...
Filed under: ,
0
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:
6
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:
11
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...
Filed under:
6
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:
1
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:
17
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 most scenarios. Enjoy it ! The control and the sample are...
Filed under:
More Posts « Previous page - Next page »