Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 0dac942

Browse files
committed
Fix DataContext/ViewModel property sync.
1 parent 304485e commit 0dac942

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/GitHub.UI.Reactive/Controls/ViewBase.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Windows.Automation.Peers;
55
using GitHub.ViewModels;
66
using ReactiveUI;
7+
using System.Reactive.Linq;
78

89
namespace GitHub.UI
910
{
@@ -23,7 +24,7 @@ public class ViewBase<TInterface, TImplementor> : UserControl, IViewFor<TInterfa
2324
public ViewBase()
2425
{
2526
DataContextChanged += (s, e) => ViewModel = (TInterface)e.NewValue;
26-
this.WhenAnyValue(x => x.ViewModel).Subscribe(x => DataContext = x);
27+
this.WhenAnyValue(x => x.ViewModel).Skip(1).Subscribe(x => DataContext = x);
2728
}
2829

2930
/// <summary>

0 commit comments

Comments
 (0)