C#/WPF - Deep dive into the TabControl

preview_player
Показать описание


Other Examples of TabControl caching:


Рекомендации по теме
Комментарии
Автор

Excellent TabControl video. I especially liked the clarifications, for example that TabControl.ItemTemplate is used for the Tab item header area, and the TabControl.ContentTemplate is for the Tab item content area. This helped resolve a problem for me right away, as I had the 2 templates confused. Thank you!

rongreen
Автор

Thank you so much for going through this! Sadly I couldn't join the stream as it's the wrong time zone for me, but as someone who loves coding in C# and WPF I really like watching these videos. And I find these deep dives into how WPF works really interesting!

You basically summed up exactly my usecases. Some of my tab collections have indeed been a fixed amount of tabs, in which case creating them directly in the xaml (and binding to individual viewmodel properties) is probably a better solution, yeah. To me it ended up feeling nicer to have it be a collection of viewmodels as it was quicker to change things then, but I realize the tab control isn't really designed around being used that way. A lot of time it's also easy to fall in to the trap of MVVM having to have everything be in the viewmodel while in fact you can still have things specified in your xaml and even code behind when it makes sense for your UI (like manually specifying the TabItems rather than having it be databound).
And yeah, my main reason for wanting caching was for things like remembering scroll positions or if there happened to be input fields which were not databound (which is rarely the case). It also seemed like extra overhead having to recreate the UI each time a tab is switched, but it makes sense that it's favorable over caching them if you happened to be using a lot of tabs. And the virtualization is quite fast anyway!

RayCarrot
Автор

I just found you from your MVVM community Toolkit Video, simple and fun explanation, i love your videos ps: i'm starting to use the "Blop! Blop!" Sounds when i copy paste lol .

youcefmerah
Автор

Thank you very much for stream. It's not your first video that I'm watching full. You've got my attention with "hardest control in wtf is datagrid", I'm avoiding datagrid for a while. So I'll search for video on him, of course if you have one. Also using material design for a while (more than 8 projects) I saw some problems with alignment of headers and data in list view, hope you can help me out . One more time, thank for video.

TheMilliardo
Автор

I’m planning out a project that could make use of a TabControl. Each tab would hold very differently information, including user entered data and therefore, presumably, needing a different ViewModel. However, if I’m understanding you correct, if I want to maintain the entered data after switching tabs I should consider using just one ViewModel and include the relevant information in that large ViewModel?

ElCidPhysics
Автор

How about getting the datatemplate view from the IOC and let IOC help to determine the life circle of view?

williamliu
Автор

At 23:27 you have initialized the counter at 1. However, when NewTab() is called it sets title = counter++. Is counter value advanced after the call? I thought using counter++ would advance the values when it’s used thus making the title of the first tab = 2?

ElCidPhysics
Автор

Hi, this was absolutely awesome and totally changed the way I think about this control! I know that the dragablz framework exist but is their an easier way of implementing it that doesn’t involve so many custom controls and such advanced styling? I’m trying to figure out how I could easily re-arrange tabs and pop them into windows.

chrisjohnson