-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from softawaregmbh/net8-sample
Updated sample app to .NET 8, add source link to class library, impro…
- Loading branch information
Showing
8 changed files
with
185 additions
and
199 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows; | ||
|
||
namespace Smartcrop.Sample.Wpf | ||
namespace Smartcrop.Sample.Wpf; | ||
|
||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
} | ||
} |
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 |
---|---|---|
@@ -1,33 +1,32 @@ | ||
using System.Windows; | ||
using Microsoft.Win32; | ||
|
||
namespace Smartcrop.Sample.Wpf | ||
namespace Smartcrop.Sample.Wpf; | ||
|
||
/// <summary> | ||
/// Interaction logic for MainWindow.xaml | ||
/// </summary> | ||
public partial class MainWindow : Window | ||
{ | ||
/// <summary> | ||
/// Interaction logic for MainWindow.xaml | ||
/// </summary> | ||
public partial class MainWindow : Window | ||
public MainWindow() | ||
{ | ||
public MainWindow() | ||
{ | ||
this.InitializeComponent(); | ||
this.InitializeComponent(); | ||
|
||
this.DataContext = new ViewModel(this.SelectFile); | ||
} | ||
this.DataContext = new ViewModel(this.SelectFile); | ||
} | ||
|
||
private string SelectFile() | ||
private string SelectFile() | ||
{ | ||
var dialog = new OpenFileDialog() | ||
{ | ||
var dialog = new OpenFileDialog() | ||
{ | ||
Filter = "Image Files | *.bmp; *.png; *.jpg; *.jpeg;" | ||
}; | ||
|
||
if (dialog.ShowDialog() == true) | ||
{ | ||
return dialog.FileName; | ||
} | ||
Filter = "Image Files | *.bmp; *.png; *.jpg; *.jpeg;" | ||
}; | ||
|
||
return null; | ||
if (dialog.ShowDialog() == true) | ||
{ | ||
return dialog.FileName; | ||
} | ||
|
||
return null; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,21 +1,15 @@ | ||
using System; | ||
using System.Windows.Input; | ||
|
||
namespace Smartcrop.Sample.Wpf | ||
{ | ||
public class SimpleCommand : ICommand | ||
{ | ||
private readonly Action executeAction; | ||
namespace Smartcrop.Sample.Wpf; | ||
|
||
public SimpleCommand(Action executeAction) | ||
{ | ||
this.executeAction = executeAction ?? throw new ArgumentNullException(nameof(executeAction)); | ||
} | ||
public class SimpleCommand(Action executeAction) : ICommand | ||
{ | ||
private readonly Action executeAction = executeAction ?? throw new ArgumentNullException(nameof(executeAction)); | ||
|
||
public event EventHandler CanExecuteChanged; | ||
public event EventHandler CanExecuteChanged; | ||
|
||
public bool CanExecute(object parameter) => true; | ||
public bool CanExecute(object parameter) => true; | ||
|
||
public void Execute(object parameter) => this.executeAction(); | ||
} | ||
public void Execute(object parameter) => this.executeAction(); | ||
} |
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.