我可以在每x秒后运行代码,但有没有办法只在x秒后运行一次代码?例如:我想在用户点击按钮后1秒后刷新一次列表视图?
我正在创建自定义加载消息,我想将背景设置为仅半透明.我遇到的问题是整个stackpanel被设置为半透明,包括背景和前景.如何才能使背景半透明并使前景保持原样?下面是我的xaml代码.
<StackPanel Grid.Row="0" x:Name="spLoading" HorizontalAlignment="Center" VerticalAlignment="Center" Background="Transparent">
<Border Margin="5" Padding="5" BorderThickness="1" BorderBrush="Black" Background="Black" Opacity=".1" CornerRadius="10">
<TextBlock x:Name="txtLoading" Foreground="White" Text="loading . . ." HorizontalAlignment="Center" TextAlignment="Center" FontSize="30" FontWeight="Bold" Padding="5" />
</Border>
</StackPanel>
Run Code Online (Sandbox Code Playgroud)