DispatcherUnhandledException イベントが発生したときに App.xaml.cs でカーソルをリセットすることは可能ですか (可能であればどのように可能ですか)。
不測の事態が起こった後の片付け。
マウス カーソルを意味し、アプリのクラッシュを防止したいとします。
App.xaml
<Application x:Class="WpfApplication1.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml"
DispatcherUnhandledException="Application_DispatcherUnhandledException">
<Application.Resources>
</Application.Resources>
</Application>
App.xaml.cs
private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
// resets the cursor
Mouse.OverrideCursor = null;
// prevents the app from crashing
e.Handled = true;
}