Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Breadcrumb - Cannot Add items to Root via the designer. #665

Closed
giduac opened this issue Mar 8, 2022 · 32 comments
Closed

[Bug]: Breadcrumb - Cannot Add items to Root via the designer. #665

giduac opened this issue Mar 8, 2022 · 32 comments
Labels
area:designer All issues related to the designer. bug Something isn't working help wanted Extra attention is needed in progress A fix for this issue is in the works.
Milestone

Comments

@giduac
Copy link
Contributor

giduac commented Mar 8, 2022

Describe the bug
The RootItem/Items collection is not accessible via the designer.

Works in NET480
Does not work in Net31/50/60
Tried several TK version including stable, canary and nightlies.

To Reproduce
Add a KBreadcrumb to the form
Try to add items

Expected behavior
N/A

Screenshots
N/A

Desktop (please complete the following information):

  • OS: W10/11

Additional context
Items can be added programmatically.

@giduac giduac added the bug Something isn't working label Mar 8, 2022
@giduac
Copy link
Contributor Author

giduac commented Mar 17, 2022

@Wagnerp
This is probably also a candidate to be included in the April release

@PWagner1
Copy link
Contributor

Hi @giduac

Can you provide a video of the bug/exception?

@giduac
Copy link
Contributor Author

giduac commented Mar 17, 2022

@Wagnerp there you go,

No exception there.
In the designer the breadcrumb property (collection) RootItem->Items has no button to manage those items.
At runtime it does show this collection button in a property-grid and items are accessible.

Design time
https://user-images.githubusercontent.com/96108132/158830248-2ec53970-3a71-4221-a5f7-b8d2a8939170.mp4

Run time
https://user-images.githubusercontent.com/96108132/158830241-12def720-bf13-4bab-a41b-cfdb9317e22f.mp4

@PWagner1
Copy link
Contributor

Hi @giduac

Thanks for posting, looks as if something is missing

@PWagner1
Copy link
Contributor

@giduac & @Smurf-IV

Is there anything here that stands out?

image

@giduac
Copy link
Contributor Author

giduac commented Mar 17, 2022

@Wagnerp

All works in NET48
Does not work in Net31/50/60
Tried several TK version including stable, canary and nightlies....

@giduac
Copy link
Contributor Author

giduac commented Mar 17, 2022

@Wagnerp

Could this difference be it (taken from KryptonContextMenuCollections.cs) .

According to the docs for Type.AssemblyQualifiedName
https://docs.microsoft.com/en-us/dotnet/api/system.type.assemblyqualifiedname?view=net-6.0

[Editor( @"Krypton.Toolkit.KryptonContextMenuCollectionEditor, Krypton.Toolkit", typeof( UITypeEditor ) )]

[Editor( @"Krypton.Toolkit.KryptonBreadCrumbItemsEditor", , typeof( UITypeEditor ) )]

@PWagner1
Copy link
Contributor

@Wagnerp

Could this difference be it (taken from KryptonContextMenuCollections.cs) .

According to the docs for Type.AssemblyQualifiedName https://docs.microsoft.com/en-us/dotnet/api/system.type.assemblyqualifiedname?view=net-6.0

[Editor( @"Krypton.Toolkit.KryptonContextMenuCollectionEditor, Krypton.Toolkit", typeof( UITypeEditor ) )]

[Editor( @"Krypton.Toolkit.KryptonBreadCrumbItemsEditor", , typeof( UITypeEditor ) )]

Might be, lets check

@PWagner1
Copy link
Contributor

Hi @giduac

Yes, that works. It'll be in tomorrows nightly build.

@PWagner1 PWagner1 self-assigned this Mar 17, 2022
@PWagner1 PWagner1 added the in progress A fix for this issue is in the works. label Mar 17, 2022
@PWagner1 PWagner1 added this to the April 2022 milestone Mar 17, 2022
PWagner1 added a commit that referenced this issue Mar 17, 2022
@giduac
Copy link
Contributor Author

