mirror of
https://github.com/holgerb83/ModernWpfPlayground.git
synced 2025-06-30 01:40:51 +02:00
fixed csproj dependencies
This commit is contained in:
@ -7,9 +7,9 @@ namespace ModernWpfPlayground
|
||||
public static readonly DependencyProperty MessageProperty = DependencyProperty.Register(
|
||||
"Message", typeof(string), typeof(ContentDialogExample), new PropertyMetadata(default(string)));
|
||||
|
||||
public string Message
|
||||
public string? Message
|
||||
{
|
||||
get => (string) GetValue(MessageProperty);
|
||||
get => (string?) GetValue(MessageProperty);
|
||||
set => SetValue(MessageProperty, value);
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ namespace ModernWpfPlayground
|
||||
|
||||
public ICommand ShowDialogCommand { get; }
|
||||
|
||||
public string WelcomeMessage
|
||||
public string? WelcomeMessage
|
||||
{
|
||||
get => GetProperty("Shadow of the empire");
|
||||
set => SetProperty(value);
|
||||
@ -137,7 +137,7 @@ namespace ModernWpfPlayground
|
||||
private void SaveViewModel()
|
||||
{
|
||||
var contents = _serializer.Serialize(Values);
|
||||
if (Path == null)
|
||||
if (Path is null)
|
||||
{
|
||||
var saveFileDialog = new SaveFileDialog {AddExtension = true, DefaultExt = "*.yaml"};
|
||||
var result = saveFileDialog.ShowDialog(Application.Current.MainWindow?.Owner);
|
||||
|
@ -15,8 +15,6 @@
|
||||
<PackageReference Include="YamlDotNet" Version="9.1.0" />
|
||||
<PackageReference Include="System.Drawing.Common" Version="5.0.0" />
|
||||
<PackageReference Include="MahApps.Metro.IconPacks.FontAwesome" Version="4.8.0" />
|
||||
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.18362.2005" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -14,9 +14,9 @@ namespace ModernWpfPlayground.MvvmStuff
|
||||
ObjectAccessor = ObjectAccessor.Create(this);
|
||||
}
|
||||
|
||||
private readonly Dictionary<string, object?> _values = new Dictionary<string, object?>();
|
||||
private readonly Dictionary<string, object?> _values = new();
|
||||
protected readonly ObjectAccessor ObjectAccessor;
|
||||
private readonly Dictionary<string, object?> _defaultValues = new Dictionary<string, object?>();
|
||||
private readonly Dictionary<string, object?> _defaultValues = new();
|
||||
|
||||
protected IReadOnlyDictionary<string, object?> Values => _values;
|
||||
|
||||
@ -32,7 +32,7 @@ namespace ModernWpfPlayground.MvvmStuff
|
||||
return true;
|
||||
}
|
||||
|
||||
protected T GetProperty<T>(T defaultValue = default, [CallerMemberName] string? propertyName = null)
|
||||
protected T? GetProperty<T>(T? defaultValue = default, [CallerMemberName] string? propertyName = null)
|
||||
{
|
||||
if (propertyName == null) throw new ArgumentNullException(nameof(propertyName));
|
||||
if (Values.TryGetValue(propertyName, out var obj))
|
||||
|
Reference in New Issue
Block a user