5
5
using Coder . Desktop . App . Views . Pages ;
6
6
using CommunityToolkit . Mvvm . Input ;
7
7
using Microsoft . UI ;
8
- using Microsoft . UI . Input ;
9
8
using Microsoft . UI . Windowing ;
10
9
using Microsoft . UI . Xaml ;
11
10
using Microsoft . UI . Xaml . Controls ;
12
- using Microsoft . UI . Xaml . Documents ;
13
11
using Microsoft . UI . Xaml . Media . Animation ;
14
12
using System ;
15
13
using System . Collections . Generic ;
19
17
using Windows . Graphics ;
20
18
using Windows . System ;
21
19
using Windows . UI . Core ;
20
+ using Microsoft . UI . Input ;
22
21
using WinRT . Interop ;
23
22
using WindowActivatedEventArgs = Microsoft . UI . Xaml . WindowActivatedEventArgs ;
24
23
@@ -41,7 +40,6 @@ public sealed partial class TrayWindow : Window
41
40
42
41
private readonly IRpcController _rpcController ;
43
42
private readonly ICredentialManager _credentialManager ;
44
- private readonly ISyncSessionController _syncSessionController ;
45
43
private readonly IUpdateController _updateController ;
46
44
private readonly IUserNotifier _userNotifier ;
47
45
private readonly TrayWindowLoadingPage _loadingPage ;
@@ -51,15 +49,13 @@ public sealed partial class TrayWindow : Window
51
49
52
50
public TrayWindow (
53
51
IRpcController rpcController , ICredentialManager credentialManager ,
54
- ISyncSessionController syncSessionController , IUpdateController updateController ,
55
- IUserNotifier userNotifier ,
52
+ IUpdateController updateController , IUserNotifier userNotifier ,
56
53
TrayWindowLoadingPage loadingPage ,
57
54
TrayWindowDisconnectedPage disconnectedPage , TrayWindowLoginRequiredPage loginRequiredPage ,
58
55
TrayWindowMainPage mainPage )
59
56
{
60
57
_rpcController = rpcController ;
61
58
_credentialManager = credentialManager ;
62
- _syncSessionController = syncSessionController ;
63
59
_updateController = updateController ;
64
60
_userNotifier = userNotifier ;
65
61
_loadingPage = loadingPage ;
@@ -74,9 +70,7 @@ public TrayWindow(
74
70
75
71
_rpcController . StateChanged += RpcController_StateChanged ;
76
72
_credentialManager . CredentialsChanged += CredentialManager_CredentialsChanged ;
77
- _syncSessionController . StateChanged += SyncSessionController_StateChanged ;
78
- SetPageByState ( _rpcController . GetState ( ) , _credentialManager . GetCachedCredentials ( ) ,
79
- _syncSessionController . GetState ( ) ) ;
73
+ SetPageByState ( _rpcController . GetState ( ) , _credentialManager . GetCachedCredentials ( ) ) ;
80
74
81
75
// Setting these directly in the .xaml doesn't seem to work for whatever reason.
82
76
TrayIcon . OpenCommand = Tray_OpenCommand ;
@@ -127,8 +121,7 @@ public TrayWindow(
127
121
} ;
128
122
}
129
123
130
- private void SetPageByState ( RpcModel rpcModel , CredentialModel credentialModel ,
131
- SyncSessionControllerStateModel syncSessionModel )
124
+ private void SetPageByState ( RpcModel rpcModel , CredentialModel credentialModel )
132
125
{
133
126
if ( credentialModel . State == CredentialState . Unknown )
134
127
{
@@ -201,18 +194,13 @@ private void MaybeNotifyUser(RpcModel rpcModel)
201
194
202
195
private void RpcController_StateChanged ( object ? _ , RpcModel model )
203
196
{
204
- SetPageByState ( model , _credentialManager . GetCachedCredentials ( ) , _syncSessionController . GetState ( ) ) ;
197
+ SetPageByState ( model , _credentialManager . GetCachedCredentials ( ) ) ;
205
198
MaybeNotifyUser ( model ) ;
206
199
}
207
200
208
201
private void CredentialManager_CredentialsChanged ( object ? _ , CredentialModel model )
209
202
{
210
- SetPageByState ( _rpcController . GetState ( ) , model , _syncSessionController . GetState ( ) ) ;
211
- }
212
-
213
- private void SyncSessionController_StateChanged ( object ? _ , SyncSessionControllerStateModel model )
214
- {
215
- SetPageByState ( _rpcController . GetState ( ) , _credentialManager . GetCachedCredentials ( ) , model ) ;
203
+ SetPageByState ( _rpcController . GetState ( ) , model ) ;
216
204
}
217
205
218
206
// Sadly this is necessary because Window.Content.SizeChanged doesn't
0 commit comments