AvaloniaUI / Avalonia.Samples

Avalonia.Samples aims to provide some minimal samples focusing on a particular issue at a time. This should help getting new users started.
https://www.avaloniaui.net
606 stars 103 forks source link

Issues with the guide "ToDo List app" #58

Open Biepa opened 1 year ago

Biepa commented 1 year ago

Describe the bug I'm new to Avalonia and MVVM, so I wanted to take one of the tutorials to get easily started. But the guide is not matching with the current Avalonia version in terms of stuff looking different in Visual Studio and on the guide.

To Reproduce Steps to reproduce the behavior:

  1. Follow this guide step by step: https://docs.avaloniaui.net/docs/next/tutorials/todo-list-app/

Expected behavior A beginners guide is most useful when it can be followed 100% the experience described. Please let someone knowledgable go through it and fix the issues coming up in the documentation.

Screenshots

Issue 1

As an example I adjusted my content like shown here: https://docs.avaloniaui.net/docs/next/tutorials/todo-list-app/main-window-content grafik But getting an error of "Unable to resolve type MainWindowViewModel from namespace using:ToDoList.ViewModels Line 13, position 6" As correctly the "MainWindowViewModel" is not created it seems. grafik

Issue 2

Here is written "Locate the Models folder": https://docs.avaloniaui.net/docs/next/tutorials/todo-list-app/creating-a-model Which is not created by default.

Same issue here: https://docs.avaloniaui.net/docs/next/tutorials/todo-list-app/creating-a-view-model#view-model-to-model-dependency As "MainWindowViewModel" is not existing

This leads to other issues later on following the guide.

Desktop (please complete the following information):

Additional context For me as beginner it's hard to get into Avalonia and MVVM programming when the basic tutorial is not working. As I'm confused by the missing MainWindowViewModel and other stuff. I solved some if it by looking at other tutorials but that's not the intention of a tutorial for new users. Sure it's an additional learning oportunity, but I would like to understand the basics first before I start debugging it.

Thanks you

timunie commented 1 year ago

Hi @Biepa and welcome,

... yeah we had a huge release a few weeks ago which changed just a lot. I need to work on this sample to update it. It's on my list, but as I have to do it after my "normal" job it takes some time. Sorry for the inconvenience 🙈 .

Meanwhile please also explore: https://github.com/AvaloniaUI/Avalonia.Samples It's already up to date.

also feel free to join out telegram community chat: https://t.me/Avalonia

Note: I'll move this issue into Avalonia.Samples as this is where it belongs to. Stay tuned :-)

Happy coding Tim

Biepa commented 1 year ago

Hey @timunie, Thank you very much for your reponse. I will have a look at the samples in the meanwhile 👍

Biepa commented 1 year ago

Hey @timunie, The api reference is also in the "pre-release" state. Is that correct? So it's "Avalonia.Samples" or the "Avalonia" repos that can be taken as a reference, correct?

timunie commented 1 year ago

yeah the reference docs are only 0.10.x and not for 11.0 as we didn't find a good solution for it work yet. Afaik it should be back to life at a certain point, but hasn't high priority. Tbh, we think the source is much more useful then the reference API

Biepa commented 1 year ago

Thanks for the fast reply. I will give it a shot with the source. Though it's quite hard for a beginner not to have some examples. If that doesn't work out I may join the Telegram and ask some questions 😅

If it could be noted on the reference API and the v11 docs that it's not up to date it could save other users time and frustration.

BlueJay2022 commented 9 months ago

Similar issue Just starting, and on macOS, MainViewModel.cs was not in the folders created by dotnet new

timunie commented 9 months ago

@BlueJay2022 can you specify more? Which IDE, which Avalonia-Template version? Which kind of Template did you used?

BlueJay2022 commented 9 months ago

Thanks for the response I used vs code on a Mac 2023 m2 Dotnet new Avalonia.app This is my first ever work on a Mac so I can’t say with certainty i did everything correctly

Sent from my iPhone

On Dec 11, 2023, at 3:42 AM, Tim @.***> wrote:



@BlueJay2022https://github.com/BlueJay2022 can you specify more? Which IDE, which Avalonia-Template version? Which kind of Template did you used?

— Reply to this email directly, view it on GitHubhttps://github.com/AvaloniaUI/Avalonia.Samples/issues/58#issuecomment-1849563489, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWPU4JJITVLHXSVZPKTJOATYI3BO3AVCNFSM6AAAAAA3X64XNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBZGU3DGNBYHE. You are receiving this because you were mentioned.Message ID: @.***>

timunie commented 9 months ago

I remember issues with Mac M2 but I have no mac to test. What I can tell you is however, that you should use the MVVM template if you want to have a MainViewModel creaded:

dotnet new avalonia.mvvm -o BasicMvvmSample
cd BasicMvvmSample

(https://github.com/AvaloniaUI/Avalonia.Samples/tree/main/src/Avalonia.Samples/MVVM/BasicMvvmSample#command-line)

pghezzo commented 5 months ago

I have been able to follow the guide up to https://docs.avaloniaui.net/docs/tutorials/todo-list-app/navigate-views but not luck afterwards. I am stuck at this point where I don't understand why the Content is not being rendered. image I'll pivot to the samples in the meantime.