Application.Exit和循环引用

huangapple go评论60阅读模式
英文:

Application.Exit and cyclic references

问题

Application.Exit不会关闭进程。UI保持可交互状态。

这是因为我有循环引用吗?

如何在不考虑代码的情况下找到循环引用?

英文:

Application.Exit wont close the process. The UI remains interactive.

Is this because I have cyclic references?

How do I find cyclic references without reasoning about the code?

答案1

得分: 0

循环引用不会影响 Application.Exit

事实证明,我在使用代码后端创建的组件与重复使用命名的 XAML 组件时,正在破解 Xaml::Controls::Grid 的 API 时遇到了一些棘手的问题:

  • Grid.ColumnDefinitions.Append
  • Grid.Children.Append
  • Grid.SetColumnSpan

我违反了编程的第一原则:避免处理棘手的问题。

英文:

Cyclic references don't affect Application.Exit.

It turns out I was hitting the rough edges of the api by hacking Xaml::Controls::Grid with a combination reusing named xaml components with components created from code behind:

  • Grid.ColumnDefinitions.Append
  • Grid.Children.Append
  • Grid.SetColumnSpan

I broke the first rule of programming: avoid the rough edges

huangapple
  • 本文由 发表于 2023年6月22日 17:24:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/76530405.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定