这是一个最初在Silverlight中实现和设置样式的按钮.
如何在HTML/CSS中实现此按钮?请注意边框和按钮背景中的不同渐变以及边框中的圆角.边框宽度应可调节,但按钮周围尺寸均匀.
示例图片中的红色是页面背景,不是按钮的一部分.
按钮截图http://i52.tinypic.com/2vsetlw.png
更新:忘了提,我更喜欢没有图像的解决方案,即.纯CSS.Css3很好,我不需要支持IE6-8.
在我的 UWP 应用程序中,我需要从另一个线程更新 UI,我正在使用 CoreDispatcher 来执行此操作。我希望任何未处理的异常都会终止应用程序,就像 UI 线程中的异常一样,但情况似乎并非如此。下面的 RunAsync lambda 中引发的异常将被 UWP 静默忽略。此外,这些异常永远不会发送到任何应用程序 UnhandledException 处理程序(下面示例中的第二个异常是)。
到底是怎么回事?调度程序是否只是捕获所有异常并默默地忽略它们?
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
var dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
Task.Run( async () =>
{
await Task.Delay(2000);
await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
throw new Exception("This exception will not terminate the app.");
});
});
}
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
throw new NotImplementedException("This will terminate the app");
}
}
Run Code Online (Sandbox Code Playgroud)