Rocko Bonaparte
Topic Author
Posts: 39
Joined: 13 Oct 2020, 08:32

Re: Adjusting to new NoesisGUI release for Unity

30 Sep 2022, 09:31

Probably. Please humor me a bit and then I might end up just using the thread to talk to myself this weekend afterwards. I increased the verbosity and it was at least telling me what successfully loaded beforehand. I can see my theme.xaml was loaded. Right after that, it complains about not finding B.xaml. It's all happening within A's codebehind in LoadComponent.

I think what that at least tells me is the theme is probably not the culprit. That's good because at lot of the theme is kind of yoinked. Well, I shouldn't be surprised then because it isn't like I have it referencing controls and stuff; it shouldn't be the problem.

I guess at this point I can just kind of go through all the names of things in the xaml, make a list of theme, and find their provenance. The view model was already ripped out into a separate file and didn't need to directly referencing any Xaml (which I should assume is a good and correct thing). So maybe I just have some term that's dragging in B.xaml somehow through namespaces (?).

Personally I'm surprised it's finding something it apparently is convinced it needs from B.xaml without me having done anything directly in A.xaml to say that file even exists. But B.xaml kind of describes the parent control so they do have at least an implicit association.

You know the problem with descriptive code like XAML is you can't just, like, shove some print statements in it and see where it croaks. :p
 
User avatar
jsantos
Site Admin
Posts: 3548
Joined: 20 Jan 2012, 17:18
Contact:

Re: Adjusting to new NoesisGUI release for Unity

30 Sep 2022, 14:27

Could you keep simplifying A.xaml till the point where it no longer triggers B.xaml?

We do tricky things when calculating dependencies. For example, if your XAML uses a custom control whose name is "B" and we find a pair B.xaml and B.xaml.cs then B.xaml is added as a dependency of A.xaml. But I don't think this is your case because B is not listed in the list of dependencies displayed by the inspector.
 
Rocko Bonaparte
Topic Author
Posts: 39
Joined: 13 Oct 2020, 08:32

Re: Adjusting to new NoesisGUI release for Unity

02 Oct 2022, 00:55

I haven't fixed it but I've figured out the GameControl class I'm using for the control in A.xaml is at play since:

1. I can pretty much declare that in an otherwise empty xaml and hit the reference B.xaml.
2. The source for it is what I basically define in B.xaml DUN DUN DUN.

It's the joy of legacy code. B.xaml is technically called "MainWindow.xaml" but it should probably just be called GameControl.xaml. So there's my first bit of fun; I really should rename it. It probably was just frozen like that from when I was fidgeting around and finally got the Jenga Tower of code to work the first time. This makes me think I should actually have it as a resource in A.xaml, which did cause a pile of errors that implied it should be there. The real problems are probably with those errors.
 
Rocko Bonaparte
Topic Author
Posts: 39
Joined: 13 Oct 2020, 08:32

Re: Adjusting to new NoesisGUI release for Unity

03 Oct 2022, 08:41

I managed to fix it and I don't really know why. I even have a git commit where I can just go back and forth between working and not working, and I have played with it. There were two things I did:

1. Renamed a control between it's XAML, codebehind, and its references everywhere.
2. Removed a public class member that was a NoesisXaml that took a manually-assigned asset of that control.

So, hey, that #2 there is looking pretty important! So the first problem is I literally didn't use that NoesisXaml member anywhere. But more importantly, I've been merrily flipping back and forth on the commit with just that change, and it's inconsequential. If I go backwards in the history and just apply #2, it still fails. If I go to the present and revert #1, it starts to fail.

I mean, it's working now, but I don't really have a lesson learned.
 
User avatar
jsantos
Site Admin
Posts: 3548
Joined: 20 Jan 2012, 17:18
Contact:

Re: Adjusting to new NoesisGUI release for Unity

03 Oct 2022, 13:11

I don't have enough information to help here. But, at least, happy to hear it is working for you now. Thanks for sharing your experience.

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Semrush [Bot] and 0 guests