【发布时间】:2015-01-03 00:30:26
【问题描述】:
HubSection Tag="2" Name="Stopwatch" x:Uid="Stopwatch" Header="STOPWATCH"
DataContext="{Binding Groups[1]}" HeaderTemplate="{ThemeResource HubSectionHeaderTemplate}">
<DataTemplate>
<Grid>
<TextBox HorizontalAlignment="Center" Margin="10,36,11,350" TextWrapping="Wrap" Text="00:00:00"
VerticalAlignment="Center" IsReadOnly="True" Width="320" Height="63" BorderThickness="0"
Foreground="White" Background="Black" TextAlignment="Center" FontSize="42" CharacterSpacing="80"
FontFamily="Segoe WP Semibold" Loaded="TextBox_Loaded"/>
</Grid>
</DataTemplate>
</HubSection>
这是 XAML 部分
stopwatch_timer.Interval = new TimeSpan(0, 0, 0, 1, 0);
stopwatch_timer.Tick += Stopwatch_Tick;
TimerDisplay.Text = Start_Count++.ToString();
我的问题是如何增加文本块的零?
因为当我运行它时,所有零都消失了,它从单个零开始递增。
【问题讨论】:
-
虽然我不确定你想在 C# 代码中做什么,但是如果你设置 TimerDisplay.Text = stopwatch_timer.Interval 呢?尝试根据需要显示 TimeSpan 值本身,以便保留时间格式。
标签: c# windows-phone-8