【发布时间】:2019-01-29 01:41:15
【问题描述】:
我正在尝试将我的视图模型用作我的窗口的数据上下文,但出现错误:
Windows Presentation Foundation (WPF) 项目不支持 ViewModel。
显然,我不了解我的窗口到我的视图模型的语法和数据绑定,但我不确定我不知道什么。
对我应该读什么有什么建议吗?
<Window x:Class="SunnyBeam.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="SunnyBeam" Height="488.358" Width="1014.552">
<Window.DataContext>
<ViewModel/>
</Window.DataContext>
<Grid>
</Grid>
</Window>
【问题讨论】:
标签: wpf xaml data-binding