KeldorKatarn
Topic Author
Posts: 193
Joined: 30 May 2014, 10:26

Caliburn.Noesis (Caliburn.Micro port)

02 May 2021, 04:17

So here we are, things have started. All the core implementation, plus a little bit of extra is in place.
Next will come the Bootstrapper and some other Noesis specific stuff and then I'll try to set up some samples and get those to run in both Unity and .NET Blend/VS.

Every bit of feedback is wellcome, and when the samples are done I could probably use some help from you Noesis guys to provide some neat styles to make the samples look awesome :)

https://github.com/VacuumBreather/Caliburn.Noesis

I left out all of the old Coroutine stuff, which is outdated anyway and instead rely on the UniTask library. That one is the best implementation of Async operations in Unity, since it supports the player loop and auto-cancels Tasks if the game object running it is destroyed. And it uses an allocation free ValueTask implementation. (And a .NET Core implementation exists so it can be added to the Blend project via nuGet package.)

I am also not going to support the actions and pattern conventions of Caliburn for now. Not just because there's probably still some API inconstistencies that make those hard to port, but also because I feel those are for experienced XAML developers who already know every standard binding by heart and just want to avoid typing. For Noesis users on Unity, which often include inexperienced developers (especially inexperienced in using XAML), they might cause more confusion than anything. And they provide nothing that cannot be done in XAML by hand.

If people are interested I can try and add some of those later on. For now, I won't include them. Unity in general has a tendency of making mundane things incredibly simple by doing things behind a curtain but when something doesn't go as planned or you need to tweak things a bit, it becomes hard to figure out what actually happens behind the scenes and how to adjust it. I don't want this framework to do the same. Sometimes hiding too much can be bad. And considering how hard the code is to port, because it really digs deep into some WPF API, I don't want that implementation to become a problem for someone who doesn't like what is happening. I know that Caliburn.Micro basically never explicitly overrides anything that's already there, but it just adds a lot of things that it tells nobody about. It's enough to give a button the wrong name to suddenly have it subscribed to a method call. That could cause a lot of confusion among people who don't know how databindings work in detail to begin with. And finally those convention names never supported Intellisense or Refactoring properly. Just one more cause of potential bugs waiting to happen. I'm open to suggestions for neat Unity(/Noesis specific features however. Maybe some behaviors that can be useful or something like that.

I also will not include the EvenAggregator since there are many good implementations for that already in Unity. The MessageBroker from UniRx is just one example and works great. Also if such a messaging system is used, it also needs to communicate with the rest of the game which almost certainly already has something like this in place. Adding another one in a pure UI framework would be redundant at best and confusing at worst.

What I will include is a base frame which will support opening dialogs and popups and I might event try to get a full windowing system running where you can open draggable sub-windows. That shouldn't be too hard to do.

THe dialogs basically already work. I'll push them into the repo once I have the bootstrapper and the View-ViewModel type mapper up and running. The latter is still a bit too hardcoded. I need to copy most of the Caliburn implementation so it's properly configurable.

I also got rid of Caliburn's dependency injection. I'll use the dynamic DataTemplate creator instead. Not only does that work without a dependency injection framework in place, it also gets rid of Calburn's worst design flaw: The static IoC class, which has always prevented Caliburn from being used in multiple modules at the same time.
In Unity that's a massive nono, since Noesis will be instantiated in multiple scenes, so having a static class for dependency injection is a big bad red flag. I got rid of that completely and also got rid of any other static classes like LogManager.I want that stuff to remain open to be adjusted to whatever the developer wants, including a Unity specific dependency injection framework like Zenject.

Tags:
 
KeldorKatarn
Topic Author
Posts: 193
Joined: 30 May 2014, 10:26

Re: Caliburn.Noesis (Caliburn.Micro port)

03 May 2021, 03:26

Platform stuff is in place, so is a first rudamentary sample. Next I'll try to get everything working in a WPF solution.
Static LogManager is still in for now, I need to remove that still. I'm still looking for a solution that will work with dependency injection while not being too cumbersome without it.
I also need to adjust some of the API of the DialogViewModel base class. I don't like how the command needs to be re-assigned to asjust the CanExecute state for closing the dialog.

But overall it's already in a state that can be used.
 
User avatar
jsantos
Site Admin
Posts: 3138
Joined: 20 Jan 2012, 17:18
Contact:

Re: Caliburn.Noesis (Caliburn.Micro port)

03 May 2021, 16:39

This awesome man, I just added it to the Download thread.
Every bit of feedback is welcome, and when the samples are done I could probably use some help from you Noesis guys to provide some neat styles to make the samples look awesome :)
Yes, of course, count on that. We are going to be very busy until 3.1 is out (July) but after that we can put resources here. In fact, we would love to have a private call with you.
 
KeldorKatarn
Topic Author
Posts: 193
Joined: 30 May 2014, 10:26

Re: Caliburn.Noesis (Caliburn.Micro port)

03 May 2021, 20:04

We can make something work. I'm currently doing freelance work and still working on my game (well right now this framework kinda IS my game since I need a UI for the editor I'm doing so a good UI integration is my next step. And nothing Unity has to offer comes close to XAML productivity. Especially since I already know it very well)

After this month I'm off my freelance project though and I plan to take a month or two off in summer and just relax and work on my game and do some off-time. I'll very likely just work a bit more on this and add a few neat features and such and add samples. So your July date kinda fits with my plans anyway. I should have time off and some samples in place by then.

If you want to give me a call we can make that work. Send me a PM here and I'll provide you with some contact information. What time zone are you guys in btw? I'm onCentral European time.
 
KeldorKatarn
Topic Author
Posts: 193
Joined: 30 May 2014, 10:26

Re: Caliburn.Noesis (Caliburn.Micro port)

04 May 2021, 12:28

The code runs in WPF and Unity now. I had to fix some issues with some async code which I stupidly missinterpreted. But now it should work fine. I'm still not happy with the Logger, but I'll deal with that later.
 
KeldorKatarn
Topic Author
Posts: 193
Joined: 30 May 2014, 10:26

Re: Caliburn.Noesis (Caliburn.Micro port)

05 May 2021, 06:08

Edit: Activation logic, draggability and z-order are in place :)
DraggableWindows.jpg
 
User avatar
jsantos
Site Admin
Posts: 3138
Joined: 20 Jan 2012, 17:18
Contact:

Re: Caliburn.Noesis (Caliburn.Micro port)

05 May 2021, 10:24

😃 Good job! Keep it up!
 
KeldorKatarn
Topic Author
Posts: 193
Joined: 30 May 2014, 10:26

Re: Caliburn.Noesis (Caliburn.Micro port)

06 May 2021, 20:48

 
User avatar
sfernandez
Site Admin
Posts: 2254
Joined: 22 Dec 2011, 19:20

Re: Caliburn.Noesis (Caliburn.Micro port)

10 May 2021, 16:01

We will implement it as soon as possible.
In the meantime, if you need to know when a control initially calculated its layout, you can wait for the Loaded event, that is raised after first measure/arrange is done in the control.
 
User avatar
jsantos
Site Admin
Posts: 3138
Joined: 20 Jan 2012, 17:18
Contact:

Re: Caliburn.Noesis (Caliburn.Micro port)

10 May 2021, 16:34

I also see this is the last ticket pending to close Caliburn.Micro metaticket (#1038) :)

Who is online

Users browsing this forum: Google [Bot] and 3 guests