2012-06-15 36 views
2

我使用一个叫上我View.xamlView.cs,我ViewModel.cs和我的IoC容器我使用ComShorCaliburnWPF.ViewModules.Views.ShortMenuWindows.GWDSCTComShorCaliburnWPF.ViewModules.Views.ShortMenuWindows.GWDSCT命名空间。当我在最后删除GWDSCT时,它工作正常,但在目前的状态下它没有。我希望它现在能够工作,因为它准确地反映了文件的位置。有什么建议么?Caliburn.micro查看视图模型名称解析问题

+0

你可以添加更多的细节,也许代码示例? –

回答

2

一两件事,这将有助于调试这些问题是使用记录器:

public class DebugLogger : ILog 
    { 
     private readonly Type _type; 

     public DebugLogger(Type type) 
     { 
      _type = type; 
     } 

     public void Info(string format, params object[] args) 
     { 
      if (format.StartsWith("No bindable")) 
       return; 
      if (format.StartsWith("Action Convention Not Applied")) 
       return; 
      Debug.WriteLine("INFO: " + format, args); 
     } 

     public void Warn(string format, params object[] args) 
     { 
      Debug.WriteLine("WARN: " + format, args); 
     } 

     public void Error(Exception exception) 
     { 
      Debug.WriteLine("ERROR: {0}\n{1}", _type.Name, exception); 
     } 
    } 

然后在AppBootstrapper,配置方法。

LogManager.GetLog = type => new DebugLogger(type); 
+0

不知道为什么倒票,记录器会告诉你为什么它不能解析名称。 –

+0

你是对的记录器会帮助。但你可以添加更多的细节,比如将调试器注入caliburn微引擎。由于缺乏答案中的细节,因此投票表决很明显。 – vendettamit

+0

这就是LogManager.GetLog = type =>新的DebugLogger(type);'除非改变了,否则我暂时还没有使用它。 –