Skip to content

Commit 146bbf1

Browse files
authored
Merge pull request #80 from signal-csharp/redesign
Redesign
2 parents bcf7494 + 7575e4d commit 146bbf1

File tree

70 files changed

+1180
-673
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1180
-673
lines changed

Signal-Windows.sln

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26730.3
5-
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Signal-Windows", "Signal-Windows\Signal-Windows.csproj", "{41736A64-5B66-44AF-879A-501192A46920}"
7-
EndProject
8-
Global
9-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10-
Debug|Any CPU = Debug|Any CPU
11-
Debug|ARM = Debug|ARM
12-
Debug|x64 = Debug|x64
13-
Debug|x86 = Debug|x86
14-
Release|Any CPU = Release|Any CPU
15-
Release|ARM = Release|ARM
16-
Release|x64 = Release|x64
17-
Release|x86 = Release|x86
18-
EndGlobalSection
19-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20-
{41736A64-5B66-44AF-879A-501192A46920}.Debug|Any CPU.ActiveCfg = Debug|x86
21-
{41736A64-5B66-44AF-879A-501192A46920}.Debug|ARM.ActiveCfg = Debug|ARM
22-
{41736A64-5B66-44AF-879A-501192A46920}.Debug|ARM.Build.0 = Debug|ARM
23-
{41736A64-5B66-44AF-879A-501192A46920}.Debug|ARM.Deploy.0 = Debug|ARM
24-
{41736A64-5B66-44AF-879A-501192A46920}.Debug|x64.ActiveCfg = Debug|x64
25-
{41736A64-5B66-44AF-879A-501192A46920}.Debug|x64.Build.0 = Debug|x64
26-
{41736A64-5B66-44AF-879A-501192A46920}.Debug|x64.Deploy.0 = Debug|x64
27-
{41736A64-5B66-44AF-879A-501192A46920}.Debug|x86.ActiveCfg = Debug|x86
28-
{41736A64-5B66-44AF-879A-501192A46920}.Debug|x86.Build.0 = Debug|x86
29-
{41736A64-5B66-44AF-879A-501192A46920}.Debug|x86.Deploy.0 = Debug|x86
30-
{41736A64-5B66-44AF-879A-501192A46920}.Release|Any CPU.ActiveCfg = Release|x86
31-
{41736A64-5B66-44AF-879A-501192A46920}.Release|ARM.ActiveCfg = Release|ARM
32-
{41736A64-5B66-44AF-879A-501192A46920}.Release|ARM.Build.0 = Release|ARM
33-
{41736A64-5B66-44AF-879A-501192A46920}.Release|ARM.Deploy.0 = Release|ARM
34-
{41736A64-5B66-44AF-879A-501192A46920}.Release|x64.ActiveCfg = Release|x64
35-
{41736A64-5B66-44AF-879A-501192A46920}.Release|x64.Build.0 = Release|x64
36-
{41736A64-5B66-44AF-879A-501192A46920}.Release|x64.Deploy.0 = Release|x64
37-
{41736A64-5B66-44AF-879A-501192A46920}.Release|x86.ActiveCfg = Release|x86
38-
{41736A64-5B66-44AF-879A-501192A46920}.Release|x86.Build.0 = Release|x86
39-
{41736A64-5B66-44AF-879A-501192A46920}.Release|x86.Deploy.0 = Release|x86
40-
EndGlobalSection
41-
GlobalSection(SolutionProperties) = preSolution
42-
HideSolutionNode = FALSE
43-
EndGlobalSection
44-
GlobalSection(ExtensibilityGlobals) = postSolution
45-
SolutionGuid = {6C980B4F-4E4C-422E-A06F-1FB4A091E952}
46-
EndGlobalSection
47-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26730.3
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Signal-Windows", "Signal-Windows\Signal-Windows.csproj", "{41736A64-5B66-44AF-879A-501192A46920}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Debug|ARM = Debug|ARM
12+
Debug|x64 = Debug|x64
13+
Debug|x86 = Debug|x86
14+
Release|Any CPU = Release|Any CPU
15+
Release|ARM = Release|ARM
16+
Release|x64 = Release|x64
17+
Release|x86 = Release|x86
18+
EndGlobalSection
19+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{41736A64-5B66-44AF-879A-501192A46920}.Debug|Any CPU.ActiveCfg = Debug|x86
21+
{41736A64-5B66-44AF-879A-501192A46920}.Debug|ARM.ActiveCfg = Debug|ARM
22+
{41736A64-5B66-44AF-879A-501192A46920}.Debug|ARM.Build.0 = Debug|ARM
23+
{41736A64-5B66-44AF-879A-501192A46920}.Debug|ARM.Deploy.0 = Debug|ARM
24+
{41736A64-5B66-44AF-879A-501192A46920}.Debug|x64.ActiveCfg = Debug|x64
25+
{41736A64-5B66-44AF-879A-501192A46920}.Debug|x64.Build.0 = Debug|x64
26+
{41736A64-5B66-44AF-879A-501192A46920}.Debug|x64.Deploy.0 = Debug|x64
27+
{41736A64-5B66-44AF-879A-501192A46920}.Debug|x86.ActiveCfg = Debug|x86
28+
{41736A64-5B66-44AF-879A-501192A46920}.Debug|x86.Build.0 = Debug|x86
29+
{41736A64-5B66-44AF-879A-501192A46920}.Debug|x86.Deploy.0 = Debug|x86
30+
{41736A64-5B66-44AF-879A-501192A46920}.Release|Any CPU.ActiveCfg = Release|x86
31+
{41736A64-5B66-44AF-879A-501192A46920}.Release|ARM.ActiveCfg = Release|ARM
32+
{41736A64-5B66-44AF-879A-501192A46920}.Release|ARM.Build.0 = Release|ARM
33+
{41736A64-5B66-44AF-879A-501192A46920}.Release|ARM.Deploy.0 = Release|ARM
34+
{41736A64-5B66-44AF-879A-501192A46920}.Release|x64.ActiveCfg = Release|x64
35+
{41736A64-5B66-44AF-879A-501192A46920}.Release|x64.Build.0 = Release|x64
36+
{41736A64-5B66-44AF-879A-501192A46920}.Release|x64.Deploy.0 = Release|x64
37+
{41736A64-5B66-44AF-879A-501192A46920}.Release|x86.ActiveCfg = Release|x86
38+
{41736A64-5B66-44AF-879A-501192A46920}.Release|x86.Build.0 = Release|x86
39+
{41736A64-5B66-44AF-879A-501192A46920}.Release|x86.Deploy.0 = Release|x86
40+
EndGlobalSection
41+
GlobalSection(SolutionProperties) = preSolution
42+
HideSolutionNode = FALSE
43+
EndGlobalSection
44+
GlobalSection(ExtensibilityGlobals) = postSolution
45+
SolutionGuid = {6C980B4F-4E4C-422E-A06F-1FB4A091E952}
46+
EndGlobalSection
47+
EndGlobal

