Repository navigation
Implement Task Property for ListViewGroup - #3293
Conversation
There was a problem hiding this comment.
nit: name.
Also, should we follow the Events[s_*] pattern. This would allocate IntPtr.Size more for each ListView ever
There was a problem hiding this comment.
We have events wired in two different manners.. @JeremyKuhne @Tanya-Solyanik any thoughts on which manner is preferred?
There was a problem hiding this comment.
I can see that EventHandlerList is clearing out the delegates on disposal, which we need, it also does not take space for the event handler(only it's key object) unless one is defined by the developer. And ListView already uses it, so the new event should be added to that collection to make code more consistent and thus more maintainable.
We have events wired in two different manners.
What other way to add events to components do you mean?
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
I can see that EventHandlerList is clearing out the delegates on disposal, which we need, it also does not take space for the event handler(only it's key object) unless one is defined by the developer. And ListView already uses it, so the new event should be added to that collection to make code more consistent and thus more maintainable.
We have events wired in two different manners.
What other way to add events to components do you mean?
There was a problem hiding this comment.
For this particular use case test data does not have to be an object array, it could be an array of strongly typed tuples with named parameters.
new (string Value, string Expected)[]
{
("a", "b"),
....
}
Then you access it as data.Value and data.Expected and don't cast.
This proposal makes sense, I really like the URL string property - it is much easier to type in a string in the UITypeEditor than to add an event handler. Also the task UI looks like a link, it's reasonable for it to support common link APIs. |
|
So i'm not sure how much comctl32 actually exposes. It seems like internally the links (tasks) on the group are SysLink controls: https://docs.microsoft.com/en-us/windows/win32/controls/syslink-overview SysLink has a bunch of features that don't appear to be exposed on ListViewGroup. It seems like the only API exposed by There may be some ways to do this by enumerating through child windows of the LVGROUPW and finding the SysLink control. |
|
After a team discussion, we settled on the following: public class ListViewGroup
{
public string TaskLink { get; set; }
} |
RussKie
left a comment
There was a problem hiding this comment.
👍 with few docs-related issues
fc4cdfd to
d6646cd
Compare
|
Please rebase and resolve the merge conflict |
Fixes dotnet#2656 ListViewGroup originally did not have support for task. These changes adds a new property to ListViewGroup that reflects the task displayed in the group header. These changes also raises an event when the task is clicked.
| [Flags] | ||
| public enum LIF : uint | ||
| { | ||
| ITEMINDEX = 0x00000001, |
There was a problem hiding this comment.
nit: for flags it's good to align the values:
ITEMINDEX = 0x00000001,
STATE = 0x00000002,There was a problem hiding this comment.
VS eats the space, that's how all of our definitions are :(
There was a problem hiding this comment.
You have to undo the auto-format (which ends up as a separate commit, so you can just CTRL-Z after it formats). Yes, it bites that we have to fight VS, but you can align them. It is a pain to validate bit flags when they aren't lined up. Don't need to block on this.
In reply to: 434908242 [](ancestors = 434908242)
Fixes #2656
Proposed changes
ListViewGroupListViewCustomer Impact
Regression?
Screenshots
Before
After
Test methodology
TODOs:
Microsoft Reviewers: Open in CodeFlow