cs代码:
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
ContentGrid.DataContext = this;
this.Path = "数据绑定";
}

public string Path { get; set; }
}
XAML代码:
<Grid x:Name="ContentGrid">
<TextBlock Text="{Binding Path}"></TextBlock>
</Grid>

相关文章:

  • 2021-12-03
  • 2022-12-23
  • 2021-09-24
  • 2021-05-08
  • 2022-12-23
  • 2022-01-01
  • 2021-10-02
猜你喜欢
  • 2022-12-23
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-03
  • 2021-09-24
相关资源
相似解决方案