我正在製作一個MVVM的Windows 8程序,該程序與手機共享MVM部分。在WinRT中使用Windows Phone示例數據
我的問題是,當我嘗試在WinRT中使用Windows Phone項目的XAML示例數據時,出現一堆錯誤。我的XAML是:
<vm:MyViewModel
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:MyApp.ViewModels"
>
由於使用了clr-namespace指令,因此這是明顯錯誤的。但是,如果我將其更改爲
<vm:MyViewModel
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:MyApp.ViewModels"
>
我得到同樣的一堆錯誤,如
The name "MyViewModel" does not exist in the namespace "using:MyApp.ViewModels"
我可以在Windows手機使用XAML文件作爲WinRT的樣品?我怎樣才能解決這個錯誤?
謝謝:)
可能的重複[如何使用DesignData來幫助開發Metro應用程序?](http://stackoverflow.com/q/11638437/50447) – 2013-03-19 21:14:57
我已經閱讀過這個問題,但是我的問題有所不同。詳情請參閱解決方案。如果我的問題是無用的,它可以被關閉或刪除 – blueocean 2013-03-19 22:16:59