Shell icon indicating copy to clipboard operation
Shell copied to clipboard

Unable to resolve 'Instance' - Intellisense / Compiler warns since it doesn't know that entity

Open PhilWeisz opened this issue 1 year ago • 2 comments

https://github.com/AvaloniaInside/Shell/blame/10d6d8c159ea76e2ade707c76c6a6a9bf3efa642/src/Example/ShellExample/ShellExample/Views/MainTabControl.axaml#L16

https://github.com/AvaloniaInside/Shell/blame/10d6d8c159ea76e2ade707c76c6a6a9bf3efa642/src/Example/ShellExample/ShellExample/Views/MainTabControl.axaml#L21

https://github.com/AvaloniaInside/Shell/blame/10d6d8c159ea76e2ade707c76c6a6a9bf3efa642/src/Example/ShellExample/ShellExample/Views/MainTabControl.axaml#L30

image

PhilWeisz avatar Apr 25 '24 20:04 PhilWeisz

Please, help! :(

Yusuke1998 avatar Apr 27 '24 22:04 Yusuke1998

Hello,

By adding data type to the data template you can partially solve this issue.

image

The type of Instance is object and basically it is the page already loaded. To have icon, i added a property of icon to each page. So in case to have avoid error on Icon too, in your app you can define a base class for your main page tabs and use the base type in your tab style and use it inside the template.

OmidID avatar Apr 30 '24 15:04 OmidID