Yola
Yola

Reputation: 19093

How to use Microsoft converters

I have found reach set of converters in Microsoft.TeamFoundation.Controls.WPF.Converters, but i don't know how to use them in xaml. Particularly, i don't how to include this namespace into xaml. Maybe it is only allowed to use it in code?

List of converters

I tried

xmlns:conv="clr-namespace:Microsoft.TeamFoundation.Controls.WPF.Converters;assembly=Microsoft.TeamFoundation.Controls"

and then

<conv:NullToVisibleConverter x:Key="Null2VisConv"/>

but it can't find NullToVisibleConverter in conv.

Upvotes: 0

Views: 261

Answers (2)

WinnerIT
WinnerIT

Reputation: 125

Please make sure that have these pkgs installed. You must add reference to dll in your project.

MSDN says: You can find the assemblies in the client object model in Program Files\Microsoft Visual Studio 11.0\Common7\IDE under ReferenceAssemblies\v2.0, ReferenceAssemblies\v4.5, and PrivateAssemblies.

After thar you write in your xaml for example:

xmlns:converters="namespace for converters"

you can choose namespace for converters from the list of namespace you have on your pc

Upvotes: 0

dkozl
dkozl

Reputation: 33384

First you need to target .NET 4.5, then add reference to Microsoft.TeamFoundation.Controls (should be in Assembilies -> Extensions) and then in XAML, as you did

<Window ...
        xmlns:conv="clr-namespace:Microsoft.TeamFoundation.Controls.WPF.Converters;assembly=Microsoft.TeamFoundation.Controls">
    <Window.Resources>
        <conv:NullToVisibleConverter x:Key="Null2VisConv"/>
    </Window.Resources>
    <!-- ... -->
</Window>

Upvotes: 1

Related Questions