Giter Site home page Giter Site logo

Comments (6)

maxkatz6 avatar maxkatz6 commented on June 27, 2024 1

Never seen this application of ColumnDefinitions, but looks handy.

from avalonia.

workgroupengineering avatar workgroupengineering commented on June 27, 2024 1

the problem is there

set
{
if (_extData == null) { _extData = new ExtendedData(); }
_extData.ColumnDefinitions = value;
_extData.ColumnDefinitions.Parent = this;
InvalidateMeasure();
}

exactly on line 181.

StaticResource return same instance for each grid.

two possible solutions could be:

  • Deep cloning like this code:

              set
              {
                  if (_extData == null) { _extData = new ExtendedData(); }
                  var def = value is null
                      ? new ColumnDefinitions()
                      : new ColumnDefinitions(value.Count);
                  if (value is not null)
                  {
                      foreach (var item in value)
                      {
                          def.Add(new ColumnDefinition()
                          {
                              MaxWidth = item.MaxWidth,
                              MinWidth = item.MinWidth,
                              SharedSizeGroup = item.SharedSizeGroup,
                              Width = item.Width,
                          });
                      }
                  }
                  _extData.ColumnDefinitions = def;
                  _extData.ColumnDefinitions.Parent = this;
                  InvalidateMeasure();
              }
  • x:Shared directive like WPF

Personally I prefer x:Shared

from avalonia.

rabbitism avatar rabbitism commented on June 27, 2024

DefinitionBase holds many calculation and status of groups, especially SharedSizeGroup, i doubt if this is even possible.

from avalonia.

workgroupengineering avatar workgroupengineering commented on June 27, 2024

Can i work on x:Shared?

from avalonia.

kekekeks avatar kekekeks commented on June 27, 2024

Given that we already have support for resource factories for lazy resource loading, x:Shared can be implemented by calling AddNotShared (or smth) instead of AddDeferred.

from avalonia.

timunie avatar timunie commented on June 27, 2024

Can i work on x:Shared?

I talked to the team and we would be happy if you help us to get this implemented.

Nikita [15.05.2024 09:29]
it shouldn't be that hard to implement since we already have resource factories for lazy resource loading

Nikita [15.05.2024 09:30]
so it might be implemented as calling AddShared instead of AddDeferred"

from avalonia.

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.