Em có dòng code WPF XAML thế này (phần behind-code em để code mặc định):
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="Mega Program" Height="570" Width="570" Icon="{DynamicResource ImageSource1}"
Name="wnd">
<Window.Background>
<LinearGradientBrush>
<GradientStop Offset="0" Color="White"/>
<GradientStop Offset="1" Color="#FFCF682D"/>
</LinearGradientBrush>
</Window.Background>
<Window.Resources>
<BitmapImage x:Key="ImageSource1" CreateOptions="IgnoreImageCache" CacheOption="OnLoad" UriSource="C:\Users\Administrator\documents\visual studio 2017\Projects\WpfApp1\WpfApp1\Mega.png"/>
</Window.Resources>
<StackPanel Margin="10">
<TextBlock Text="{Binding Source={x:Static system:DateTime.Now}, ConverterCulture='de-DE', StringFormat=German date: {0:D}}" />
<TextBlock Text="{Binding Source={x:Static system:DateTime.Now}, ConverterCulture='en-US', StringFormat=American date: {0:D}}" />
<TextBlock Text="{Binding Source={x:Static system:DateTime.Now}, ConverterCulture='ja-JP', StringFormat=Japanese date: {0:D}}" />
</StackPanel>
</Window>
Em không hiểu sao mà nó cứ dính lỗi: WPF không hỗ trợ DateTime (DateTime is not supported in a Windows Presentation Foundation (WPF) project)
Mấy bác có thể giải đáp giúp em với ạ. Em cảm ơn.