FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ScriptText/ScriptText/ScriptText/ScriptText/App.xaml.cs at master · jan-patrick/ScriptText · GitHub
jan-patrick
/
ScriptText
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
4
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
ScriptText
/
ScriptText
/
ScriptText
/
ScriptText
/
App.xaml.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
100 lines (91 loc) · 4.06 KB
Breadcrumbs
ScriptText
/
ScriptText
/
ScriptText
/
ScriptText
/
App.xaml.cs
Copy path
File metadata and controls
100 lines (91 loc) · 4.06 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
using
System
;
using
System
.
Collections
.
Generic
;
using
System
.
IO
;
using
System
.
Linq
;
using
System
.
Runtime
.
InteropServices
.
WindowsRuntime
;
using
Windows
.
ApplicationModel
;
using
Windows
.
ApplicationModel
.
Activation
;
using
Windows
.
Foundation
;
using
Windows
.
Foundation
.
Collections
;
using
Windows
.
UI
.
Xaml
;
using
Windows
.
UI
.
Xaml
.
Controls
;
using
Windows
.
UI
.
Xaml
.
Controls
.
Primitives
;
using
Windows
.
UI
.
Xaml
.
Data
;
using
Windows
.
UI
.
Xaml
.
Input
;
using
Windows
.
UI
.
Xaml
.
Media
;
using
Windows
.
UI
.
Xaml
.
Navigation
;
namespace
ScriptText
{
/// <summary>
/// Stellt das anwendungsspezifische Verhalten bereit, um die Standardanwendungsklasse zu ergänzen.
/// </summary>
sealed
partial
class
App
:
Application
{
/// <summary>
/// Initialisiert das Singletonanwendungsobjekt. Dies ist die erste Zeile von erstelltem Code
/// und daher das logische Äquivalent von main() bzw. WinMain().
/// </summary>
public
App
(
)
{
this
.
InitializeComponent
(
)
;
this
.
Suspending
+=
OnSuspending
;
}
/// <summary>
/// Wird aufgerufen, wenn die Anwendung durch den Endbenutzer normal gestartet wird. Weitere Einstiegspunkte
/// werden z. B. verwendet, wenn die Anwendung gestartet wird, um eine bestimmte Datei zu öffnen.
/// </summary>
/// <param name="e">Details über Startanforderung und -prozess.</param>
protected
override
void
OnLaunched
(
LaunchActivatedEventArgs
e
)
{
Frame
rootFrame
=
Window
.
Current
.
Content
as
Frame
;
// App-Initialisierung nicht wiederholen, wenn das Fenster bereits Inhalte enthält.
// Nur sicherstellen, dass das Fenster aktiv ist.
if
(
rootFrame
==
null
)
{
// Frame erstellen, der als Navigationskontext fungiert und zum Parameter der ersten Seite navigieren
rootFrame
=
new
Frame
(
)
;
rootFrame
.
NavigationFailed
+=
OnNavigationFailed
;
if
(
e
.
PreviousExecutionState
==
ApplicationExecutionState
.
Terminated
)
{
//TODO: Zustand von zuvor angehaltener Anwendung laden
}
// Den Frame im aktuellen Fenster platzieren
Window
.
Current
.
Content
=
rootFrame
;
}
if
(
e
.
PrelaunchActivated
==
false
)
{
if
(
rootFrame
.
Content
==
null
)
{
// Wenn der Navigationsstapel nicht wiederhergestellt wird, zur ersten Seite navigieren
// und die neue Seite konfigurieren, indem die erforderlichen Informationen als Navigationsparameter
// übergeben werden
rootFrame
.
Navigate
(
typeof
(
MainPage
)
,
e
.
Arguments
)
;
}
// Sicherstellen, dass das aktuelle Fenster aktiv ist
Window
.
Current
.
Activate
(
)
;
}
}
/// <summary>
/// Wird aufgerufen, wenn die Navigation auf eine bestimmte Seite fehlschlägt
/// </summary>
/// <param name="sender">Der Rahmen, bei dem die Navigation fehlgeschlagen ist</param>
/// <param name="e">Details über den Navigationsfehler</param>
void
OnNavigationFailed
(
object
sender
,
NavigationFailedEventArgs
e
)
{
throw
new
Exception
(
"Failed to load Page "
+
e
.
SourcePageType
.
FullName
)
;
}
/// <summary>
/// Wird aufgerufen, wenn die Ausführung der Anwendung angehalten wird. Der Anwendungszustand wird gespeichert,
/// ohne zu wissen, ob die Anwendung beendet oder fortgesetzt wird und die Speicherinhalte dabei
/// unbeschädigt bleiben.
/// </summary>
/// <param name="sender">Die Quelle der Anhalteanforderung.</param>
/// <param name="e">Details zur Anhalteanforderung.</param>
private
void
OnSuspending
(
object
sender
,
SuspendingEventArgs
e
)
{
var
deferral
=
e
.
SuspendingOperation
.
GetDeferral
(
)
;
//TODO: Anwendungszustand speichern und alle Hintergrundaktivitäten beenden
deferral
.
Complete
(
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL