你好,
>>”利用timer来实现textblock显示N秒后消失”
在Winrt中,如果你需要跟UI进行交互的话,你可以使用DispatcherTimer来实现这个功能,具体信息可以参考微软官方文档:https://msdn.microsoft.com/zh-cn/library/windows/apps/windows.ui.xaml.dispatchertimer
这里我做了个sample,供你参考:
DispatcherTimer timer;
int count = 0;
string str = "Holding item to delete.";
public MainPage()
{
this.InitializeComponent();
}
private void TextBlock_PointerEntered(object sender, PointerRoutedEventArgs e)
{
(sender as TextBlock).Foreground = new SolidColorBrush(Colors.Yellow);
timer = new DispatcherTimer();
timer.Tick += timer_Tick;
timer.Interval = new TimeSpan(0,0,1);
count = 10;
timer.Start();
}
void timer_Tick(object sender, object e)
{
if (count == 0)
{
timer.Stop();
warning.Visibility = Visibility.Collapsed;
}
else
{
warning.Visibility = Visibility.Visible;
warning.Text = str + count;
count--;
}
}

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.