Skip to content

Commit dab4e33

Browse files
committed
feature: Changed to FromEvent
1 parent 217aae0 commit dab4e33

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/ReactiveUI.Plugins.Popup/ReactivePopupPage.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,15 @@ public abstract class ReactivePopupPage<TViewModel> : PopupPage, IViewFor<TViewM
3737
protected ReactivePopupPage()
3838
{
3939
BackgroundClick =
40-
Observable
41-
.FromEventPattern(x => BackgroundClicked += x, x => BackgroundClicked -= x)
42-
.Select(x => Unit.Default);
40+
Observable.FromEvent<EventHandler, Unit>(
41+
handler =>
42+
{
43+
void EventHandler(object sender, EventArgs args) => handler(Unit.Default);
44+
return EventHandler;
45+
},
46+
x => BackgroundClicked += x,
47+
x => BackgroundClicked -= x)
48+
.Select(_ => Unit.Default);
4349
}
4450

4551
/// <summary>

0 commit comments

Comments
 (0)