Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/ReactiveUI.Wpf/Common/ReactivePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ protected ReactivePage(IntPtr handle)
{
}
#endif
#else
/// <summary>
/// Initializes a new instance of the <see cref="ReactivePage{TViewModel}"/> class.
/// </summary>
public ReactivePage() => this.WhenActivated(disposables =>
{
// No-op, but ensures that when the Page is activated,
// any IActivatableViewModel logic in the ViewModel is also triggered.
});
#endif

/// <summary>
Expand Down
9 changes: 9 additions & 0 deletions src/ReactiveUI.Wpf/Common/ReactiveUserControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ protected ReactiveUserControl(IntPtr handle)
{
}
#endif
#else
/// <summary>
/// Initializes a new instance of the <see cref="ReactiveUserControl{TViewModel}"/> class.
/// </summary>
public ReactiveUserControl() => this.WhenActivated(disposables =>
{
// No-op, but ensures that when the Page is activated,
// any IActivatableViewModel logic in the ViewModel is also triggered.
});
#endif

/// <summary>
Expand Down
12 changes: 12 additions & 0 deletions src/ReactiveUI.Wpf/ReactiveWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ public class ReactiveWindow<TViewModel> :
typeof(ReactiveWindow<TViewModel>),
new PropertyMetadata(null));

/// <summary>
/// Initializes a new instance of the <see cref="ReactiveWindow{TViewModel}"/> class.
/// </summary>
/// <remarks>When the window is activated, this constructor ensures that the ViewModel's activation logic
/// is also triggered if the ViewModel implements IActivatableViewModel. This enables coordinated activation and
/// deactivation of resources tied to the window and its ViewModel.</remarks>
public ReactiveWindow() => this.WhenActivated(disposables =>
{
// No-op, but ensures that when the Page is activated,
// any IActivatableViewModel logic in the ViewModel is also triggered.
});

/// <summary>
/// Gets the binding root view model.
/// </summary>
Expand Down
Loading