我得到了以下的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);
}
}
}
Why can it not find it?
Microsoft.Phone
名称空间...所以你使用的是WPF还是WP7,因为引导程序不同请参见。否则,你的代码看起来很好,能否发布完整的堆栈跟踪?你的“WeDoneIt.WP2.App”和“Bootstrapper”在同一个程序集中吗? - nemesv