irihitech / Ursa.Avalonia

Ursa is a UI library for building cross-platform UIs with Avalonia UI.
https://irihitech.github.io/Ursa.Avalonia/
MIT License
528 stars 51 forks source link

Add TabView #44

Open yukina3230 opened 1 year ago

yukina3230 commented 1 year ago

Would be great if it has a TabView control that can Reorder, New/Close tabs. (Like in FluentAvalonia)

FAControlsGallery Desktop_mAC9l3ol11

zdpcdt commented 1 year ago

Semi.Avalonia is only a theme of the local Avalonia controls, and TabView is not within the target scope. Meanwhile, Ursa.Avalonia will consider adding TabView.

weshood commented 6 months ago

同样在找这个控件,能够实现就太好了! 感觉New Tab按钮应该是一个可选项,因为Tab有可能是通过其他UI交互创建的。

rabbitism commented 6 months ago

同样在找这个控件,能够实现就太好了! 感觉New Tab按钮应该是一个可选项,因为Tab有可能是通过其他UI交互创建的。

其实还有很多其他的问题。在mvvm的模式下我的关闭按钮功能应该只是destroy tabitem,还是也要负责从vm集合中移除?

weshood commented 6 months ago

其实还有很多其他的问题。在mvvm的模式下我的关闭按钮功能应该只是destroy tabitem,还是也要负责从vm集合中移除?

个人的简单实现是用ListBox实现标签页,用ContentControl展示页面(利用ViewLocator实现导航)。每个ListBoxItemViewModel都带有标签页的Header和页面的ViewModel属性,所以关闭时自然也要将一个ItemViewModel从VM集合中移除,不知这样做是否会带来一些问题。 当然,实现更好的通用控件要考虑更多,这还得取决于你们的决定。