Я написал следующий код в mainwindow.xaml
<Window x:Class="LoginApplication.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:LoginApplication" xmlns:vm="clr-namespace:LoginApplication.ViewModel" mc:Ignorable="d" Title="Login Application" Height="450" Width="800" ResizeMode="NoResize"> <Window.Resources> <vm:UserViewModel x:Key="UserViewModel"/> </Window.Resources> <Grid DataContext="{Binding Source={StaticResource UserViewModel}}" >
Это вызывает ошибку в строке контекста данных сетки. Вы можете предложить какие-нибудь улучшения.