我得到了以下 app.xml:
<Application
x:Class="WeDoneIt.WP2.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WeDoneIt.WP2"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">
<Application.Resources>
<local:Bootstrapper x:Key="bootstrapper" />
</Application.Resources>
</Application>
和引导程序:
namespace WeDoneIt.WP2
{
public class Bootstrapper : Caliburn.Micro.Autofac.AutofacBootstrapper
{
public Bootstrapper()
{
Instance = this;
}
protected static Bootstrapper Instance { get; private set; }
protected override void ConfigureContainer(ContainerBuilder builder)
{
builder.RegisterType<ShellViewModel>();
builder.RegisterType<ItemViewModel>();
base.ConfigureContainer(builder);
}
public static T ResolveModel<T>() where T : INotifyPropertyChangedEx
{
return (T)Instance.GetInstance(typeof (T), null);
}
}
}
为什么找不到呢?