CSharp Programming
CSharp > Code Examples
Bind current time to Button
1
2
3
4
5
6
7
8
9
10
11
12
Bind current time to Button
<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">
<StackPanel Width="400">
<Button Content="{x:Static s:DateTime.Now}"
HorizontalAlignment="Center" />
</StackPanel>
</Page>