Signal-Windows/App.xaml.cs

Lines changed: 65 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
using Windows.UI.Xaml;
1313
using Windows.UI.Xaml.Controls;
1414
using Windows.UI.Xaml.Navigation;
15+
using Microsoft.QueryStringDotNET;
16+
using Windows.UI.Notifications;
1517

1618
namespace Signal_Windows
1719
{
@@ -28,6 +30,7 @@ sealed partial class App : Application
2830
public static bool MainPageActive = false;
2931
public static string USER_AGENT = "Signal-Windows";
3032
public static uint PREKEY_BATCH_SIZE = 100;
33+
public static bool WindowActive = false;
3134
private Task<SignalStore> Init;
3235

3336
/// <summary>
@@ -60,8 +63,29 @@ public App()
6063
/// </summary>
6164
/// <param name="e">Details über Startanforderung und -prozess.</param>
6265
protected override async void OnLaunched(LaunchActivatedEventArgs e)
66+
{
67+
await OnLaunchedOrActivated(e);
68+
}
69+
70+
protected override async void OnActivated(IActivatedEventArgs args)
71+
{
72+
await OnLaunchedOrActivated(args, false);
73+
}
74+
75+
/// <summary>
76+
///
77+
/// </summary>
78+
/// <param name="e"></param>
79+
/// <param name="launched">
80+
/// If OnLaunched this is true
81+
/// If OnActivated this is false
82+
/// </param>
83+
/// <returns></returns>
84+
private async Task OnLaunchedOrActivated(IActivatedEventArgs e, bool launched = true)
6385
{
6486
Debug.WriteLine("Signal-Windows " + LocalFolder.Path.ToString());
87+
Window.Current.Activated += Current_Activated;
88+
WindowActive = true;
6589
Frame rootFrame = Window.Current.Content as Frame;
6690

6791
// App-Initialisierung nicht wiederholen, wenn das Fenster bereits Inhalte enthält.
@@ -82,25 +106,54 @@ protected override async void OnLaunched(LaunchActivatedEventArgs e)
82106
Window.Current.Content = rootFrame;
83107
}
84108

85-
if (e.PrelaunchActivated == false)
109+
if (launched)
86110
{
87-
if (rootFrame.Content == null)
111+
LaunchActivatedEventArgs args = e as LaunchActivatedEventArgs;
112+
if (args.PrelaunchActivated == false)
88113
{
89-
// Wenn der Navigationsstapel nicht wiederhergestellt wird, zur ersten Seite navigieren
90-
// und die neue Seite konfigurieren, indem die erforderlichen Informationen als Navigationsparameter
91-
// übergeben werden
92-
Store = await Init;
93-
if (Store == null || !Store.Registered)
114+
if (rootFrame.Content == null)
94115
{
95-
rootFrame.Navigate(typeof(StartPage), e.Arguments);
116+
// Wenn der Navigationsstapel nicht wiederhergestellt wird, zur ersten Seite navigieren
117+
// und die neue Seite konfigurieren, indem die erforderlichen Informationen als Navigationsparameter
118+
// übergeben werden
119+
Store = await Init;
120+
if (Store == null || !Store.Registered)
121+
{
122+
rootFrame.Navigate(typeof(StartPage), args.Arguments);
123+
}
124+
else
125+
{
126+
rootFrame.Navigate(typeof(MainPage), args.Arguments);
127+
}
96128
}
97-
else
129+
}
130+
}
131+
else
132+
{
133+
if (e is ToastNotificationActivatedEventArgs)
134+
{
135+
var args = e as ToastNotificationActivatedEventArgs;
136+
QueryString queryString = QueryString.Parse(args.Argument);
137+
if (!(rootFrame.Content is MainPage))
98138
{
99-
rootFrame.Navigate(typeof(MainPage), e.Arguments);
139+
rootFrame.Navigate(typeof(MainPage), queryString);
100140
}
101141
}
102-
// Sicherstellen, dass das aktuelle Fenster aktiv ist
103-
Window.Current.Activate();
142+
}
143+
TileUpdateManager.CreateTileUpdaterForApplication().Clear();
144+
// Sicherstellen, dass das aktuelle Fenster aktiv ist
145+
Window.Current.Activate();
146+
}
147+
148+
private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
149+
{
150+
if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated)
151+
{
152+
WindowActive = false;
153+
}
154+
else
155+
{
156+
WindowActive = true;
104157
}
105158
}
106159

8.21 KB
13.2 KB
18.4 KB
33.4 KB
133 KB
1.63 KB
2.42 KB
2.7 KB

0 commit comments

Comments
 (0)