giduac commented Mar 17, 2022

@Wagnerp

Did a search for these editor attribute strings and there are several that are missing the assembly name.
Not sure if that will lead to the same problem but having a look at it and test it on the different framework versions might the right thing to do, just to make sure...

Search "[Editor(" (99 hits in 50 files of 1425 searched)
  ** Source\Krypton Components\Krypton.Navigator\Page\KryptonPage.cs (2 hits)
	Line 624:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 654:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Ribbon\Controls Ribbon\KryptonRibbonQATButton.cs (2 hits)
	Line 274:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 285:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Ribbon\Group Contents\KryptonRibbonGroupComboBox.cs (6 hits)
	Line 424:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Ribbon\Group Contents\KryptonRibbonGroupDomainUpDown.cs (2 hits)
	Line 224:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Ribbon\Group Contents\KryptonRibbonGroupRichTextBox.cs (2 hits)
	Line 403:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Ribbon\Group Contents\KryptonRibbonGroupTextBox.cs (3 hits)
	Line 369:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Ribbon\Palette\RibbonAppButton.cs (4 hits)
	Line 355:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 369:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\ButtonSpec\ButtonSpec.cs (4 hits)
	Line 257:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 290:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 389:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 423:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\ContextMenu\KryptonContextMenuHeading.cs (2 hits)
	Line 117:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 140:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\ContextMenu\KryptonContextMenuItem.cs (3 hits)
	Line 231:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 255:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Controls Toolkit\KryptonButton.cs (1 hit)
	Line 155:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Controls Toolkit\KryptonCheckBox.cs (1 hit)
	Line 226:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Controls Toolkit\KryptonColorButton.cs (1 hit)
	Line 274:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Controls Toolkit\KryptonCommand.cs (2 hits)
	Line 177:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 206:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Controls Toolkit\KryptonDropButton.cs (1 hit)
	Line 167:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Controls Toolkit\KryptonGroupBox.cs (1 hit)
	Line 209:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Controls Toolkit\KryptonHeader.cs (1 hit)
	Line 172:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Controls Toolkit\KryptonHeaderGroup.cs (1 hit)
	Line 311:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Controls Toolkit\KryptonLabel.cs (1 hit)
	Line 139:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Controls Toolkit\KryptonRadioButton.cs (1 hit)
	Line 206:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Controls Toolkit\KryptonRichTextBox.cs (2 hits)
	Line 673:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Controls Toolkit\KryptonTaskDialogCommand.cs (2 hits)
	Line 131:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 160:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Controls Toolkit\KryptonTextBox.cs (3 hits)
	Line 711:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Palette Base\PaletteBorder\PaletteBorder.cs (1 hit)
	Line 210:         [Editor(@"Krypton.Toolkit.PaletteDrawBordersEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Palette Component\KryptonPaletteButtonSpecTyped.cs (3 hits)
	Line 153:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 186:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 219:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Values\ButtonValues.cs (2 hits)
	Line 171:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 206:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Values\ColorButtonValues.cs (2 hits)
	Line 182:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 217:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Values\HeaderValuesBase.cs (2 hits)
	Line 181:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 222:         [Editor(@"System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Toolkit\Values\LabelValues.cs (2 hits)
	Line 162:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 203:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
  ** Source\Krypton Components\Krypton.Workspace\Workspace\KryptonWorkspaceCollectionEditor.cs (2 hits)
	Line 183:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]
	Line 195:         [Editor("System.ComponentModel.Design.MultilineStringEditor", typeof(UITypeEditor))]

@PWagner1
Copy link
Contributor

PWagner1 commented Mar 17, 2022

Hi @giduac

Thanks for this info, the only 'fixable' one might be:

** Source\Krypton Components\Krypton.Toolkit\Palette Base\PaletteBorder\PaletteBorder.cs (1 hit) Line 210: [Editor(@"Krypton.Toolkit.PaletteDrawBordersEditor", typeof(UITypeEditor))]

@Smurf-IV Is this true?

@PWagner1
Copy link
Contributor

Hi @giduac

Could you possibly retest using nightly build >= .77?

@PWagner1 PWagner1 added awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. help wanted Extra attention is needed and removed awaiting feedback A fix for this issue has been implemented, waiting for feedback on the fix. labels Mar 18, 2022
@giduac
Copy link
Contributor Author

giduac commented Mar 18, 2022

@Wagnerp
The fix from yesterday didn't work.

I've added the Editor line also to the items property and that seems to work.
The items can be edited from the IDE now.
At runtime also in net31/net48/net50/net60

You might give this a try yourself... and add it to the next Nightly??

image

PWagner1 added a commit that referenced this issue Mar 18, 2022
@PWagner1
Copy link
Contributor

@Wagnerp The fix from yesterday didn't work.

I've added the Editor line also to the items property and that seems to work. The items can be edited from the IDE now. At runtime also in net31/net48/net50/net60

You might give this a try yourself... and add it to the next Nightly??

image

@giduac

Will be in tomorrows nightly build

@giduac
Copy link
Contributor Author

giduac commented Mar 18, 2022

Hi @Wagnerp,

I build the Palette Designer locally without packages and added a BreadCrumb to it. And it actually doesn't work.
Here's why.

The order of the TargetFrameworks in the .csproj file dictates which toolkit.dll is active in the designer.

In this case it works in the designer.

<TargetFrameworks>net48;net5.0-windows;net6.0-windows</TargetFrameworks>

And in this order not. So the first TargetFrameworks is the one that is loaded

<TargetFrameworks>net5.0-windows;net6.0-windows;net48</TargetFrameworks>

And as soon as you create an app with NuGet packages and target anything except net48 it doesn't work. Just like building the app in the source tree

So that editor line on the items property has no effect.
And the problem still exists....

@PWagner1
Copy link
Contributor

Hi @giduac

I think for V7 (aka 70.22.11.xx), separate packages for pre .NET Core could be on the cards, i.e. Legacy packages?

@giduac
Copy link
Contributor Author

giduac commented Mar 18, 2022

@Wagnerp
But net48 is the only that works in the designer.
So for the other versions a fix is still required.

@giduac
Copy link
Contributor Author

giduac commented Mar 18, 2022

@Wagnerp @Smurf-IV

Been looking around a bit, and found some info. As it looks it could be connected to the WinForms Designer's for .Net3/5/6. ongoing development.

dotnet/winforms#4304
https://developercommunity.visualstudio.com/t/net-5-winforms-designer-ignores-systemcomponentmod/1398197

@giduac
Copy link
Contributor Author

giduac commented Mar 19, 2022

@Wagnerp @Smurf-IV

To test the info above I also tried it with KTreeView.
Unlike with the BreadCrumb here the button to start the Nodes editor is visible.

Just like the BreadCrumb, KTreeView node editor also doesn’t work with Net3/5/6
But does with Net48.

At runtime the Nodes editor is accessible from a property-grid. Just like the BreadCrumb.

This happens when trying to edit the Nodes collection.
image

@giduac
Copy link
Contributor Author

giduac commented Mar 19, 2022

@Smurf-IV @Wagnerp

On KNavigator:

Like KTreeView and KBreadCrumb node editors, the KNavigator page editor is also derived from CollectionEditor.
In KNavigator the Pages collection editor does work in the designer and at runtime on all .Net versions.

@giduac
Copy link
Contributor Author

giduac commented Mar 19, 2022

@Smurf-IV @Wagnerp

KContextMenu

KryptonContextMenuCollectionEditor derives from CollectionEditor

Net48 works normal
In Net3/5/6
Items editor can be started in the designer
But as soon as one of the buttons is clicked to add an item the form closes.

At runtime all .NET versions can start the editor and edit items.

@giduac
Copy link
Contributor Author

giduac commented Mar 19, 2022

A possible workaround would be to include net48 as the first framework in the <TargetFrameworks> line of the .csproj when working on a .Net3/5/6 project.

In that way the project can be edited from the designer and when compiling this goes into to the higher .Net version.

Edit:
Note: That would only aid the graphical portion. Because the first framework then will also put the project in Net48 mode instead of the higher one.

@PWagner1
Copy link
Contributor

A possible workaround would be to include net48 as the first framework in the <TargetFrameworks> line of the .csproj when working on a .Net3/5/6 project.

In that way the project can be edited from the designer and when compiling this goes into to the higher .Net version.

Edit: Note: That would only aid the graphical portion. Because the first framework then will also put the project in Net48 mode instead of the higher one.

That would need to be done on the developers part, since the packages already contain binaries from 4.6.2 - .NET 6/7 (nightly releases)

@giduac
Copy link
Contributor Author

giduac commented Mar 19, 2022

That would need to be done on the developers part, since the packages already contain binaries from 4.6.2 - .NET 6/7 (nightly releases)

Yes a workaround on the dev's side. But it's not ideal.

The odd one out is the KNavigator pages editor. That one does work. And is derived from the same class as the others.
So it could be that the incompatibility is present in the other Krypton editors objects. So it might be good to have a deeper look at that, as this tends to a possible solution.

@PWagner1 PWagner1 modified the milestones: April 2022, Backlog Mar 20, 2022
@PWagner1
Copy link
Contributor

That would need to be done on the developers part, since the packages already contain binaries from 4.6.2 - .NET 6/7 (nightly releases)

Yes a workaround on the dev's side. But it's not ideal.

The odd one out is the KNavigator pages editor. That one does work. And is derived from the same class as the others. So it could be that the incompatibility is present in the other Krypton editors objects. So it might be good to have a deeper look at that, as this tends to a possible solution.

More investigation needs to be done, I don't think this can be done in the April 2022 build. But a workaround will be noted in the readme.

@giduac
Copy link
Contributor Author

giduac commented Mar 21, 2022

Also needs keeping an eye on the status of the ongoing development of the WinForms designer for the higher .NET versions.
Since that might resolve (some of )this as well.

@giduac
Copy link
Contributor Author

giduac commented Mar 26, 2022

Hi @Wagnerp & @Smurf-IV ,

I've been doing some more digging on this topic / the Out Of Process WinForms Designer (SDK).
In the next week (probably) I will open a new discussion with findings on this topic as a central point to collect, discuss and make available information over time.....

@giduac
Copy link
Contributor Author

giduac commented Mar 31, 2022

Announced discussion has been opened here:
#684

@Frostchi
Copy link

Frostchi commented Dec 2, 2022

Trying to use net48 causes the majority of my program to break (it complains I can't use the C#8 and later features). Not sure if this is considered a great workaround.

@Smurf-IV
Copy link
Member

Smurf-IV commented Dec 2, 2022

Note: I "use" c# 11 features in my .net48 program. It is a Targetting thing to do with the compiler, not the loaded / target framework usage:
image

@PWagner1
Copy link
Contributor

@Smurf-IV Hasn't this been recently fixed or am I imagining it?

@Smurf-IV Smurf-IV added the area:designer All issues related to the designer. label Sep 22, 2023
@Smurf-IV
Copy link
Member

As per comment on on Mar 17, 2022

All works in NET48 Does not work in Net31/50/60 Tried several TK version including stable, canary and nightlies....

I have noticed that the Framework tends not to work as expected in Preview builds of Visual Studio, and one it is released, it then takes a patch update to get the .net48 designer working again. (Like it currently is for 17.8.p1)
This might be generated by that time window.

@PWagner1 PWagner1 removed their assignment Sep 22, 2023
@giduac giduac closed this as completed Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:designer All issues related to the designer. bug Something isn't working help wanted Extra attention is needed in progress A fix for this issue is in the works.
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants