首页 > 解决方案 > XAML 错误:不知道如何检测 ReactiveUI.RoutedViewHost 何时激活/停用

问题描述

我正在尝试将 RoutedViewHost 添加到我的视图中:

<Window x:Class="MyNamespace"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:MyNamespace"
        xmlns:rxui="http://reactiveui.net"
        mc:Ignorable="d"
        Title="MyView" Height="450" Width="800" WindowStyle="None">
    <rxui:RoutedViewHost x:Name="routedViewHost"
                         Grid.Row="1"
                         Grid.ColumnSpan="3">
        <rxui:RoutedViewHost.DefaultContent>

        </rxui:RoutedViewHost.DefaultContent>
    </rxui:RoutedViewHost>
</Window>

但我收到一个错误:

不知道如何检测 ReactiveUI.RoutedViewHost 何时激活/停用,您可能需要实现 IActivationForViewFetcher

并且不清楚究竟应该实现什么 IActivationForViewFetcher。

我怎么解决这个问题?

标签: wpfxamlreactiveui

解决方案


这可能与以下错误有关:

https://github.com/reactiveui/ReactiveUI/issues/1696

它只是设计师相关的吗?


推荐阅读