-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- The user shall have an easy way to provide feedback. - A second icon (thumbs up) has been added to the about button to symbolize feedback possibility.
- Loading branch information
Showing
23 changed files
with
385 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/TumblThree/TumblThree.Applications/Properties/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/TumblThree/TumblThree.Applications/ViewModels/FeedbackViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using System.ComponentModel.Composition; | ||
using System.Threading.Tasks; | ||
using System.Waf.Applications; | ||
using System.Windows; | ||
using System.Windows.Input; | ||
using TumblThree.Applications.Properties; | ||
using TumblThree.Applications.Services; | ||
using TumblThree.Applications.Views; | ||
using TumblThree.Domain; | ||
|
||
namespace TumblThree.Applications.ViewModels | ||
{ | ||
[Export] | ||
public class FeedbackViewModel : ViewModel<IFeedbackView> | ||
{ | ||
private readonly AsyncDelegateCommand _sendCommand; | ||
private readonly IApplicationUpdateService _applicationUpdateService; | ||
|
||
private string _message; | ||
|
||
[ImportingConstructor] | ||
public FeedbackViewModel(IFeedbackView view, IShellService shellService, IApplicationUpdateService applicationUpdateService) | ||
: base(view) | ||
{ | ||
ShellService = shellService; | ||
_sendCommand = new AsyncDelegateCommand(Send); | ||
_applicationUpdateService = applicationUpdateService; | ||
} | ||
|
||
public string Name { get; set; } | ||
|
||
public string Email { get; set; } | ||
|
||
public string Message { get; set; } | ||
|
||
public ICommand SendCommand => _sendCommand; | ||
|
||
public IShellService ShellService { get; } | ||
|
||
public void ShowDialog(object owner) => ViewCore.ShowDialog(owner); | ||
|
||
private async Task Send() | ||
{ | ||
try | ||
{ | ||
var result = await _applicationUpdateService.SendFeedback(Name, Email, Message); | ||
if (result) | ||
ViewCore.Close(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Logger.Error($"FeedbackViewModel:Send: {ex}"); | ||
MessageBox.Show(Resources.SendFeedbackError, Resources.Warning); | ||
} | ||
finally | ||
{ | ||
await Task.CompletedTask; | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/TumblThree/TumblThree.Applications/Views/IFeedbackView.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Waf.Applications; | ||
|
||
namespace TumblThree.Applications.Views | ||
{ | ||
public interface IFeedbackView : IView | ||
{ | ||
void ShowDialog(object owner); | ||
|
||
void Close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
src/TumblThree/TumblThree.Presentation/Properties/Resources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.