Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xamarin.forms 为什么在使用ReactiveContentPage时会出现“不一致的可访问性”问题?_Xamarin.forms_Reactiveui - Fatal编程技术网

Xamarin.forms 为什么在使用ReactiveContentPage时会出现“不一致的可访问性”问题?

Xamarin.forms 为什么在使用ReactiveContentPage时会出现“不一致的可访问性”问题?,xamarin.forms,reactiveui,Xamarin.forms,Reactiveui,我正在尝试使用ContentPageBase跟踪示例。但当我在我的视图上扩展它时,我得到了以下错误: 可访问性不一致:基类“ContentPageBase”的可访问性不如类“HomeView” 这里是HomeView: namespace ReactiveTest.Views { public partial class HomeView : ContentPageBase<HomeViewModel> { public HomeView()

我正在尝试使用
ContentPageBase
跟踪示例。但当我在我的视图上扩展它时,我得到了以下错误:

可访问性不一致:基类“ContentPageBase”的可访问性不如类“HomeView”

这里是
HomeView

namespace ReactiveTest.Views
{
    public partial class HomeView : ContentPageBase<HomeViewModel>
    {
        public HomeView()
        {
            InitializeComponent();
        }
    }
}

知道我如何解决这个问题吗?

确保HomeView和HomeViewModel都是公共的。泛型类型也会影响可访问性。

如果您不发布相关代码,我们将无法帮助您。HomeView的类声明是什么样子的?很抱歉,我已经添加了相关的codeIs HomeViewModel public?哇,就这些。非常感谢。我一定认为泛型类型对基类型没有任何影响。你可以发布一个答案,我会接受的
namespace ReactiveTest.Views
{
   public class ContentPageBase<TViewModel> : ReactiveContentPage<TViewModel> where TViewModel : class
   {
   }
}