MiBa
Topic Author
Posts: 2
Joined: 14 Feb 2021, 17:53

MVVM Frameworks

25 Feb 2021, 16:50

Hello,
I am new to NoesisGUI but have a WPF background. I like to try this framework in a Unity toy project.

Coming from WPF, i would like to know if there are MVVM frameworks that a compatible to NoesisGUI.
Iam familiar with Caliburn Micro, but would also like to give https://www.reactiveui.net/ a try.
The client specifc code for Reactive UI seems to be manageable https://github.com/reactiveui/ReactiveUI/tree/main/src at first glance. Could NoesisGUI work with ReactiveUI?

What would be alternative MVVM frameworks to use?

Cheers, MiBa

Tags:
 
User avatar
jsantos
Site Admin
Posts: 3059
Joined: 20 Jan 2012, 17:18
Contact:

Re: MVVM Frameworks

26 Feb 2021, 11:19

In C# we offer an API compatible with WPF (not 100% but trying to), so if you find a framework that is not compatible please let us know and we will try to improve it.

Thanks and welcome!
 
MiBa
Topic Author
Posts: 2
Joined: 14 Feb 2021, 17:53

Re: MVVM Frameworks

28 Feb 2021, 11:24

Thanks, I was able to replace the base class of the ViewModel and its commands by the ReactiveUI conterparts.
I also generated EventsExtensions (for Observables) from Noesis.GUI.dll and build my ReactiveNoesisUserControl<TViewModel> and ActivationForViewFetcher.

So far I have only tested it with Tic-TacToe example using:
        public MainWindow()
        {
            System.WeakReference wr = new System.WeakReference(this);
            Initialized += (s, e) => { ((MainWindow)wr.Target).OnInitialized(s, e); };
            InitializeComponent();
            Locator.CurrentMutable.Register(() => new ActivationForViewFetcher(), typeof(IActivationForViewFetcher));

            this.WhenActivated(disposableRegistration =>
           {
               for (int i = 0; i < this.Cells.Length; i++)
               {
                   var param = i;
                   Cells[i].Events().Click
                       .Select(args => param)
                       .InvokeCommand(this.ViewModel.Check)
                       .DisposeWith(disposableRegistration);
               }
           });
        }
 
User avatar
jsantos
Site Admin
Posts: 3059
Joined: 20 Jan 2012, 17:18
Contact:

Re: MVVM Frameworks

01 Mar 2021, 13:54

That's great! : )

Please, let us know if you need more help.

Who is online

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