我使用MVVM模式與文本塊的entrylog綁定的TextBlocks綁定。需要將對象在窗口WPF
<Window.DataContext>
<viewModel:WindowsEventsAutoMountViewModel x:Name="xWindowsEventsDetail"/>
</Window.DataContext>
<TextBlock x:Name="xCategoryTextBox" Grid.Column="1" Grid.Row="0" TextAlignment="Center" Text="{Binding Path= xWindowsEventsDetail.Event.Category}"/>
<Label Grid.Row="1" Grid.Column="0" Content="{x:Static res:RecoveryManagerResources.EventDetailViewLabel_Level}" Name="xlabelLevel" ContentStringFormat="{}{0}:"/>
<TextBlock x:Name="xLevelTextBox" Grid.Column="1" Grid.Row="1" TextAlignment="Center" Text="{Binding Path= xWindowsEventsDetail.Event.Level}"/>
也在其他領域
但在該領域沒有得到值提前
感謝
嘗試,也仍然沒有顯示數據 – User123