I have found that personally I do like the UserControl model, it helps get the code separate by each of the functions (tabs), and helps with UI design time.
You can do it either way, but I have had much better long-term success going the route of UserControl.
In addition to the code separation, I think that adding the UC to a tab control ultimately makes it a lot more flexible. For example, if the UI changes over time and tabs are no longer necessary, it can easily be popped out and placed somewhere else. Or if the UC can be reused in a different context, it won't require a tab control to travel with it.
发布评论
评论(2)
我发现我个人确实喜欢 UserControl 模型,它有助于将代码按每个功能(选项卡)分开,并有助于 UI 设计时间。
两种方法都可以,但我在使用 UserControl 的道路上获得了更好的长期成功。
I have found that personally I do like the UserControl model, it helps get the code separate by each of the functions (tabs), and helps with UI design time.
You can do it either way, but I have had much better long-term success going the route of UserControl.
除了代码分离之外,我认为将 UC 添加到选项卡控件最终会使其更加灵活。例如,如果 UI 随着时间的推移而发生变化并且不再需要选项卡,则可以轻松将其弹出并放置在其他位置。或者,如果 UC 可以在不同的上下文中重用,则不需要选项卡控件与之一起移动。
In addition to the code separation, I think that adding the UC to a tab control ultimately makes it a lot more flexible. For example, if the UI changes over time and tabs are no longer necessary, it can easily be popped out and placed somewhere else. Or if the UC can be reused in a different context, it won't require a tab control to travel with it.