Replies: 1 comment 4 replies
-
When running in the visual studio design viewer, The viewmodel what is used in the design view should be provided by the use of in the MainWindow.axaml or MainView.axaml file. <Design.DataContext>
<vm:MainWindowViewModel />
</Design.DataContext> What is the constructor being used for that? Is your MainWindowViewModel constructor being called with a IServiceProvider that has not had a |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! I've set up DI to get services passed around my views without the all the hassle of passing my services around. This works, but the axaml live view isn't happy with me and it's becoming tiresome
App->OnFrameworkInitializationCompleted
MainWindowViewModel->ctor
The code compiles and runs fine, but when I go to the view, I get an error in the Error List, and I can't see the live view:
![image](https://private-user-images.githubusercontent.com/2433994/409625625-e9ff77c0-1694-4eb8-bbd5-619071dd395a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNDU0NjYsIm5iZiI6MTczOTE0NTE2NiwicGF0aCI6Ii8yNDMzOTk0LzQwOTYyNTYyNS1lOWZmNzdjMC0xNjk0LTRlYjgtYmJkNS02MTkwNzFkZDM5NWEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDlUMjM1MjQ2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjhiZjJiMzQ5YWRlMDhmMDZmZmQ5OTMzNTQxZTA5ZTdlMzdhODc2ZjcyM2FkZmNkMTg4ZDQwNWJkZjZhN2I2NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.ye2Jm5RDzbVHKbzDVtmTfPQY2JiyYZX5gy762YoZz-o)
From what I can tell, this is an issue with Avalonia trying to be clever and give me a nice preview of my app. While that would be great, it's clearly not working, so I'd rather I could disable whatever feature is causing this and be able to see my window
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions