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]: Cannot add a KryptonPage to a KryptonNavigator #1020

Closed
Wagnerp opened this issue May 22, 2023 · 19 comments
Closed

[Bug]: Cannot add a KryptonPage to a KryptonNavigator #1020

Wagnerp opened this issue May 22, 2023 · 19 comments
Labels
bug Something isn't working fixed This issue has been fixed. under investigation This bug/issue is currently under investigation.

Comments

@Wagnerp
Copy link
Contributor

Wagnerp commented May 22, 2023

As found in today's nightly build, 142.

KNavigator

@Wagnerp Wagnerp added the bug Something isn't working label May 22, 2023
@Smurf-IV
Copy link
Member

Smurf-IV commented May 23, 2023

What version of VS is that?
Perhaps "they" are starting to be more restrictive on the framework designer !

@Wagnerp
Copy link
Contributor Author

Wagnerp commented May 23, 2023

What version of VS is that?

Version 17.6.x, happens when using both .NET Framework & .NET

@Smurf-IV
Copy link
Member

I have been noticing that when trying to build / run the existing demo apps in the designer, that there are many errors.
I think it is an impact of the partial understanding of the nullable work that is still in progress.
OR, it is an impact of the designer moving forward forcing the rework required to use the new Visual Studio Way Of Working.

@Wagnerp
Copy link
Contributor Author

Wagnerp commented Jun 25, 2023

I have been noticing that when trying to build / run the existing demo apps in the designer, that there are many errors. I think it is an impact of the partial understanding of the nullable work that is still in progress. OR, it is an impact of the designer moving forward forcing the rework required to use the new Visual Studio Way Of Working.

@Smurf-IV Think I've worked it out... we're not checking for null when certain events are raised #1023 (comment)

@Smurf-IV
Copy link
Member

Also found via the fix for Krypton-Suite/Theme-Palettes#51

@Smurf-IV Smurf-IV self-assigned this Jun 25, 2023
@Smurf-IV Smurf-IV added the under investigation This bug/issue is currently under investigation. label Jun 25, 2023
@Smurf-IV
Copy link
Member

It's gonna take a while to sort and fix all these ..
image

@Wagnerp
Copy link
Contributor Author

Wagnerp commented Jun 25, 2023

I think @MHartmann-427 said that ReSharper can assist with this #1023 (comment)

@Smurf-IV
Copy link
Member

It can, but first you have to modify all the eventhandlers to be nullable....

@MHartmann-427
Copy link

No, ReSharper can assist you with this issue out-of-the-box.
Here's a small example:

ReSharper

The blue squiggle comes from ReSharper telling you about possible NullReferenceException.
So you can use menu "ReSharper" => "Inspect" => "Code Issues in Solution" and filter the result to show only "Possible 'System.NullReferenceException'" issue.

@Wagnerp
Copy link
Contributor Author

Wagnerp commented Jun 26, 2023

Once a few are done (in a file), you can let AI do the rest

@Wagnerp
Copy link
Contributor Author

Wagnerp commented Jun 26, 2023

@Smurf-IV I've now fixed this, will be in the next PR :)

@Wagnerp Wagnerp changed the title [Bug]: Cannot add a KPage to a KNavigator [Bug]: Cannot add a KryptonPage to a KryptonNavigator Jun 26, 2023
Wagnerp added a commit that referenced this issue Jun 26, 2023
@Wagnerp Wagnerp mentioned this issue Jun 26, 2023
@Wagnerp
Copy link
Contributor Author

Wagnerp commented Jun 27, 2023

Please test in latest nightly >= .178

@MHartmann-427
Copy link

There are still a lot of nullability issues in the code.
Next crash (again a NullReferenceException) in class "ViewDrawMenuItem", method "ShowSubMenu".

Here's the stack trace:
bei Krypton.Toolkit.ViewDrawMenuItem.ShowSubMenu(Boolean keyboardActivated)
bei Krypton.Toolkit.MenuItemController.ShowSubMenu()
bei Krypton.Toolkit.ViewContextMenuManager.OnDelayTimerExpire(Object sender, EventArgs e)
bei System.Windows.Forms.Timer.OnTick(EventArgs e)
bei System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Can't tell you which object is NULL and causes this exception, sorry.

I think the alpha branch is far, far away from being testable because of all those nullability issues. I still can't understand, why all the nullability checks that exist in version 70 are removed in version 80.

@Wagnerp
Copy link
Contributor Author

Wagnerp commented Jun 27, 2023

I still can't understand, why all the nullability checks that exist in version 70 are removed in version 80.

I think it was something to do with introducing nullables. I'll be away on holiday until Tuesday, so can't do anymore work until then.

@Wagnerp
Copy link
Contributor Author

Wagnerp commented Jun 29, 2023

Might need more work to be done on this

@Wagnerp
Copy link
Contributor Author

Wagnerp commented Jul 1, 2023

There are still a lot of nullability issues in the code.
Next crash (again a NullReferenceException) in class "ViewDrawMenuItem", method "ShowSubMenu".

Here's the stack trace:
bei Krypton.Toolkit.ViewDrawMenuItem.ShowSubMenu(Boolean keyboardActivated)
bei Krypton.Toolkit.MenuItemController.ShowSubMenu()
bei Krypton.Toolkit.ViewContextMenuManager.OnDelayTimerExpire(Object sender, EventArgs e)
bei System.Windows.Forms.Timer.OnTick(EventArgs e)
bei System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Can't tell you which object is NULL and causes this exception, sorry.

I think the alpha branch is far, far away from being testable because of all those nullability issues. I still can't understand, why all the nullability checks that exist in version 70 are removed in version 80.

Duplicate of #1034

Smurf-IV added a commit that referenced this issue Jul 2, 2023
- Weekends work on Nullables (Still not complete yet)
- Work on some xml intellisense warnings
- Add `?` to all event type declarations
- Start to work on using `##?.Invoke` for eventhandlers
- Replace `new()` with a standard format so that ?## new() is not confusing

#1020
@Smurf-IV
Copy link
Member

Smurf-IV commented Jul 8, 2023

It's gonna take a while to sort and fix all these ..
image

Smurf-IV added a commit that referenced this issue Jul 8, 2023
- observe nullables as files are modified

#1020
@Smurf-IV
Copy link
Member

Smurf-IV commented Jul 9, 2023

I'll start to work on this bug (And others I have found during the investigation) when PtIV(#1046) has been merged (It'll probably be next weekend now)

@Smurf-IV
Copy link
Member

Build after PtIV merge appears to work (May have been fixed earlier, but this is what the following video is from)
Taken with Current alpha (After PtIV merge) in Visual Studio 17.7.P3
NavigatorPages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed This issue has been fixed. under investigation This bug/issue is currently under investigation.
Projects
None yet
3 participants