Browse Source

Fix RoutedViewHost and ViewModelViewHost by implementing IStyleable

pull/8738/head
Max Katz 4 years ago
parent
commit
543e98d753
  1. 4
      src/Avalonia.ReactiveUI/RoutedViewHost.cs
  2. 6
      src/Avalonia.ReactiveUI/ViewModelViewHost.cs

4
src/Avalonia.ReactiveUI/RoutedViewHost.cs

@ -50,7 +50,7 @@ namespace Avalonia.ReactiveUI
/// ReactiveUI routing documentation website</see> for more info. /// ReactiveUI routing documentation website</see> for more info.
/// </para> /// </para>
/// </remarks> /// </remarks>
public class RoutedViewHost : TransitioningContentControl, IActivatableView, IEnableLogger public class RoutedViewHost : TransitioningContentControl, IActivatableView, IEnableLogger, IStyleable
{ {
/// <summary> /// <summary>
/// <see cref="AvaloniaProperty"/> for the <see cref="Router"/> property. /// <see cref="AvaloniaProperty"/> for the <see cref="Router"/> property.
@ -126,6 +126,8 @@ namespace Avalonia.ReactiveUI
/// </summary> /// </summary>
public IViewLocator? ViewLocator { get; set; } public IViewLocator? ViewLocator { get; set; }
Type IStyleable.StyleKey => typeof(TransitioningContentControl);
/// <summary> /// <summary>
/// Invoked when ReactiveUI router navigates to a view model. /// Invoked when ReactiveUI router navigates to a view model.
/// </summary> /// </summary>

6
src/Avalonia.ReactiveUI/ViewModelViewHost.cs

@ -2,7 +2,7 @@ using System;
using System.Reactive.Disposables; using System.Reactive.Disposables;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Styling;
using ReactiveUI; using ReactiveUI;
using Splat; using Splat;
@ -13,7 +13,7 @@ namespace Avalonia.ReactiveUI
/// the ViewModel property and display it. This control is very useful /// the ViewModel property and display it. This control is very useful
/// inside a DataTemplate to display the View associated with a ViewModel. /// inside a DataTemplate to display the View associated with a ViewModel.
/// </summary> /// </summary>
public class ViewModelViewHost : TransitioningContentControl, IViewFor, IEnableLogger public class ViewModelViewHost : TransitioningContentControl, IViewFor, IEnableLogger, IStyleable
{ {
/// <summary> /// <summary>
/// <see cref="AvaloniaProperty"/> for the <see cref="ViewModel"/> property. /// <see cref="AvaloniaProperty"/> for the <see cref="ViewModel"/> property.
@ -78,6 +78,8 @@ namespace Avalonia.ReactiveUI
/// </summary> /// </summary>
public IViewLocator? ViewLocator { get; set; } public IViewLocator? ViewLocator { get; set; }
Type IStyleable.StyleKey => typeof(TransitioningContentControl);
/// <summary> /// <summary>
/// Invoked when ReactiveUI router navigates to a view model. /// Invoked when ReactiveUI router navigates to a view model.
/// </summary> /// </summary>

Loading…
Cancel
Save