Fix ListView to be compatible when ListView.View is a GridView#979
Fix ListView to be compatible when ListView.View is a GridView#979pomianowski merged 9 commits intolepoco:developmentfrom
Conversation
| @@ -0,0 +1,60 @@ | |||
| namespace Wpf.Ui.Controls; | |||
|
|
|||
| public class ListView : System.Windows.Controls.ListView | |||
There was a problem hiding this comment.
|
|
||
| public class ListView : System.Windows.Controls.ListView | ||
| { | ||
| public string ViewState |
There was a problem hiding this comment.
Missing docs for pubplic property
|
Hey @koal44 , thanks for your contribution to the project. I would add some documentation and improve the formatting |
Removed the custom class ui:ListView as its purpose was to expose the ViewState, which can be simplified by directly binding to ListView.View with a ValueConverter.
29cb0d0 to
96d10c0
Compare
|
I force pushed the last commit so that it aligned better with Wpf.Ui/development. The latest commit removes the custom I didn't mention it before, but the XAML style for |
|
Any idea when this will be released? |
|
|
||
| namespace Wpf.Ui.Controls; | ||
|
|
||
| public enum ListViewViewState |
There was a problem hiding this comment.
Missing docs for public api
…4/wpfui into fix/gridview-compatibility
|
Ok, the recent update should address reviewer concerns about documentation and VS tooling. I also re-implemented the custom |
|
Looking forward to these ListView PRs showing up in a release! This is great, thank you! |
Hey, already released in the version 3.0.3 |
|
Tried setting the IsEnabled property to false? |
I'm trying out the latest version and its looking great! Thanks so much! |
The UI library currently breaks all
ListViewcontrols that use theGridViewview. This PR adds support forGridViewand showcases it in the GalleryAppPull request type
What is the current behavior?
The current behavior is that UI library interferes with how different derived types of
BaseVieware dynamically stylized, which renders types likeGridViewincompatible with this library. Although you can workaround this by voiding the library's styles, something like:Digging through older framework code, it appears that when
Viewchanges,ListViewuses the currentViewto change its ownDefaultStyleKeyand also apply new keys to its viewitem children. When theViewis null, theDefaultStyleKeywill point toListBoxandListBoxItem(theme styles) and forGridViewit'll beGridViewStyleandGridViewItemContainerStyle. When this library directly set a style onListViewandListViewItemit broke the unorthodox approach the framework used to dynamically set styles to different views.My first attempt was to go with the flow of the WPF framework. For example, you should be able to style
ListBoxand see that refelcted in aListViewwith nullView, but various attempts at this failed.Since there is actually only one derived type of BaseView - namely
GridView, there are effectively only two scenarios that exist - nullview and gridview, so we can use a more standard approach and use xaml styles to handle these two different cases.What is the new behavior?
ViewListView.xamlandListViewItem.xamlto adapt to different View statesOther information