-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathApp.xaml.cs
68 lines (51 loc) · 1.95 KB
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Windows;
using System.Text;
using System.Collections.ObjectModel;
namespace eflayMH_WPF
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
public static Window1 windows11;
//private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
//{
// StringBuilder stringBuilder = new StringBuilder();
// stringBuilder.AppendFormat("应用程序出现了未捕获的异常,{0}\n", e.Exception.Message);
// if (e.Exception.InnerException != null)
// {
// stringBuilder.AppendFormat("\n {0}", e.Exception.InnerException.Message);
// }
// stringBuilder.AppendFormat("\n {0}", e.Exception.StackTrace);
// MessageBox.Show(stringBuilder.ToString());
// e.Handled = true;
//}
protected override void OnStartup(StartupEventArgs e){
//let the base class have a crack
base.OnStartup(e);
//
// windows11 = new Window1();
// windows11.Show();
}
public void ApplySkin(Uri skinDictionaryUri)
{
// Load the ResourceDictionary into memory.
ResourceDictionary skinDict = Application.LoadComponent(skinDictionaryUri) as ResourceDictionary;
Collection<ResourceDictionary> mergedDicts = base.Resources.MergedDictionaries;
// Remove the existing skin dictionary, if one exists.
// NOTE: In a real application, this logic might need
// to be more complex, because there might be dictionaries
// which should not be removed.
if (mergedDicts.Count > 0)
mergedDicts.Clear();
// Apply the selected skin so that all elements in the
// application will honor the new look and feel.
mergedDicts.Add(skinDict);
}
}
}