Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在 RowCollection 上捕获事件已更改?
new Grid().RowDefinitions.Changed+=???
也许这不是执行此操作的最佳方法,但我使用此解决方案:
private count=0; void OnLayoutUpdated(...) { if(count!=Grid().RowDefinitions.Count) { // Do what you need. } }
如果我们需要知道值已更改,我们也可以在值更改时对每个 RowDefinition 进行签名。