mirror of
https://github.com/holgerb83/ModernWpfPlayground.git
synced 2025-04-17 22:13:50 +02:00
updated to latest preview
This commit is contained in:
parent
3921ab20cf
commit
26094d25b4
@ -9,7 +9,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FastMember" Version="1.5.0" />
|
||||
<PackageReference Include="ModernWpfUI" Version="0.8.3" />
|
||||
<PackageReference Include="ModernWpfUI" Version="0.9.0-preview.200425.2" />
|
||||
<PackageReference Include="Prism.DryIoc" Version="7.2.0.1422" />
|
||||
<PackageReference Include="Prism.Wpf" Version="7.2.0.1422" />
|
||||
<PackageReference Include="YamlDotNet" Version="8.1.0" />
|
||||
|
@ -14,10 +14,10 @@ namespace ModernWpfPlayground.MvvmStuff
|
||||
ObjectAccessor = ObjectAccessor.Create(this);
|
||||
}
|
||||
|
||||
private readonly Dictionary<string, object> _values = new Dictionary<string, object>();
|
||||
private readonly Dictionary<string, object?> _values = new Dictionary<string, object?>();
|
||||
protected readonly ObjectAccessor ObjectAccessor;
|
||||
|
||||
protected IReadOnlyDictionary<string, object> Values => _values;
|
||||
protected IReadOnlyDictionary<string, object?> Values => _values;
|
||||
|
||||
protected bool SetProperty<T>(T value, Action<T>? onChanged = null,
|
||||
[CallerMemberName] string? propertyName = null)
|
||||
@ -25,7 +25,7 @@ namespace ModernWpfPlayground.MvvmStuff
|
||||
if (propertyName == null) throw new ArgumentNullException(nameof(propertyName));
|
||||
if (_values.TryGetValue(propertyName, out var obj) && Equals(value, obj)) return false;
|
||||
|
||||
_values[propertyName] = value!;
|
||||
_values[propertyName] = value;
|
||||
RaisePropertyChanged(propertyName);
|
||||
onChanged?.Invoke(value);
|
||||
return true;
|
||||
@ -34,7 +34,7 @@ namespace ModernWpfPlayground.MvvmStuff
|
||||
protected T GetProperty<T>(T defaultValue = default, [CallerMemberName] string? propertyName = null)
|
||||
{
|
||||
if (propertyName == null) throw new ArgumentNullException(nameof(propertyName));
|
||||
return Values.TryGetValue(propertyName, out var obj) ? (T)obj : defaultValue;
|
||||
return Values.TryGetValue(propertyName, out var obj) ? (T)obj! : defaultValue;
|
||||
}
|
||||
|
||||
protected void ResetViewModel(Func<string, bool>? predicate = null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user