GithubHelp home page GithubHelp logo

Comments (8)

AngeloCresta avatar AngeloCresta commented on June 15, 2024 1

Ok, I'll update my code to be sure that the custom palette is always inialized.
Thanks

from standard-toolkit.

giduac avatar giduac commented on June 15, 2024

Hi @AngeloCresta

Which version of the toolkit are you using?
Did you try other versions, and if so was the error present as well ?
Can you please provide a simple sample project that demonstrates the error?

from standard-toolkit.

AngeloCresta avatar AngeloCresta commented on June 15, 2024

<TargetFrameworks>net8.0-windows</TargetFrameworks>

Not really, the project is huge and integrates Krypton at many levels with my other framework (ModernUI) and I've faced that error on integrating the canary version (due to all the breaking changes introduced..)

I can modify the code once is released don't worry.

Here the sample "palette designer" application behaviour with ModernUI form and theme and color with all the krypton controls styled accodingly (slow - debug)
ModernUI-KryptonIntegration

Regards,
Angelo

from standard-toolkit.

giduac avatar giduac commented on June 15, 2024

Which Canary version of the toolkit are you using?

from standard-toolkit.

AngeloCresta avatar AngeloCresta commented on June 15, 2024

I grab the version from GitHub yesterday, based on your label v90.24.4.113-beta

from standard-toolkit.

giduac avatar giduac commented on June 15, 2024

The above video does not show anything going wrong.
The current code actually does null checking and that code is also present in the master branch. So earlier versions will act the same.

So we need some more info about how & what exactly is happening?

        private void SetPalette(PaletteBase basePalette)
        {
            if (basePalette != _basePalette)
            {
                Debug.Assert(_basePalette != null);

                // Unhook from current palette events
                if (_basePalette != null)
                {
                    _basePalette.PalettePaint -= OnPalettePaint;
                    _basePalette.ButtonSpecChanged -= OnButtonSpecChanged;
                    _basePalette.BasePaletteChanged -= OnBasePaletteChanged;
                    _basePalette.BaseRendererChanged -= OnBaseRendererChanged;
                }

                // Remember the new palette
                _basePalette = basePalette;

                // Make sure the redirector passes requests onto the base palette
                _redirector.Target = _basePalette;

                // Update the color table we inherit from
                ToolMenuStatus.BaseKCT = _basePalette.ColorTable;

                // Hook to new palette events
                if (_basePalette != null)
                {
                    _basePalette.PalettePaint += OnPalettePaint;
                    _basePalette.ButtonSpecChanged += OnButtonSpecChanged;
                    _basePalette.BasePaletteChanged += OnBasePaletteChanged;
                    _basePalette.BaseRendererChanged += OnBaseRendererChanged;
                }
            }
        }

from standard-toolkit.

AngeloCresta avatar AngeloCresta commented on June 15, 2024

No, because I've added this on the method:

   private void SetPalette(PaletteBase basePalette)
        {
            if (basePalette == null)
            {
                basePalette  = new KryptonCustomPaletteBase();
            }
            ....

Commenting it out I have:

ModernUI-KryptonIntegration-Error

But, as I said, is up to you ...
Angelo

from standard-toolkit.

giduac avatar giduac commented on June 15, 2024

I see, but: basePalette is not nullable and should be a valid param to a palette.

from standard-toolkit.

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.