深入探索控件开发:从依赖属性到自定义布局
1. 控件初始化与依赖属性
在控件开发中,初始化组件是重要的一步。以下是初始化组件的代码示例:
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void InitializeComponent()
{
if (_contentLoaded)
{
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(
this,
new System.Uri("/CompositeControlLib;component/PagedProductsGrid.xaml",
System.UriKind.Relative));
this.LayoutRoot =
((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.dgProductPage =
((System.Windows.Controls.DataGrid)(this.FindName("dgProductPage")));
this.lbxPageNum =
((System.Windows.Controls.Lis
超级会员免费看
订阅专栏 解锁全文
374

被折叠的 条评论
为什么被折叠?



