Closed KaranocaVe closed 2 months ago
OK, I have read the source code and changed to private ObservableCollection<SukiSideMenuItem> _menuItems;
, then it works
New to Avalonia. Don't know C#.
Why does that work? Seems black-boxy and suggests documentation could use a touch-up.
Edit: e.g why must you use a specific data type for this, when as far as I could tell the Demo uses a readonly list of DemoPageBase
.
The Demo implementation uses DI, making it easy to handle changes in the number of pages through reflection, which is mainly for managing multiple instances of Views.
You can also set up your own 'bindings' to Views (like DataContext or ViewLocator) and ViewModels. However, these implementations are beyond the scope of this documentation.
Suggestion
I'm a beginner for AvaloniaUI based on MVVM. I'm trying to implement side menu function in my app following the example in document. This is my code`