Browse Source

Restore missing DefaultContentProperty prop

pull/8685/head
Max Katz 4 years ago
parent
commit
748a25df0d
  1. 15
      src/Avalonia.ReactiveUI/RoutedViewHost.cs
  2. 18
      src/Avalonia.ReactiveUI/ViewModelViewHost.cs

15
src/Avalonia.ReactiveUI/RoutedViewHost.cs

@ -64,6 +64,12 @@ namespace Avalonia.ReactiveUI
public static readonly StyledProperty<string?> ViewContractProperty =
AvaloniaProperty.Register<RoutedViewHost, string?>(nameof(ViewContract));
/// <summary>
/// <see cref="AvaloniaProperty"/> for the <see cref="DefaultContent"/> property.
/// </summary>
public static readonly StyledProperty<object?> DefaultContentProperty =
ViewModelViewHost.DefaultContentProperty.AddOwner<RoutedViewHost>();
/// <summary>
/// Initializes a new instance of the <see cref="RoutedViewHost"/> class.
/// </summary>
@ -106,6 +112,15 @@ namespace Avalonia.ReactiveUI
set => SetValue(ViewContractProperty, value);
}
/// <summary>
/// Gets or sets the content displayed whenever there is no page currently routed.
/// </summary>
public object? DefaultContent
{
get => GetValue(DefaultContentProperty);
set => SetValue(DefaultContentProperty, value);
}
/// <summary>
/// Gets or sets the ReactiveUI view locator used by this router.
/// </summary>

18
src/Avalonia.ReactiveUI/ViewModelViewHost.cs

@ -1,5 +1,8 @@
using System;
using System.Reactive.Disposables;
using Avalonia.Controls;
using ReactiveUI;
using Splat;
@ -24,6 +27,12 @@ namespace Avalonia.ReactiveUI
public static readonly StyledProperty<string?> ViewContractProperty =
AvaloniaProperty.Register<ViewModelViewHost, string?>(nameof(ViewContract));
/// <summary>
/// <see cref="AvaloniaProperty"/> for the <see cref="DefaultContent"/> property.
/// </summary>
public static readonly StyledProperty<object?> DefaultContentProperty =
AvaloniaProperty.Register<ViewModelViewHost, object?>(nameof(DefaultContent));
/// <summary>
/// Initializes a new instance of the <see cref="ViewModelViewHost"/> class.
/// </summary>
@ -55,6 +64,15 @@ namespace Avalonia.ReactiveUI
set => SetValue(ViewContractProperty, value);
}
/// <summary>
/// Gets or sets the content displayed whenever there is no page currently routed.
/// </summary>
public object? DefaultContent
{
get => GetValue(DefaultContentProperty);
set => SetValue(DefaultContentProperty, value);
}
/// <summary>
/// Gets or sets the view locator.
/// </summary>

Loading…
Cancel
Save