Code Monkey home page Code Monkey logo

Comments (2)

KentSwan avatar KentSwan commented on June 13, 2024

In some derivative testing, I found that in the CommunityToolkit.Mvvm variant view would not be initialized when the tab was selected the first time. This was because the load function for the ViewModel's drive data had not been set up before the view was initialized. Adding setting the view DataContext in the View's constructor solves this issue. See the code below.


namespace TreeDataGridDemo.Views
{
    public partial class WikipediaPageView : UserControl
    {
        public WikipediaPageView()
        {
            InitializeComponent();

            this.DataContext = new WikipediaPageViewModel();
        }
    }
}

from avalonia.controls.treedatagrid.

KentSwan avatar KentSwan commented on June 13, 2024

Avalonia.Controls.TreeDataGridDemo.2024-02-26.zip file attached contains working ReactiveUI and CommunityToolkit.MVVM MVVM form projects as an alternative to the equivalent in the GitHub TreeDataGrid distribution. This new code base has been updated to include the initialization update noted above as well as removing the use of stack panel in MainWindow.axaml as the TabControl Views container for TreeDataGrid views. (See issues and solutions found posted separately relating to the TreeDataGrid scroll bars being functional and visible).

I hope this work provides a Rosetta Stone-like capability for other developers. Going through this code normalization, transformation, and evolution exercise for the two Avalonia MVVM support systems has been an eye-opening learning experience.

Avalonia.Controls.TreeDataGridDemo 2024-02-26.zip

from avalonia.controls.treedatagrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.