Skip to content
This repository was archived by the owner on Nov 25, 2023. It is now read-only.

Commit 5c35333

Browse files
committed
Add the Reddit URL properties
1 parent 141685b commit 5c35333

File tree

1 file changed

+38
-14
lines changed

1 file changed

+38
-14
lines changed

src/InvvardDev.EZLayoutDisplay.Desktop/ViewModel/AboutViewModel.cs

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,19 @@ public class AboutViewModel : ViewModelBase
3030
private string _creatorInfoLabel;
3131
private string _basedOnInfoLabel;
3232
private string _projectHomeInfoLabel;
33-
private string _contactInfoLabel;
33+
private string _twitterInfoLabel;
34+
private string _redditInfoLabel;
3435
private string _closeButtonLabel;
3536

3637
private readonly string _basedOnUrl;
3738
private readonly string _projectHomeUrl;
38-
private readonly string _contactUrl;
39+
private readonly string _twitterUrl;
40+
private readonly string _redditUrl;
3941

4042
private ICommand _navigateBasedOnUrlCommand;
4143
private ICommand _navigateProjectHomeUrlCommand;
42-
private ICommand _navigateContactUrlCommand;
44+
private ICommand _navigateTwitterUrlCommand;
45+
private ICommand _navigateRedditUrlCommand;
4346
private ICommand _closeAboutCommand;
4447

4548
#endregion
@@ -109,10 +112,16 @@ public string ProjectHomeInfoLabel
109112
set => Set(ref _projectHomeInfoLabel, value);
110113
}
111114

112-
public string ContactInfoLabel
115+
public string TwitterInfoLabel
113116
{
114-
get => _contactInfoLabel;
115-
set => Set(ref _contactInfoLabel, value);
117+
get => _twitterInfoLabel;
118+
set => Set(ref _twitterInfoLabel, value);
119+
}
120+
121+
public string RedditInfoLabel
122+
{
123+
get => _redditInfoLabel;
124+
set => Set(ref _redditInfoLabel, value);
116125
}
117126

118127
public string CloseButtonLabel
@@ -140,11 +149,18 @@ public string CloseButtonLabel
140149
?? (_navigateProjectHomeUrlCommand = new RelayCommand(NavigateProjectHomeUrl));
141150

142151
/// <summary>
143-
/// Navigate to contact URL command.
152+
/// Navigate to Twitter URL command.
153+
/// </summary>
154+
public ICommand NavigateTwitterUrlCommand =>
155+
_navigateTwitterUrlCommand
156+
?? (_navigateTwitterUrlCommand = new RelayCommand(NavigateTwitterUrl));
157+
158+
/// <summary>
159+
/// Navigate to Reddit URL command.
144160
/// </summary>
145-
public ICommand NavigateContactUrlCommand =>
146-
_navigateContactUrlCommand
147-
?? (_navigateContactUrlCommand = new RelayCommand(NavigateContactUrl));
161+
public ICommand NavigateRedditUrlCommand =>
162+
_navigateRedditUrlCommand
163+
?? (_navigateRedditUrlCommand = new RelayCommand(NavigateRedditUrl));
148164

149165
/// <summary>
150166
/// Close about window command.
@@ -166,7 +182,8 @@ public AboutViewModel(IWindowService windowService, IProcessService processServi
166182

167183
_basedOnUrl = "https://configure.ergodox-ez.com/layouts/default/latest/0";
168184
_projectHomeUrl = "https://github.com/Invvard/EZLayoutDisplay";
169-
_contactUrl = "https://twitter.com/invvard";
185+
_twitterUrl = "https://twitter.com/invvard";
186+
_redditUrl = "https://www.reddit.com/r/EZLayoutDisplay/";
170187

171188
SetLabelUi();
172189
}
@@ -189,7 +206,8 @@ private void SetLabelUi()
189206
CreatorInfoLabel = "Pierre CAVAROC";
190207
BasedOnInfoLabel = "ErgoDox EZ Configurator";
191208
ProjectHomeInfoLabel = appTitle;
192-
ContactInfoLabel = "@Invvard";
209+
TwitterInfoLabel = "@Invvard";
210+
RedditInfoLabel = "r/EZLayoutDisplay";
193211
CloseButtonLabel = "OK";
194212
}
195213

@@ -229,10 +247,16 @@ private void NavigateProjectHomeUrl()
229247
_processService.StartWebUrl(_projectHomeUrl);
230248
}
231249

232-
private void NavigateContactUrl()
250+
private void NavigateTwitterUrl()
251+
{
252+
Logger.TraceRelayCommand();
253+
_processService.StartWebUrl(_twitterUrl);
254+
}
255+
256+
private void NavigateRedditUrl()
233257
{
234258
Logger.TraceRelayCommand();
235-
_processService.StartWebUrl(_contactUrl);
259+
_processService.StartWebUrl(_redditUrl);
236260
}
237261

238262
private void CloseAboutWindow()

0 commit comments

Comments
 (0)