XDC 2023: XAML Islands, William Yu

I’ve been using Xojo for many many years.

My main app doesn’t fully follow Mac or Windows guidelines - it is a hybrid and it looks the same on both platforms.
I use some self-made buttons, self-made toolbars, and some other components.
Does it look like a fully native Mac app or a native Windows one?
Nope.
But in the last 15 years, I have truthfully had only 1 single email from a user that mentioned this.
( I accept that there may be people who took one look, and didn’t buy. I’ll survive. :> )

Users care that the app works, that they don’t see too many controls at once, and that things line up.
They prefer a button that looks like a button, rather than a word that might perform an action if they are lucky. They prefer meaningful icons , rather than a couple of boxes in black and white.
IMO, Apple had it right with Aqua.

1 Like

Well, .NET MAUI runs on top of .NET 6 (I had said core to differentiate it from the old .NET). The UI is designed with XAML, and I was just wondering if we would see the day where something like Xojo’s XAMLContainers would allow for Xojo apps to somehow tie into .NET MAUI behind the scenes.

This would allow the code to run on multiple platforms while also allowing the ability of the XAML based front ends to provide UIs according to the developer’s desires (not just WinUI) since the UI layer can be switched out.

.NET MAUI is less than a year old - so it will be interesting what capabilities it provides and possibly if Xojo could tap into those capabilities to provide additional flexibility in developing multi-platform applications.

1 Like

Strange then that all the examples I have provided are not development applications.

1 Like

Well, If nothing changed, MAUI excludes Linux. UNO includes Linux and Web.

MS won’t emphasize and give full power and support to competing platforms.

A windows friendly version of XOJO.!!!
Looking forward to try all new stuff.
By the way as i saw the new buttons and controls
i happened to get an idea of building an jukebox
driven by a xojo application.
The only scaring thing is that with xaml we will have to start all over
and learn something new…
And i hate that. I prefer to learn something well and stuck with that
instead of starting to learn and leave it for something else.
This is like flying in the sky and never touch earth. Scaring…

The idea is that the build in controls will do this for you, you will not need to learn XAML at all, unless you really want something that doesn’t look like a normal windows app. For those who want it that way the Xojo will work exactly as it does now. Except for what it does under the hood.

I wrote a blog post: Modern Windows UI for Xojo

William confirmed, that the XAML container would do nothing if it is on a Window and you build for macOS or Linux.

1 Like

So, like using OLE objects today?
If you use one it’s a Windows-only app.

No. that means you can use them in a cross platform application.
Just the XAML container with your MapView would only show on Windows.
For macOS you could use our MBS MapView using Apple’s classes.

And how to deal with it without compile time switchable view layers (multiple designs of views and compiling its events JUST for that target platform that View (window) was created) as other tools does?

People will need to maintain one project per target in Xojo?

1 Like

You would use #if targetWindows in several spots.

no.

1 Like

Like what?

#If TargetWindows Then
  #Include EntryWindow_WindowsLayoutAndControls.XojoWindow
#ElseIf TargetMacOS Then
  #Include EntryWindow_MacOSLayoutAndControls.XojoWindow
#Else
  #Pragma Error "Target OS not supported"
#EndIf

That could be half acceptable.

But if “#if targetWindows in several spots” means creating a crazy spaghetti code in a experience like “hacking things to make it work and look as you wish hiding parts at runtime and etc” compiling even useless code for a platform, the Xojo approach would be too off.

Has anyone asked (at the show) if we could put a xaml container inside something else? Could we (for instance) do this:

ContainerControl > PagePanel > XAML container

So that the page panel could have a Mac/Linux control in another pane? At least that way you could standardize the API

They should extend the Module / Method capability for defining which platform an item belongs to to Windows and ContainerControls. That way you could have two windows with the same name targeted at different OS:

Screenshot 2023-04-28 at 14.06.45

But extend it for each platform. Windows, Mac etc. That would be really helpful.

1 Like

Yes, the XAML Gallery that was demo’d at the session was a bunch of XAMLContainers on a PagePanel.

That would be an unacceptable hack…

Things would “exist”, not intended contented for a platform would be compiled, resources wasted, wrong events could be fired, etc. Competitors would laugh at Xojo and say “they can’t do the right things, so Xojo is a huge patchwork of spaghetti code and pile of workarounds and I can prove that” and show this.

We could be able to create windows and set it as compilable at some targets as Windows, Mac, Linux; default all set. We could be able to duplicate a window with even the same name but different target.

We could have even an extra property “RTL”, so we could create a layout for LTR (the current standard) and RTL (not set as default).

THAT would solve this problem.

That’s why I suggested it :smile: :imp:

This feature people have asked for for some years. I am not sure why it has not been put in there a long long time ago since it changes everything for crossplatform development.

From its intro and beyond. The past code is loaded as universal, Windows, Mac, Linux all set. RTL off.