I love WPF

"jamais sans son interface"

I love WPF

"jamais sans son interface"

Set component in default namespace

If you want to use your own compenent you muste speicfy an xmlns:xxxx= » » in xaml
and use like this <xxx:myComponent …..
if you want to set your compenent on global or specific namespace
1- create a project
2– place component in this project
3– add this line in assemblyinfo.cs of this project
[assembly: XmlnsDefinition(« http://schemas.microsoft.com/winfx/2006/xaml/presentation », « UltimateCorp.Components »)]

explain
XmlnsDefinition(NameSpace to place, NameSpace to get)
NameSpace to place, is the namespace where the componenent are set
NameSPace to get, is the namespace where the compoment are initialy place

Sample
[assembly: XmlnsDefinition(« http://ultimatecorps.sytes.net », « UltimateCorp.Components »)]
[assembly: XmlnsDefinition(« http://ultimatecorps.sytes.net », « UltimateCorp.User »)]

and

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace UltimateCorp.User
{
    public class ColumnDefinitionExtended : ColumnDefinition

Using

<Grid.ColumnDefinitions>
    <ColumnDefinitionExtended Width="25*"
                                Visible="{Binding ColVisible}" />
    <ColumnDefinitionExtended Width="5"
                                Visible="{Binding ColVisible}" />
    <ColumnDefinition Width="75*" />
</Grid.ColumnDefinitions>

It is important to separate component in specific project 

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Retour en haut