forked from PeteGoo/ReactiveUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterfaces.cs
More file actions
58 lines (52 loc) · 1.97 KB
/
Interfaces.cs
File metadata and controls
58 lines (52 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Reactive;
using System.Reactive.Subjects;
using System.Windows.Input;
using ReactiveUI;
namespace ReactiveUI.Xaml
{
/// <summary>
/// IReactiveCommand is an Rx-enabled version of ICommand that is also an
/// Observable. Its Observable fires once for each invocation of
/// ICommand.Execute and its value is the CommandParameter that was
/// provided.
/// </summary>
public interface IReactiveCommand : ICommand, IObservable<object>
{
/// <summary>
/// Fires whenever the CanExecute of the ICommand changes. Note that
/// this should not fire notifications unless the CanExecute changes
/// (i.e. it should not fire 'true', 'true').
/// </summary>
IObservable<bool> CanExecuteObservable { get; }
}
/// <summary>
/// IReactiveAsyncCommand represents commands that run an asynchronous
/// operation in the background when invoked.
/// </summary>
public interface IReactiveAsyncCommand : IReactiveCommand
{
/// <summary>
/// Fires whenever the number of asynchronous operations in-flight (i.e.
/// currently running) changes and provides the new Count.
/// </summary>
IObservable<int> ItemsInflight { get; }
/// <summary>
/// Should be fired whenever an async operation starts.
/// </summary>
ISubject<Unit> AsyncStartedNotification { get; }
/// <summary>
/// Should be fired whenever an async operation completes.
/// </summary>
ISubject<Unit> AsyncCompletedNotification { get; }
/// <summary>
/// Should be fired whenever an async operation fails.
/// </summary>
ISubject<Exception> AsyncErrorNotification { get; }
}
}
// vim: tw=120 ts=4 sw=4 et :