XAMARIN - 在xmlns clr-namespace中找不到

时间:2017-08-28 21:24:25

标签: c# wpf xamarin xamarin.ios

我是Xamarin的新手,我试图打开模拟器iOS,但我发现了这个错误:

  

位置9:14。键入infra:在xmlns中找不到IstanceLocator   CLR-名称空间:Convert.Infrastructure;装配=转换

我的项目

https://snag.gy/98ygVu.jpg

的App.xaml

<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://xamarin.com/schemas/2014/forms" 
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
    xmlns:infra="clr-namespace:Convert.Infrastructure;assembly=Convert"
    x:Class="Convert.App">
    <Application.Resources>
        <!-- Application resource dictionary -->
        <ResourceDictionary>
            <infra:IstanceLocator x:Key="Locator"></infra:IstanceLocator>
        </ResourceDictionary>
    </Application.Resources>
</Application>

App.xaml.cs

using Xamarin.Forms;
using Convert.Pages;

namespace Convert
{
    public partial class App : Application
    {
        public App()
        {
            InitializeComponent();

            MainPage = new NavigationPage(new MainPage());
        }

        protected override void OnStart()
        {
            // Handle when your app starts
        }

        protected override void OnSleep()
        {
            // Handle when your app sleeps
        }

        protected override void OnResume()
        {
            // Handle when your app resumes
        }
    }
}

IstanceLocator.cs

using System;
using Convert.ViewModels;
namespace Convert.Infrastructure
{
    public class InstanceLocator
    {
        public MainViewModel Main { get; set; }

        public InstanceLocator()
        {
        }
    }
}

1 个答案:

答案 0 :(得分:3)

你有一个错字

    index                          'original'   'naive_prediction'
    2017-08-19 17:49:08.102868         0           NaN
    2017-08-20 17:49:08.109869         1            0
    2017-08-21 17:49:08.109869         2            1
    2017-08-22 17:49:08.109869         3            2
    2017-08-23 17:49:08.109869        NaN           3

您缺少InstanceLocator中的“n”