Answer the question
In order to leave comments, you need to log in
How to get constants from another class for elements in DataTemplate?
Here is the DataTemplate code:
<DataTemplate DataType="{x:Type local:Interface}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{x:Static cnst:Constants+Navigation+Width}"/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ContentControl Grid.Column="0" Background="Red" Content="{Binding Spaces.Navigation}"/>
</Grid>
</DataTemplate>
public class Constants
{
public class Navigation
{
public const int Width = 20;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question