我想用动画代码调整agdatagrid中agdatagridcolumn的宽度:
(CreateStb(agdatagrid)).Begin();//Exceptin: Cannot resolve TargetProperty Width on specified object.
.
.
Private StoaryBoard CreateStb(UIElement element)
{
Storyboard stb = new Storyboard();
DoubleAnimation dbAnmtin = new DoubleAnimation();
Storyboard.SetTarget(dbAnmtin, (AgDataGridColumn)((AgDataGrid)element).Columns[0]);
Storyboard.SetTargetProperty(dbAnmtin, new PropertyPath("Width"));
dbAnmtin1.To=//custom value
dbAnmtin1.Duration=//custom value
stb.Children.Add(dbAnmtin);
Return stb;
}
我认为定义TargetProperty有一个问题,但我不知道如何解决它。plz帮助我
检查文档中的AgDataGridColumn
,Width
属性是否实现为DependencyProperty?只能设置依赖属性的动画。