ここのmMaterialCentreGroupListView.xaml
ファイルでは、この行はMaterialCentreGroupView
. しかし、ビューモデルのプロパティにアクセスするためのデータ コンテキストが表示されません。それはうまくいっています。以下はコードです。
<vw:MaterialCentreGroupView
Style="{StaticResource DetailedViewStyle}"
DataContext="{Binding SelectedMaterialCentreGroup}"/>
景色
<UserControl x:Class="MyBooks.View.MaterialCentreGroupView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
MinWidth="290" MaxWidth="290" Padding="20"
Background="#eee">
<UserControl.Resources>
<ResourceDictionary Source="ViewResources.xaml" />
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label
Grid.Row="0" Grid.Column="0"
Content="{Resx ResxName=MyBooks.Properties.Strings, Key=AccountCategoryListView_Name_Label}"
HorizontalAlignment="Right"/>
<TextBox
x:Name="CategoryName"
MaxLength="50"
Style="{StaticResource FormControlStyle}"
Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2"
Text="{Binding Path=Name, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"/>
何が起こるのか、どのようにバインディングが発生するのか説明してください。