我正在嘗試將資源字典添加到我的silverlight-4應用程序中(建議在「將視圖應用於ViewModel」一章http://msdn.microsoft.com/en-us/magazine/dd419663.aspx文章中)。向Silverlight應用程序添加資源
第一個問題:我在MainPage中看不到任何資源。我是否正確理解我需要手動將資源字典添加到Silverlight應用程序中?
第2:當我這樣做,在Dictionary1.xaml文件
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:System="clr-namespace:System;assembly=mscorlib">
<DataTemplate DataType="{x:Type vm:MyViewModel}">
<vw:MyView />
</DataTemplate>
</ResourceDictionary>
我得到一個錯誤:無法解析一個符號「數據類型」 ......
有什麼想法很熱這樣做?
名稱空間前綴「vm」和「vw」似乎未定義。 – andyp 2010-07-11 20:51:11