且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

WPF 绑定:如何将数据绑定到网格?

更新时间:2022-05-02 02:00:45

使用 ContentPresenter 代替 Grid:

Instead of a Grid use a ContentPresenter like this:

<Grid>         
<ContentPresenter
Name="AccountGrid"              
Content="{Binding Source={StaticResource ResourceKey=WindowController},                           Path=SelectedAccount}">  
   </ContentPresenter>
</Grid>