UICollection.[] getter method should throw when index is invalid
See original GitHub issueDescribe the bug
The first line var ch0 = grid.Children[10];
should also throw ArgumentOutOfRangeException
Current implementation just returns null
, which is very misleading
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
What to return on an IndexOutOfBoundsException exception?
If you want to be clear that the method can throw an exception, just say so: public User getUser(int index) throws IndexOutOfBoundsException {...
Read more >Should a getter throw an exception if its object has invalid ...
If surname or name being null is a valid state for the object, then handle it accordingly. But if it's not a valid...
Read more >Exceptions should not be thrown from property getters
If exceptions need to be thrown, it is best to convert the property to a method. It is valid to throw exceptions from...
Read more >Checking for elements: contains, indexOf, any, every
indexOf(element)` returns the index of the given element in the list. ... This method will touch every element in the iterable, in order, ......
Read more >Using Indexers - C# Programming Guide
Learn how to declare and use an indexer for a class, struct, or interface in C#. This article includes example code.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jtorjo we (thankfully) have a couple very helpful community members, including @Jaiganeshkumaran and riverar!
This is indeed a WinUI XAML bug, transferring this bug now. Thanks for reporting it!
Someone at Microsoft, please tell me - is @Jaiganeshkumaran working for you? Or is he just “trying to be helpful”?