AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
26.12k stars 2.26k forks source link

The ToDoList tutorial fails at the 'add a data context' step #15757

Closed jocstar closed 6 months ago

jocstar commented 6 months ago

Describe the bug

The ToDoList tutorial example fails at the Add A Data Context step.
At this step with the 11.0.2 packages, it builds and runs but you get a window with some text at the top but not the expected content. I updated the Avalonia packages to 11.0.10 which seem to be the latest at this time according to nuget (disclaimer, Im a 20 years Java/C++ dev unfamiliar with C# so in at the deep end here and not confident with what im doing) you instead get a window frame with a transparent center that just shows whatever was behind it.

I also found a working project on github at https://codeload.github.com/Cyberphinx/AvaloniaUI-TodoList/zip/refs/heads/master but this was on 0.10.10 and .net 5.0. I tried to update this to the same .net7 and Avalonia 11.0.10 I was using, and when I got something to build and run I got the same transparent content.

To Reproduce

Follow the steps from the example here using the latest VisualStudio plugin. On creating the project, the tutorial is out of date and doesn't match what you see in VS, but I just used the defaults, desktop app, reactiveUI and no other options selected (although I have tried multiple variations choosing the community MVVM / compiled bindings options but had even less success with them.

Expected behavior

I expect to see the UserControl being displayed within the Window control as the tutorial shows it to be, but instead get transparent content as shown in the hopefully attached image.

Avalonia version

11.0.10

OS

Windows

Additional context

image

timunie commented 6 months ago

You probably want to give this new tutorial a try and give us some feedback on it. It's not yet released and thus in a preview branch of my fork, so don't get confused please.

https://github.com/timunie/Avalonia.Samples/tree/feat%2FToDoListApp/src%2FAvalonia.Samples%2FCompleteApps%2FSimpleToDoList