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
1 2 3 4 5 6 7 8 9 10 11 |
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
1 2 3 4 5 6 7 |
<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
Commentaires récents