Can't access interface properties
See original GitHub issueDescribe the bug Accessing many properties of interfaces exposed by Avalonia are not possible since #11062 with no alternatives.
To Reproduce
Calling window.PlatformImpl?.DesktopScaling
or any property of IPlatformImpl
is not possible.
Basically any interface that has suffix Impl
cannot be used anymore, even when exposed from a public property.
Issue Analytics
- State:
- Created 5 months ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
c# - Cannot access implemented property (from interface)
I have an interface with properties: public interface IEntityModifier { ... bool AutoDetachOnFinished { get; set; } ...
Read more >Interface Properties - C# Programming Guide
Interface properties typically don't have a body. The accessors indicate whether the property is read-write, read-only, or write-only. Unlike in ...
Read more >Can't access property of interface to reference type in ...
In typescripts philosophy interface is virtual construction and you cant deal with it in any form except extending and inheritance (in other ...
Read more >Understanding and using interfaces in TypeScript
Read-only properties in interfaces. Read-only properties cannot be changed once they are initialized. For example, the properties length , width ...
Read more >c# - Implementing an interface when you don't need one of ...
There is no better interface to use. For instance, I have a class that allows you access items by index, check if it...
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
I understand now that these changes were intentional, and I don’t mind the change of hiding these interfaces. I think that if you should change these public properties to private as well, e.g.
PlatformImpl
as it’s super confusing for users to have access to a property with instance that has zero accessible members.Nope, that’s the problem - they’ve always been considered by us to be unstable interfaces, but because we’ve never enforced any sort of access control on them, people have been using them as public interfaces without realizing (and these interfaces are old [^1] and by this point incredibly hacked together). We have our hands tied when making changes to Avalonia because of this.
Having said that, we’re listening to feedback and will adjust our approach based on that, they’re preview releases for a reason after all 😉
[^1]: Yep, that’s pre-0.0.1-alpha