-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lots of changes: more MVVM - Prism interactions instead of MessageBox…
…, better error handling, UI improvements, status bar, about dialog. A bit much for a single commit but had a flow ...
- Loading branch information
Showing
21 changed files
with
1,563 additions
and
69 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
//---------------------------------------------------------------------------- | ||
// <copyright file="BooleanToVisibilityConverter.cs" | ||
// company="Markus M. Egger"> | ||
// Copyright (C) 2018 Markus M. Egger. All rights reserved. | ||
// </copyright> | ||
// <author>Markus M. Egger</author> | ||
// <description> | ||
// Value converter to convert from Boolean to Visibility. | ||
// </description> | ||
// <version>v0.8.0 2018-06-15T02:55:00+02</version> | ||
//---------------------------------------------------------------------------- | ||
|
||
namespace at.markusegger.Application.TheC64Disker.Converters | ||
{ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
|
||
/// <summary> | ||
/// Value converter to convert from <see cref="Boolean"/> to <see cref="Visibility"/> | ||
/// </summary> | ||
public class BooleanToVisibilityConverter : IValueConverter | ||
{ | ||
#region IValueConverter | ||
|
||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is bool booleanValue) | ||
{ | ||
if (targetType == typeof(Visibility)) | ||
{ | ||
return | ||
(booleanValue ? Visibility.Visible : Visibility.Collapsed); | ||
} | ||
} | ||
|
||
throw new InvalidOperationException( | ||
$"Combination of {nameof(value)}/{nameof(targetType)} not supported by {nameof(BooleanToVisibilityConverter)}."); | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException( | ||
$"{nameof(ConvertBack)} not supported by {nameof(BooleanToVisibilityConverter)}."); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
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,23 @@ | ||
//---------------------------------------------------------------------------- | ||
// <copyright file="CloseEvent.cs" | ||
// company="Markus M. Egger"> | ||
// Copyright (C) 2018 Markus M. Egger. All rights reserved. | ||
// </copyright> | ||
// <author>Markus M. Egger</author> | ||
// <description> | ||
// A Prism event to signal UI elements like windows to close. | ||
// </description> | ||
// <version>v1.0.0 2018-06-15T02:07:00+02</version> | ||
//---------------------------------------------------------------------------- | ||
|
||
namespace at.markusegger.Application.TheC64Disker.Events | ||
{ | ||
using Prism.Events; | ||
|
||
/// <summary> | ||
/// A Prism event to signal UI elements like windows to close. | ||
/// </summary> | ||
public class CloseEvent : PubSubEvent | ||
{ | ||
} | ||
} |
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,42 @@ | ||
//---------------------------------------------------------------------------- | ||
// <copyright file="Error.cs" | ||
// company="Markus M. Egger"> | ||
// Copyright (C) 2018 Markus M. Egger. All rights reserved. | ||
// </copyright> | ||
// <author>Markus M. Egger</author> | ||
// <description> | ||
// Basic implementation of INotification for error messages. | ||
// </description> | ||
// <version>v1.0.0 2018-06-14T22:59:00+02</version> | ||
// | ||
// Based on: | ||
// | ||
// Prism's Notification | ||
// | ||
//---------------------------------------------------------------------------- | ||
|
||
namespace at.markusegger.Application.TheC64Disker.Interactivity.InteractionRequest | ||
{ | ||
using Prism.Interactivity.InteractionRequest; | ||
|
||
/// <summary> | ||
/// Basic implementation of Prism.Interactivity.InteractionRequest.INotification | ||
/// for error messages. | ||
/// </summary> | ||
public class Error : INotification | ||
{ | ||
#region Properties | ||
|
||
/// <summary> | ||
/// Gets or sets the title to use for the notification. | ||
/// </summary> | ||
public string Title { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the content of the notification. | ||
/// </summary> | ||
public object Content { get; set; } | ||
|
||
#endregion | ||
} | ||
} |
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,42 @@ | ||
//---------------------------------------------------------------------------- | ||
// <copyright file="Warning.cs" | ||
// company="Markus M. Egger"> | ||
// Copyright (C) 2018 Markus M. Egger. All rights reserved. | ||
// </copyright> | ||
// <author>Markus M. Egger</author> | ||
// <description> | ||
// Basic implementation of INotification for warning messages. | ||
// </description> | ||
// <version>v1.0.0 2018-06-14T22:58:00+02</version> | ||
// | ||
// Based on: | ||
// | ||
// Prism's Notification | ||
// | ||
//---------------------------------------------------------------------------- | ||
|
||
namespace at.markusegger.Application.TheC64Disker.Interactivity.InteractionRequest | ||
{ | ||
using Prism.Interactivity.InteractionRequest; | ||
|
||
/// <summary> | ||
/// Basic implementation of Prism.Interactivity.InteractionRequest.INotification | ||
/// for warning messages. | ||
/// </summary> | ||
public class Warning : INotification | ||
{ | ||
#region Properties | ||
|
||
/// <summary> | ||
/// Gets or sets the title to use for the notification. | ||
/// </summary> | ||
public string Title { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the content of the notification. | ||
/// </summary> | ||
public object Content { get; set; } | ||
|
||
#endregion | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//---------------------------------------------------------------------------- | ||
// <copyright file="OperationResult.cs" | ||
// company="Markus M. Egger"> | ||
// Copyright (C) 2018 Markus M. Egger. All rights reserved. | ||
// </copyright> | ||
// <author>Markus M. Egger</author> | ||
// <description> | ||
// An enumeration of results a general operation can yield. | ||
// </description> | ||
// <version>v1.0.0 2018-06-14T23:39:00+02</version> | ||
//---------------------------------------------------------------------------- | ||
|
||
namespace at.markusegger.Application.TheC64Disker.Utility | ||
{ | ||
/// <summary> | ||
/// An enumeration of results a general operation can yield. | ||
/// </summary> | ||
public enum OperationResult | ||
{ | ||
Cancelled, | ||
Error, | ||
Success, | ||
} | ||
} |
Oops, something went wrong.