public readonly struct RunicWindowResult<TResult> : IEquatable<RunicWindowResult<TResult>> The result of a Window opened with IRunicWindowService.OpenForResultAsync: the value its ViewModel completed it with (IRunicWindowResult.CompleteAsync), or none when the Window closed without one. The default value is none.
Type parameters
TResultThe result's type.
Constructors
RunicWindowResult
public RunicWindowResult(TResult value) A completed result.
Parameters
valueThe value.
Properties
HasValue
public bool HasValue { get; } Whether the Window completed with a value. false when it closed without one: the user closed it, or the application did.
Value
public TResult Value { get; } The value the Window completed with.
Exceptions
InvalidOperationExceptionThe Window closed without a result (
RunicWindowResult.HasValueisfalse).
Methods
Equals
public bool Equals(RunicWindowResult<TResult> other) Inherits documentation from IEquatable.Equals.
GetValueOrDefault
public TResult GetValueOrDefault(TResult fallback) The value, or fallback when the Window closed without one.
Parameters
fallbackThe value without a result.
TryGetValue
public bool TryGetValue(out TResult value) Gets the value, if the Window completed with one.
Parameters
valueThe value, or the default of
TResult.
Returns
true when the Window completed with a value.
Operators
operator !=
public static bool operator !=(RunicWindowResult<TResult> left, RunicWindowResult<TResult> right) Whether two results differ.
operator ==
public static bool operator ==(RunicWindowResult<TResult> left, RunicWindowResult<TResult> right) Whether two results are equal.