Browse Source
* Close popup if combobox is not visible * fix unsupported feature Co-authored-by: kaminova <flake@inbox@gmail.com> Co-authored-by: Max Katz <maxkatz6@outlook.com>release/0.10.8
committed by
Steven Kirk
3 changed files with 77 additions and 32 deletions
@ -0,0 +1,38 @@ |
|||
using System; |
|||
using System.Reactive.Disposables; |
|||
|
|||
namespace Avalonia.Controls.Mixins |
|||
{ |
|||
/// <summary>
|
|||
/// Extension methods associated with the IDisposable interface.
|
|||
/// </summary>
|
|||
public static class DisposableMixin |
|||
{ |
|||
/// <summary>
|
|||
/// Ensures the provided disposable is disposed with the specified <see cref="CompositeDisposable"/>.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">
|
|||
/// The type of the disposable.
|
|||
/// </typeparam>
|
|||
/// <param name="item">
|
|||
/// The disposable we are going to want to be disposed by the CompositeDisposable.
|
|||
/// </param>
|
|||
/// <param name="compositeDisposable">
|
|||
/// The <see cref="CompositeDisposable"/> to which <paramref name="item"/> will be added.
|
|||
/// </param>
|
|||
/// <returns>
|
|||
/// The disposable.
|
|||
/// </returns>
|
|||
public static T DisposeWith<T>(this T item, CompositeDisposable compositeDisposable) |
|||
where T : IDisposable |
|||
{ |
|||
if (compositeDisposable is null) |
|||
{ |
|||
throw new ArgumentNullException(nameof(compositeDisposable)); |
|||
} |
|||
|
|||
compositeDisposable.Add(item); |
|||
return item; |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue