|
|
|
@ -196,7 +196,7 @@ namespace Avalonia.Data |
|
|
|
/// </summary>
|
|
|
|
/// <param name="defaultValue">The default value.</param>
|
|
|
|
/// <returns>The value.</returns>
|
|
|
|
public T GetValueOrDefault(T defaultValue = default) => HasValue ? _value : defaultValue; |
|
|
|
public T GetValueOrDefault(T defaultValue) => HasValue ? _value : defaultValue; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the value if present, otherwise the default value.
|
|
|
|
@ -221,7 +221,7 @@ namespace Avalonia.Data |
|
|
|
/// present but not of the correct type or null, or <paramref name="defaultValue"/> if the
|
|
|
|
/// value is not present.
|
|
|
|
/// </returns>
|
|
|
|
public TResult GetValueOrDefault<TResult>(TResult defaultValue = default) |
|
|
|
public TResult GetValueOrDefault<TResult>(TResult defaultValue) |
|
|
|
{ |
|
|
|
return HasValue ? |
|
|
|
_value is TResult result ? result : default |
|
|
|
|