DataTemplate for Int32 : DataTemplate « Windows Presentation Foundation « C# / C Sharp






DataTemplate for Int32

DataTemplate for Int32
  
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:s="clr-namespace:System;assembly=mscorlib">
    <Page.Resources>

        <DataTemplate DataType="{x:Type s:Int32}">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Integer: " />
                <TextBlock Text="{Binding}" />
            </StackPanel>
        </DataTemplate>

    </Page.Resources>

    <StackPanel>
        <Button>
            <s:Int32>1</s:Int32>
        </Button>

    </StackPanel>
</Page>

   
    
  








Related examples in the same category

1.DateTemplate for Date Time, filter value by pathDateTemplate for Date Time, filter value by path
2.DateTemplate for StringDateTemplate for String
3.Use Data Templates to Display Bound Data
4.Use DataTemplate, DataTrigger, and DataTemplateSelector to specify the presentation of your dataUse DataTemplate, DataTrigger, and DataTemplateSelector to specify the presentation of your data
5.Defines the contents of column headers and cells by using templates.Defines the contents of column headers and cells by using templates.