1
- using ClientCommon . Helpers ;
2
1
using Common . Entities ;
3
2
using Common . Enums ;
4
3
using Common . Helpers ;
@@ -76,7 +75,7 @@ out var newVersion
76
75
return "Install" ;
77
76
}
78
77
79
- if ( VersionComparer . Compare ( _port . InstalledVersion ! , _release ? . Version ! , "<" ) )
78
+ if ( IsUpdateAvailable )
80
79
{
81
80
return "Update" ;
82
81
}
@@ -110,6 +109,11 @@ out var newVersion
110
109
/// </summary>
111
110
public string LatestVersion => _release ? . Version ?? "Not available" ;
112
111
112
+ /// <summary>
113
+ /// Is new version of the port available
114
+ /// </summary>
115
+ public bool IsUpdateAvailable => VersionComparer . Compare ( _port . InstalledVersion ! , _release ? . Version ! , "<" ) ;
116
+
113
117
/// <summary>
114
118
/// Download/install progress
115
119
/// </summary>
@@ -135,6 +139,7 @@ public async Task InitializeAsync()
135
139
136
140
OnPropertyChanged ( nameof ( LatestVersion ) ) ;
137
141
OnPropertyChanged ( nameof ( InstallButtonText ) ) ;
142
+ OnPropertyChanged ( nameof ( IsUpdateAvailable ) ) ;
138
143
}
139
144
140
145
@@ -160,6 +165,7 @@ private async Task InstallAsync()
160
165
OnPropertyChanged ( nameof ( ProgressBarValue ) ) ;
161
166
OnPropertyChanged ( nameof ( Version ) ) ;
162
167
OnPropertyChanged ( nameof ( InstallButtonText ) ) ;
168
+ OnPropertyChanged ( nameof ( IsUpdateAvailable ) ) ;
163
169
164
170
IsInProgress = false ;
165
171
}
@@ -178,6 +184,7 @@ private async Task CheckUpdateAsync()
178
184
179
185
OnPropertyChanged ( nameof ( LatestVersion ) ) ;
180
186
OnPropertyChanged ( nameof ( InstallButtonText ) ) ;
187
+ OnPropertyChanged ( nameof ( IsUpdateAvailable ) ) ;
181
188
182
189
IsInProgress = false ;
183
190
}
0 commit comments