DateTemplate for Date Time, filter value by path : DataTemplate « Windows Presentation Foundation « C# / CSharp Tutorial






<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:DateTime}">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="DateTime: " />
                <TextBlock Text="{Binding Path=Month}" />
                <TextBlock Text="/" />
                <TextBlock Text="{Binding Path=Day}" />
                <TextBlock Text="/" />
                <TextBlock Text="{Binding Path=Year}" />
            </StackPanel>
        </DataTemplate>

    </Page.Resources>

    <StackPanel>
        <Button>
            <x:Static Member="s:DateTime.Now" />
        </Button>

    </StackPanel>
</Page>
WPF Date Template For Date Time Filter Value By Path








24.141.DataTemplate
24.141.1.DataTemplate for Int32DataTemplate for Int32
24.141.2.DateTemplate for Date Time, filter value by pathDateTemplate for Date Time, filter value by path
24.141.3.DateTemplate for StringDateTemplate for String
24.141.4.Use Data Templates to Display Bound DataUse Data Templates to Display Bound Data
24.141.5.Use DataTemplate, DataTrigger, and DataTemplateSelector to specify the presentation of your dataUse DataTemplate, DataTrigger, and DataTemplateSelector to specify the presentation of your data
24.141.6.Defines the contents of column headers and cells by using templates.Defines the contents of column headers and cells by using templates.