-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement implicit DataType DataTemplates. #255
Comments
@hypersw I'm concerned about the negative effect to performance this may have on a ListBox. |
In the big WPF, it would create a resource key object |
That isn't a huge hit for for most operations as the resource chain is cascaded through the xaml load process. Since implicit data templates are active instead of passive, only an explicit template would prevent tree scan. Ideally, a list box would have a hint as to when to tree scan. As an alternative, would it work if a list box had a template selector with implicit data templates. This would put the list box into active mode only by developer's cue. cc @Ronmenator |
Just intuitively, that shan't be much different from binding a dynamic resource reference expression at a time later than load. I'd have a look into how the big WPF handles this. Is there a need in additional cues? If the itemscontrol is able to template its items passively (them being ui elements already, or having an explicit data template, or whatever), then we're passive and fast. If the template were not found, then either it's a bug in the markup, or the template is expected to be type-bound, anyway an active lookup would be OK to do, I suppose. I guess this only becomes a problem if done for lots of items in a row, but usually there would be one or a few different item types, so a simple caching would make this negligible. What's also bad about additional cues is that they are different from how WPF works and aren't straightforward. Anyway this won't make old scenarios slower, would it? |
In iPRO we use implicit templating for everything and have not seen a major issue with performance. In this picture you will notice the 'Telerik style' RadGridView control we created, this use a Template Chooser; Then everything you see on that screen is driven by implicit templates to determine which view and ViewModel to combine. |
Is this WPF, SL, Fayde? As of the big WPF, most of the views in ReSharper are bound to viewmodels via type-based template binding, with lookup ending up in the application-wide resource dictionary. When the application is composable and uses inversion of control, the parent view cannot know the all-embracing list of the child views it would home at runtime. This has to be a runtime-pluggable list, and with the ways of WPF this most naturally comes as type-bound data templates. The only perf issue so far is that the ResourceDictionary cannot work the pull-way, but has to be explicitly pushed with all the known views on startup, which causes to load some unneeded DLLs. |
The code is supposed to be in the |
Okay, so I have debugged this down to some point. In
Should work, but! What about setting it only if |
DataTemplate.DataType is parsed and loaded; however, there is no selection process happening.
Test cases were merged from PR #254
The text was updated successfully, but these errors were encountered: