The Modern .NET Show

S06E18 - Uno Platform: One UI to Rule Them All with Martin Zikmund

Sponsors

Support for this episode of The Modern .NET Show comes from the following sponsors. Please take a moment to learn more about their products and services:

Please also see the full sponsor message(s) in the episode transcription for more details of their products and services, and offers exclusive to listeners of The Modern .NET Show.

Thank you to the sponsors for supporting the show.

Embedded Player

S06E18 - Uno Platform: One UI to Rule Them All with Martin Zikmund
The .NET Core Podcast

S06E18 - Uno Platform: One UI to Rule Them All with Martin Zikmund

Supporting The Show

If this episode was interesting or useful to you, please consider supporting the show with one of the above options.

Episode Summary

In the realm of cross-platform development, Uno Platform stands out as a versatile and user-friendly framework that empowers developers to create consistent and visually appealing applications across different operating systems. With its seamless integration of WinUI components and support for customization, Uno Platform offers a unique solution for bridging the gap between design and development.

One of the key features of Uno Platform is its ability to provide a consistent user experience by default, ensuring that applications look pixel-perfect on all platforms. Developers have the option to customize the styling of their applications, allowing them to tailor the user interface to match specific platform designs or company branding. This flexibility is essential for maintaining consistency and familiarity for users, as well as accommodating the diverse aesthetics of different platforms.

The collaboration between Uno Platform and Microsoft for Win UI components is a testament to the platform’s commitment to continuous improvement and integration of new features. By leveraging shared API surfaces and namespaces, Uno Platform can easily port code from Win UI, enabling developers to quickly incorporate updates and enhancements into their applications. This seamless transition between frameworks streamlines the development process and ensures that Uno Platform remains up-to-date with the latest advancements in UI design.

Uno Platform’s compatibility with Linux further expands its reach and versatility, allowing developers to target a wider range of devices and platforms. By using GTK as the underlying framework for Linux support, Uno Platform simplifies access to Linux-specific APIs and ensures that applications run smoothly on Linux distributions that support .NET. The platform’s focus on enhancing performance and capabilities on Linux demonstrates its commitment to providing a comprehensive and inclusive development environment.

In addition to its strong technical foundation, Uno Platform also prioritizes collaboration between designers and developers through tools like Uno Figma. This plugin enables designers to export UI designs as XAML or C# markup, facilitating communication and streamlining the development process. By empowering designers to contribute directly to the development of applications, Uno Platform promotes a more cohesive and efficient workflow that benefits both parties.

Overall, Uno Platform’s dedication to innovation, customization, and collaboration makes it a valuable asset for developers seeking to create high-quality, cross-platform applications. With its robust framework, support for Win UI components, and commitment to user experience, Uno Platform exemplifies the future of cross-platform development and the harmonious integration of design and development.

Episode Transcription

Uno Platform started off as the core UI framework. UI and non UI, because as part of Uno Platform itself, you have some non UI APIs like accelerometer and like these device sensors that you can use in a cross platform manner. So that part is the core framework, which is the backbone to everything that we built on top of it.

- Martin Zikmund

Welcome to The Modern .NET Show! Formerly known as The .NET Core Podcast, we are the go-to podcast for all .NET developers worldwide and I am your host Jamie “GaProgMan” Taylor.

In this episode, Martin Zikmund joined us to talk about Uno Platform and how it’s way more than just a UI framework. It has support for APIs such as reading device sensors like accelerometers, too. But the bread and butter of Uno Platform, like AvaloniaUI, comes from the fact that you can use the familiar WPF syntax and either the new MVUX architecture or the more familiar to most MVU architecture to build your apps.

Yeah, ideally it should work on any Linux where .NET runs.

And we are currently using GTK as the underlying framework that simplifies our like that access to Linux specific APIs. So there is kind of a middleware layer of GTK. And you know, that makes the development for us much easier because it already has those shims for different versions of Linux and so on built in.

- Martin Zikmund

So let’s sit back, open up a terminal, type in dotnet new podcast and we’ll dive into the core of Modern .NET.

Jamie : So welcome to the show, Martin. It’s been a while since we talked about Uno Platform and we haven’t been connected in the past. So thank you very much for spending some time with me and the listeners today.

Martin : Thank you for inviting me. And hello, everybody.

Jamie : Fantastic. So I guess before we start talking about what we’re going to talk about, obviously the listeners know what we’re going to talk about because they press the button to push play. I just wonder, would you mind giving us a bit of an elevator pitch about you, like the work that you do and all that kind of stuff?

Martin : Sure. So my name is Martin Zikmund. I’m a .NET developer, basically, mainly open source developer. I’m also Microsoft developer Technologies MVP. And I started out originally as a Windows app developer, then kind of transitioned into cross platform application development. And then I found Uno Platform as an open source project and started contributing. And I’ve been contributing ever since 2019. So it’s basically five years now. So it’s been my passion project and now it’s become my job. So that’s a great thing.

And apart from Uno, also, I have also my blog where I post .NET related content and also do some live coding streams on Twitch and also have a YouTube channel. So if you want to get some .NET content on YouTube, you can subscribe there. And I will be posting Uno Platform and .NET related videos there.

So I that and maybe for my hobbies, I’m also a fan of climbing, bouldering, and I’m also geocacher, so finding geocaches in the world when I’m travelling. And finally, I’m a big fan of Lego, so building a lot of Legos and I think that’s it.

Jamie : Nice. I do always enjoy hearing about people who can turn a passion into a career. Right? Because that’s kind of how mine started. I was, you know, as a kid, we got given a computer and I was like, "I can make it do some stuff." And I made it do the things that I wanted to make it, that I wanted to make it do. And then next thing I know, I’m like, "oh, wait, I’m a college and you can turn this into a career. You mean I get to get to solve problems and make computers do stuff? That’s awesome."

So the fact that you’ve turned it from a passion that you were doing previously into something that you can do, I guess, you know, employment and stuff like that is awesome.

Martin : Yeah, it’s the best. Because when you do something you love and then you enjoy doing it and also get paid for it. So that’s the ideal combination, I think.

Jamie : Yeah, yeah, it is. It is the ideal combination. Nice.

So, um, yeah, so the listeners will know we’re going to talk about Uno Platform today and the, the long-in-the-tooth listeners, the folks who have been listening for a long time, will know that it’s been almost four years since we last talked about Uno Platform. And that’s not like in any way me saying I don’t want to talk about it. It’s just obviously with so many interesting things happening in the .NET space, it’s hard to sort of keep track of everything and doubly hard for me because everybody wants to be on the show. And that’s totally, that’s amazing that people want to be on the show, but it does mean that it’s been almost four years since we last talked about Uno Platform. So I wonder, for the folks who perhaps haven’t heard that one, and if you want to go back, that’s episode 60 that we released on September 18, 2020. For the folks who haven’t heard that one, I wonder, could you give us an overview of what Uno Platform is and what it’s aiming to solve for developers?

Martin : Oh yes.

So Uno Platform is an open source solution that allows you to build cross platform applications which are fast, beautiful, efficient, and look great on all the different devices that people have. And the goal of Uno Platform is to provide you with not only the UI framework, which is the core part of Uno, but also many productivity amplifiers on top of it that will increase your productivity and allow you to build the .NET cross platform applications even faster. It’s become; the name Uno Platform is there for a reason. It’s not just a framework. It’s a platform of things that will allow you to build applications efficiently.

Jamie : Right, right. Okay, that’s pretty cool.

So what I’m taking from that is that part of it is that it’s a UI framework, right? I mean, that’s kind of like the bread and butter of it. I mean, we’ll talk about later the fact that it’s not just UI stuff, but I mean, like, how do I put it? Like WPF exists. So without wanting to sound horrid, what do I get out of using Uno Platform that I don’t get out of, say, WPF, which I know is locked to Windows? So maybe that’s it. Is it that the reason I should use Uno Platform?

Martin : Yes, that’s part of it. I mean, WPF has been here since I don’t know how long; it’s been a long time since then. The development on Windows has been changing several times. There was Windows 8 development and there was Windows 10 development. And now there is the Modern Windows development framework, which is called WinUI, right? And this one is, we are using it to a large extent because Uno Platform aims to provide you the same API surface, the same namespaces, the same classes, the same types, the same methods, the same properties and everything, but we are providing those on non-Windows platforms.

So if you have a WinUI application and you write it, you should be able to take it to all the other platforms just by recompiling against Uno Platform instead of WinUI. And that’s our main like productivity improvement. Because you are not no longer building just a Windows application, you are building a Windows application which then also runs everywhere, and looks the same everywhere, and you are getting the same experience on all platforms. And that’s a great thing because you don’t have to think about any platform specifics, you don’t have to think about any your own OS specific weirdnesses that there are plenty on Android and iOS or on the web especially. So it simplifies the development experience significantly.

And yeah, for the for the cross-platform development, I mentioned that Android and iOS, but we are also running on Linux, MacOS and also on the web via webassembly. So it’s a full reach of all the different platforms.

Jamie : Right. Okay, I’ve got a question about "the Linuxes," but we’ll come back to that in a minute then.

So you said there about not having to worry about the differences, I guess in the different paradigms and the corner cases and edge cases and stuff for UI paradigms across the different operating systems. Like for instance, I’m sitting here talking to you using my M2 Mac, and I know that Windows has the close minimize maximize buttons on top right and MacOS has them on top left. And some linuxes have them in top right, some linuxes have them in top left. It’s way more complicated than that. I do apologize to the people who are listening in going "actually it’s not Linux display engine and it’s not really the display engine, it’s the desktop." You know what, I’m just trying to simplify it for the folks who don’t use Linux on the desktop. And then obviously there is no close minimize maximize on iOS and Android, right? So obviously I’m understanding that that’s one of the parts of those differences between the different operating systems.

But I guess my question is, does it also handle the the rather stateful nature of mobile apps as well. So by that I mean for folks who don’t, don’t know, you know, if you’ve got a, an app, say you’ve got the Twitter app, or you’ve got some kind of app running, a to do list app, and you drop out of the app by, you know, going on iOS, you maybe hold the home button and you choose a different app, then maybe that pauses, the app puts in a pause state so it’s not constantly running, or maybe it keeps running because maybe you want whatever it is to run in the background. Does Uno Platform support that as well? Or is that a non trivial thing that you don’t really go near?

Martin : Right. We do support things like app suspension on Android and iOS, where the application goes to sleep and you are able to save state and make sure that everything that the user has been working on is saved in case the OS decides to kill it and then relaunch it when in case you run out of memory, the system could kill the application. So we make sure that the application, we make sure that you have a way to save state and restore it when the applications relaunch. So that part is there for the background operations where you could have something like maybe a regular timer based, run timer based operation on the background. There are libraries that will allow you to do this with Uno Platform, but it’s not a built in thing yet. We have it as a feature request. So if people are interested in this feature, we are happy to prioritize it because we have all the issues on GitHub. So just giving thumbs up to issues will help us decide what is preferred or what people want to see.

That’s the beauty of open source development, right?

Jamie : Sure, okay.

I really liked your analogy of I build my WinuI app and maybe I change the target platform, maybe I go, "okay, so it’s a win Windows executable and I then change that to a Mac OS." I don’t even know what they’re called, but I’m going to call it a package. Your Mac OS package. It’s probably not called that. And you hit build and then your UI comes out. Is it the same or does it use like the, the particular target platforms, UI paradigms? I know I talked about the close, minimize, and maximize buttons being in different places. That’s like outside of my app’s control, right?

Martin : Yeah, you could customize it. In many cases you are able to go into the low level stuff and change even that. But most applications won’t do it, and there is a good reason not to because users are used to having those buttons there. So yeah, I think like usually it’s preferable to keep those conventions intact.

Jamie : But like, does the rest of the UI, like, how do I put it right? So let’s say, let’s say I do a brand new Uno Platform app and I create a button and I, you know, it’s like I’m on my Windows machine, I create a button, it maybe uses WinUI to theme it or to skin it. I’m not sure of the correct terms here. And then I build and I move over to my Mac and I run it. Will it look like a win UI button or will, is there some translation going on to make it, make it, to make it look like a MacOS button?

Martin : Right? It’s a combination of both things. We offer you the choice so you as a developer can decide if you want your application to look exactly the same everywhere. So by default your application would look exactly pixel perfect, the same everywhere. And that’s ideal for situations where you want to style your application to match your company branding, and you want to make your company shine through. So you can use your company colors, you can use your company standardized corner radiuses and everything. And then your application will look exactly the same everywhere, of course bearing the responsivity of the application. So if you resize the app, you can relayout and reflow the layout as you see fit. But by default the application will look the same and feel the same to the user.

So that’s a kind of the default way. But we also offer you the way to customize the look on your application everywhere. So if you prefer your application to look like material design from Google, you can make that happen. And you can even decide that you want to make it look like a Google application or material application on iOS. You can do that, you have the complete control of styling, so you can decide which platforms will look in this way and which will look in different styles so it’s fully customizable and fully theme-able. And the platform specifics are quite easy to do. So you can customize each platform to your specific taste or specific needs.

Jamie : Nice, nice. I like that.

So I did make a note of the question that I have about "the linuxes" in bunnyquotes. We’ll come back to that in a moment. But I know that because obviously it’s, when I asked about how it differs from WPF, I know that you guys are working alongside of Microsoft for the WinUI stuff and certain components and stuff. So I’m wondering how in the heck you keep in sync with these guys, right? Because like they’re moving at their pace, doing their thing. And I know that specifically WinUI has lots of updates every so often. Like, you all have your release cadence you’re trying to stick to and you know you do stick to. So like how in the heck do you keep that synchronized?

Martin : Yeah, that could be a challenge, but luckily it’s not that much. The reason is that as we are using the same API, surface namespaces classes and so on as WinUI, we can actually even port code from them. So if you imagine some controls in WinUI, there are things like tree view, which gives you the hierarchical structure. What we did is that we took the C++ code from WinUI because it’s open source. WinUI is open source now and everything there is openly available and under MIT license. So what we do is take that C++ code, kind of translate it using a semi automatic approach, using some regexes and so on into C#
and then compile it against Uno. And because the underlying layer of Uno Platform like dependency properties and XAML and all the resources and so on has the same namespacing also the controls above, it can use those layers below without any change.

So very often, and the only thing that we need to do to bring in a new control from WinUI is to just translate the code to C# and compile it. And if everything was working perfectly then that’s ideal. If we have to tinker with some specifics, because sometimes we might encounter some missing APIs that we need to add, or that some controls in WinUI are using some additional APIs which are low level and which we don’t have implemented yet because they are kind of private, or not private but WinUI specific and are not publicly visible, then we add those. But in general the porting process is quite straightforward. And then we have exactly the same source code just translated into C#, which is pretty nice and pretty useful when Microsoft brings in new features to existing controls.

So if they decide to add a new mode to tree view, some kind of multi hierarchical mode, then we can quite easily add those features in just by checking the last commit and comparing/diffing against the previous one which we ported. So we just add those same feature, same code changes into C# and then we are done. And that’s super useful and efficient. And because we have the same infrastructure we can also port their unit tests and their ui tests. So we have also the great test coverage on everything. So we know that we don’t break things when we update to new versions of controls.


Do you have a WPF application and want to take it to macOS or Linux? Avalonia XPF, a binary-compatible cross-platform fork of WPF, enables WPF apps to run on new platforms with minimal effort and maximum compatibility.

With a few tweaks to your project file, your WPF app and all its dependencies are ready for testing on new platforms.

Start your app transformation journey with a 30-day free trial.

Head over to http://avaloniaui.net/themoderndotnetshow to get started today.


Jamie : Nice. That’s pretty cool. Yeah, that’s, wow. I can imagine that being a bit of a Herculean task to start with. But if "all" you’re doing is—I’m wrapping bunny quote around "all" right. If all you’re doing is taking the latest bits and translating them from C++ to C#, and then, then it just works. I can imagine that makes it really, really, really simple to actually just do that. That’s pretty cool.

Martin : Oh, yeah. It feels magical because you’re taking some code from a different code base. You take it translated into C# and it just clicks into place and works, which is, it feels great when you do it because you can take even very complex controls. Like if you, you take time picker, which is super complex because you have different time formats each country is using and it has all that complex logic built in and you just translate it and it works without many changes, which is super cool.

Jamie : Nice. I always like when stuff like that happens because it’s just like you said, it’s like magic, right? You just fill in a gap and then bang, it just works. And you’re like, "wow, I didn’t do any, I’m not going to tell anyone I didn’t do anything, but I didn’t do anything here and it just works."

Martin : Oh, yeah.

Jamie : Nice. Okay.

So, okay, let’s talk about, real quick, let’s talk about "the Linuxes," because I realized that there’s, there’s going to be some folks out there who know all of the intimate details, who are listening in going, "actually, Jamie, what you’re talking about here is nonsense," but what I’m going to do is I’m going to try and like reduce the complexity to help folks who’ve never used a Linux on the desktop understand how it works. Right?

So in Windows we’ve got the window display manager and that you, when you put a request into the Win32 API or whatever and say, "draw me a window here that takes up this many pixels," it goes, "okay, boss." And draws the window there. On MacOS, there will be something similar, probably with metal or probably with whatever display managing software that they use. The pluggable nature of Linux on the desktop and with lots of different engineers with lots of different opinions about how things should work, means that there’s about 1,285-bajillion different ways of drawing a window on the screen.

So I got a question about, like you said, i"t works on Linux." Does it work on every, like, okay, I’m I’m leading you down a difficult question to answer there. I do apologize. Let me dial back a bit. Surely it doesn’t work on every single possible permutation of Linux, right?

Martin : I don’t think so. I’m, I’m not a Linux expert by, by far, but yeah, I’m pretty sure that there are interesting linuxes that it doesn’t work on. But you know, we’re trying to reach as many as possible and you know, if you have a Linux without a UI, you know, just a terminal, then I think Uno Platform wouldn’t be that useful to you anyway there. Sure, because it’s still mainly about the UI and even though you could output to the console. But it wouldn’t be that, that cool, you know, to have a cross platform console app because you can have a cross platform console with .NET itself. So that’s…

Jamie : Yeah, I was just aiming so that then someone who’s listening who says, "well actually I run a Linux distro from 1997 that only three people have ever heard of and it doesn’t work on there. So you don’t work on all the linuxes, do you?" I just wanted to preempt that. Right.

Martin : Yeah, I like it works a lot of linuxes, and I have it running on Raspberry PI, and we have it on different IoT devices as well. So Jérôme from our team has run it on different IoT devices. And there was also people in the community running it on different smaller screens and different small tools where they built their own touchscreens with smart home control and so on. So that’s pretty cool because you can see it in many different use cases this way. And that’s what the Linux brings in because that something that you don’t get with the other oss even though there was like Windows IoT before. But I think that’s already dead now.

Jamie : Okay, cool. Yeah, like I said, I just wanted to sort of pre-empt that of someone saying those, those things.

So let’s say I’m running a relatively modern Linux desktop distribution. It supports .NET 6/7/8. And I’ve built an app using Uno Platform that’s targeting one of those .NET 6/7/8, I can literally just copy the binaries over and run the app and it will draw me my UI and I can still navigate around. Right?

Martin : Yeah, ideally it should work on any Linux where .NET runs. And we are currently using GTK as the underlying framework that simplifies our like that access to Linux specific APIs. So there is kind of a middleware layer of GTK. And you know, that makes the development for us much easier because it already has those shims for different versions of Linux and so on built in. So whenever, wherever GTK runs, it will also run.

Jamie : Cool. Okay.

I just want to, I realize there’s going to be a lot of listeners who don’t dabble in desktop Linux. I just want to take a moment and just point out that getting a cross platform UI framework, regardless of—and I know that Uno Platform is more than just a UI framework, but getting a UI framework that is cross platform that runs on Windows, MacOS and "linuxes," again with, with money quotes, is actually a really, really, really non trivial task. So I mean, yes, you’ve said they’re using GTK to do some of the work for you, but just getting that to work is not easy. So for folks who don’t have that experience, trust me, it ain’t easy to do that.

Martin : Yeah, and if you watch us for the upcoming months, you might see some even better improvements on Linux. So we are actually now focusing on some of those things. I will not share anything, but you know, it’s worth checking what we release in the upcoming months.

Jamie : Nice. So hey folks, right, we’re recording this in January. I’m not sure off the top of my head when this episode will go out, but if it goes out a couple of months after we’ve recorded it, go back through and have a look at what Uno Platform have done and realize that you didn’t hear it here first, but it was said here first. So there you go. Little bit of a time related exclusive for you there.

Martin : Yeah

Jamie : Nice. Okay, so I know that Uno Platform isn’t just a collection of UI stuff. We’ll come back to that in a moment. But then what’s my experience like as a developer? Am I just going like am I opening Visual Studio and going File>New, "Oh cool. There’s a new no platform template," or can I do it all in Visual Studio Code? Do I need to install any extensions to sort of visualize the UI? Like, what’s that like?

Martin : Yeah, we actually focused a lot of on a lot on the developer experience recently and because originally we started off as Visual Studio exclusive thing, but now we are everywhere. So you can use Uno Platform in Visual Studio Code, you can use Uno Platform visual Studio, you can even use Uno Platform in Rider even though the support there is not yet ideal. And we’re working on that. And you can even use Uno Platform on the online code editors like Visual Studio Online. And how is it called drop the name now. But there is an alternative to Visual Studio online and it’s very similar to it.

And you can all build Uno Platform applications for a webassembly, even in the browser. So it’s very close platform. And for the developer experience to be ideal, you want to have our .NET new templates that are available on NuGet, so you can download that through dotnet new install and install our templates. But to have even better experience in Visual Studio, we have a special in Visual Studio and Visual Studio Code. We have extensions that add some additional features like hot reload support where you have your application running and you make changes in your code that’s in XAML or C#, and you see those changes immediately light up in the running application without any stopping and running again, which is very annoying, right? So this very much streamlines the development experience.

And there are things like intellisense support where we give you the XAML intellisense even, and the proper C# intellisense, which gives you also information when some APIs are not available on all platforms. Because you know some things that you can do on Android you cannot do on iOS. So you need to know that some API that we provide is only working on Android. And for iOS you need to do something else or disable some feature. So we also give you that information through intellisense.

And finally, on Visual Studio we have a wizard experience where you go through your application, set up everything step by step, and you can see the result of the application of that setup. You pick your platforms that you want to target, you can pick your extensions that you want to use, you can pick the theme of your application. So if you want fluent or material style, so you can pick that, you can add some additional features like PWA support for the Webassembly app and so on. So it’s very customizable. It even includes CI templates for GitHub and Visual Studio Online. And you just pick everything and then create the solution and we generate everything for you. The kind of scaffolding experience for Uno Platform apps.

And because this will be also released in the future, this podcast, by that time definitely we will have also released the wizard experience on the web. So that’s coming very soon. So you can check that out in our release notes.

Jamie : Nice, nice.

Because, yeah, that was going to be one of the questions I asked about, "do I, you know, if I, if I already have a pre existing project, am I just pulling in NuGets?" But that makes more sense, right? Sometimes it’s easier just to start from the beginning. And I do sometimes wonder about like, "how do I set up CI/CD with these projects, right?" Because like it’s all well and good being able to do, you know, File>New or a dotnet new, but like then setting it up so that it automatically builds when I push to source control is sometimes non trivial, right? Because sometimes you gotta install specific tool chains or whatever. So knowing that if I do the dotnet newor File>New project, I can get that with the app, that makes things a whole bunch easier.

And just, just real quick then just a really, because I asked this for listeners will already know, but there is a .NET MAUI episode that came out previous to this where I asked a similar question. Again, it is a leading question, obviously the Uno Platform tool chain, and the GitHub CI/CD pipelines stuff that the developers will have to bring their own signing system to that, right? You’re not doing that for them. That’s right, isn’t it? So if you’re releasing for an Android or an iOS platform, you need to have your app signed and approved by the owners of that platform. That’s not something you guys are doing, right?

Martin : No, no, like the release experience is dependent on the tooling that .NET has. So you go with the same kind of release steps as you would have with MAUI, for example. So it’s, the result is still a native package that needs to be uploaded to the store and then you have to provide descriptions, images and so on. And it goes through the normal certification loop where they tell you when something is not correct and you fix it and so on until the application is finally in the store. So we don’t provide this part because it’s really dependent on the specific target platform and you need to work with the team that certifies applications there.

Jamie : Sure, sure. Like I said, that was more just so that people listening in don’t go, "wait, I built my app with, with Uno Platform and I use their CI template and I can’t get it running on my friend’s iOS device." That was just like. There is a process that lies outside of the responsibility of all of these platforms, right?

Martin : That’s right. But you know, you could periodically also build your application as a webassembly application, publish it on the web on some URL, and then install it as a PWA to all the target OSes without any certification process. So there is an option where you can skip all this and have your application as a website instead that’s installed as an app as a PWA.

Jamie : Sure. Sure. So there are ways and means, folks. Ways and means.

Okay, so we talked earlier on about how I mentioned it real quick and for the listeners, a little bit of insider baseball. While we were planning this episode out: Martin and I discussed how Uno Platform isn’t just a UI framework. So I guess that gives me a chance to ask you, Martin, it’s not just a UI framework, so what else is going on here? I think you said in our pre recording chat, it’s like componentized or there are chunks of functionality that you could perhaps use. Is that the case?

Martin : Oh yes.

Uno Platform started off as the core UI framework UI and non UI, because as part of Uno Platform itself, you have some non UI APIs like accelerometer and like these device sensors that you can use in a cross platform manner. So that part is the core framework, which is the backbone to everything that we built on top of it. And we have quite a lot of first party offerings that improve the experience and make your development and, you know, application lifecycle better.

So first off, we released Uno Toolkit, which is kind of set of UI components which are not part of WinUI, but are useful especially on mobile. So things like tab bar where you have taps on the bottom of your screen and you switch between tabs. This is not part of WinUI. So we built our own and brought it to to Uno Platform, but you can also use it in WinUI if you want. So it’s not Uno Platform specific. So if you are just a WinUI developer, you can still use our toolkit to get some additional controls. There are things like badges and so on, which are again kind of mobile specific or are originating from mobile and are not on desktop. And these controls are part of the toolkit especially. So that’s the first component.

Then you have Uno Extensions, which are kind of bootstrapping parts which make up your application. So you can accelerate your development by taking these extensions, which are premade kind of components that you can plug into your application and quite easily bootstrap complex code that you would otherwise have to write.

So the typical thing that you have to solve for your application is localization. So we have Uno Platform extension for localization which you just install the NuGet and then you add it into your application bootstrapping code and you are done. You have your localization there, and you can just add some localized strings and add your localization into the UI itself, and it should just work without any changes. And similar thing we have for navigation. So that’s a common problem in application development. And I remember this from all my application development experiences, that navigation was always the hardest part, where you have to decide how you navigate between pages, how do you go back to previous pages, how you show dialogues on top of the pages, and so on. So we have encapsulated all this complexity into one extension which you just install and you define some attributes and that automatically makes your application navigate easily and you kind of, in a fluent way, you can define how the navigation within the app will work. So it’s again, these extensions are optional, you don’t have to use them, but they are helpful if you want to get started quickly and get yourself into a working state much faster than you would otherwise get. So those are the basic extensions.

And maybe if I can still continue in this molologue. We also have Uno Figma, which is a plugin into Figma which allows you to cooperate, which allows developers to cooperate with designers where designer designs in Figma and then is able to export the UI as XAML or C# markup into Uno Platform and then just use it inside of Uno, which is pretty cool. Which kind of streamlines that exchange loop between developer and designer and can allow you to bring your designs from Figma directly into Uno, which is, which is very useful, especially now when everybody’s using Figma. And we just thought it would be nice to have this one to one conversion layer between Figma and Uno.


A Request To You All

If you're enjoying this show, would you mind sharing it with a colleague? Check your podcatcher for a link to show notes, which has an embedded player within it and a transcription and all that stuff, and share that link with them. I'd really appreciate it if you could indeed share the show.

But if you'd like other ways to support it, you could:

I would love it if you would share the show with a friend or colleague or leave a rating or review. The other options are completely up to you, and are not required at all to continue enjoying the show.

Anyway, let's get back to it.


Jamie : That’s really cool. I’ve worked with a lot of designers over the years of my career and I always used to just get a, a Photoshop PSD and I’m like, "well that’s, that’s great, but I don’t have Photoshop because I’m a developer, not a designer." And I can’t excuse the I won’t say "ridiculous expense," but the large expense of having Photoshop on my machine just to open a file. So being able to actually look at a Figma design and push a button and collaborate nicely and have that help me build it in Uno Platform, sounds like it’s a really, really good way to do it. Because, yeah, that was always the problem, like recreating what a designer has created in a tool that is designed for them, but converting it into a tool that is designed for me was, I always found that super difficult. So that’s, that’s awesome. I really like that, that, that Uno Platform and Figma connection there. That’s, that’s really cool.

So then what about, okay, so we talked about a little, I’ll maybe come back to some of those other bits that Uno Platform does that isn’t just a UI framework, because I like the idea that there are, I don’t like the idea, sorry, that there are APIs on certain platforms that aren’t available on all of them. But I like the idea that Uno Platform can help me figure that out before build time, before runtime. So that’s kind of useful. But like.

So my thing with, when I’m doing uis is I completely skipped the XAML revolution, right? My experience with building UIs was I built a whole bunch of stuff with winforms, which is nice, drag and drop. And there’s this designer file behind it that describes how things are laid out on screen. It literally says at the header of the file, "do not alter this file," it is machine generated. Right? So the beginning of my UI building career was drag and drop buttons. And then there was a large dark period where I didn’t do anything in the UI, and then I became like, I despise the term, but we’ll breeze past the fact that I would despise the term full stack developer, where I became like, "oh, you can build the UI with HTML and CSS and JavaScript," there’s nothing wrong with that, but it’s the term that’s used anyway. And I went straight to HTML and skipped over XAML, stayed there for a while and then went back to server side stuff. So XAML to me is just like this crazy language that doesn’t make sense. And I know that other UI platforms use XAML. Do you guys use XAML? And can I, can I not use it? Can I declare it with C#? Is that possible?

Martin : Yes, definitely it’s possible. We give you the choice. So XAML is there, it’s the same dialect of Xaml as WinUI, because we have the same API surface. So we also have the same Xaml, which might be one of the advantages that you get if you go with Uno Platform, that you don’t have to learn a new XAML. It’s the same XAMl as is in WinUI, and it’s actually very similar to WPF XAML. So that option is there.

But we noticed that the trend is that people like to express their UI in, in code instead of markup. And we, you can see this in Flutter, for example, where you have the fluent description of the UI, which is more readable in many cases and is definitely simpler to write. So we thought if there would be a way to bring this experience to C# and Uno Platform, and that’s what C# markup is. We basically give you a C# [source] generator, which you include in your project, which automatically generates extension methods for all the UI components in your project. So not only the built in ones, so buttons and so on, but also your custom controls that you bring in. And you then write all your UI using a fluent syntax using like extension methods that connect nicely and have the fluent . . connection points where the whole UI can be expressed as just one. A nice fluent block. And that’s pretty useful and could be a nice alternative to people who prefer that over that more chatty XAML and markup HTML tag like UI.

Jamie : Nice, nice.

Because that was the thing that held me off of using XAML in the past was it was like, "yeah, you can use XAML, but what flavoir of XAML?" And I’m like, "I’m sorry, what? It’s a language. It is a programming language. How do we have multiple different variants?" Because reasons.

Martin : It’s overloaded term.

Jamie : Yeah. Okay, so I can use my C# to build the UI. That’s pretty cool because that was difficult for me to figure out, "which version of XAML are we using?" All that kind of stuff.

So I know from my experiences doing a little bit of Xamarin for instance, and I know it’s a different technology, but especially when it comes to like the apps that you can build with other frameworks like XAML and things like that, where it’s mostly targeting mobile devices, you’re kind of expected to, but don’t have to use, you’re kind of expected to use MVVM, which is for those who don’t know, "model, view, viewmodel" pattern, which is a little different to, if you’re coming from a web background of MVC, it’s kind of the same, but not really. Is that the same with Uno Platform? So if I’m architecting my app, do I need lots of different classes in lots of different places to represent how the UI is going to update? How does that work?

Martin : Yeah, so for super simple applications, you just can use code behind as you are used to from the times of even Windows forms. I think that also had some kind of code behind code, right?

Jamie : It did, yeah.

Martin : Yeah. So it should be very similar.

But when you want to build an actual more complex application, that’s not useful at all because you would have a hard time maintaining it and extending it further. So bringing some design patterns is usually very useful. So you can still use MVVM, as you mentioned. That’s the like kind of something that was the default before. There is community toolkit MVVM, which is provided by Microsoft’s community toolkit team. And that’s super efficient, very, very fast implementation of MVVM. And it works perfectly fine in Uno Platform across all the targets. So you can use that.

But if you want to go even further, we are offering MVUX, which is it stands for "model view, update, extended," and MVU you might know from other things like MAUI I think, has a implementation of MVU, and there was Comet as well in the .NET space where MVU was implemented. So it’s kind of different from MVVM where you have the two way binding from the view to the viewmodel, and the view model has a lot of logic inside of it to handle all the different cases and all the different situations that can happen, which makes the code then very complex.

So MVU is a better approach where the model is by default immutable and all the things that happen in the view that should be updating the model happen during the update phase, and then the view is rebuilt based on what has changed in the model. And it’s kind of hard to explain right away. You need to see it in action to really understand better, but as a result it makes it much easier to handle more complex situations.

For example, if you would have an API that sends you some data, you need to handle the case where the data are sent are received correctly, and also the case where the data fails to be received when, for example, Internet connection is suddenly lost or when the API is down. So you need to handle that error state. And also when you call that API, it takes some time before the answer comes back. So you need to also take care of a loading state. So MVUX is perfectly built for these scenarios where you need to represent not only the OK state but also loading, and also the error state in one fluent way. And that’s what MVU X will offer you.

And the extension on top of it that makes up the X there is that. We also allow you to use it with the normal data binding syntax, because from the immutable model we source generate a bindable proxy that you can use against XAML or even the C# markup where you can do data binding. Two way data binding to some property in the model and the changes that user does will then trigger the update phase, not change the property directly, but instead will trigger update and you are binding towards that source generated layer, not the model itself, because the model is immutable, right? So we give you this interoperability layer between the immutable state n and the view.

Jamie : That’s cool. So there’s a couple of different ways to do it. So that’s good. So do you like, as a personal preference, do you prefer to use MVUX? Or are you like, if you’re throwing together an app to demonstrate something, are you going to all in on MVUX every time? Or is that like, is that just a new preferred way that Uno Platform are like saying, "hey, you should totally do this because it’s a cool idea, but you don’t have to"?

Martin : Yeah, it’s completely up to you. And the theme of all the extensions and productivity enhancers that Uno Platform has on top of it like that make up the platform itself, is that everything is modular and everything is based on your preference. So for me personally, I, for small projects, I prefer MVVM because it’s kind of faster to get running a simple application, which is just a few pages. But if you want to go into more complex applications that talk to an API, then MVUX is the better choice. So it depends on your, a specific scenario and your specific preferences. And it’s not something that’s a dogma. It’s not prescribed or required. So it’s perfectly fine if you want to just use MVVM or if you just want to go with code behind. It’s up to you.

Jamie : Cool.

I like that because what I find sometimes, and this is I’m going to climb onto a soapbox and have a bit of a rant real quick and then climb straight back down. I totally get why some people do this, but I’ve noticed that in the .NET space, some people will hear something like, "oh, there’s this new pattern called MVUX," and they’ll go, "oh my goodness, now I have to rewrite all of my apps to use that new pattern." No, you don’t, folks. You can use whatever works for you. I think it was Scott Hanselman who said, "use what you like, use what makes you happy." And it sounds like the way that Uno Platform is designed so that you can use code behind MVVM, MVUX, whatever works for you. It means that it’s easier for me as a developer to just literally get on with you, set yourself the productivity it feels like from what you’re saying, Uno Platform gets out of the way so I can actually write my app and then it figures out how to, "oh, you’re doing MVVM. Awesome. I will plug in the bits. They do the little bit of code generation required to get that to work with commands and things like that." Or h"ey, you’re doing code behind for this bit. Brilliant. That’s totally fine. I don’t have to do anything because you’ve done it all." I really like that.

Cool. Okay, so what about if folks are listening in and we’re like, you know what, this Uno Platform sounds amazing. How do I get started? Is there like a getting started guide or is there like a tutorial or like a series of like do you guys produce YouTube videos or something? I know you said earlier you do, but I don’t know whether Uno Platform as an organization do. So like where am I going to get the basics and get started?

Martin : Oh yeah, we have website which is https://platform.uno. So it’s kind of reversed and because the Uno domain exists, so we have platform Uno and there you have like all the resources that you can think of. It contains some information about all the pieces that Uno Platform offers. And there, there is a link to documentation which is at docs.platform.uno and that contains all the things that you might need to get started. So there is a getting started guide, there is links to all the prerequisites that you need to install, and there is also to deep dives into every single feature and every single component that Uno Platform has. So there’s descriptions and documentation for the core Uno Platform framework, but also for the extensions, the toolkit, the Figma plugin. There is information on C# markup, even MVUX, quite in detail. So you can learn really step by step and learn to understand it.

And we also have there two workshops that you can use. One is kind of ten minute workshop that gets you a working application, simple calculator application in under ten minutes. And then there is a 1 hour, around 1 hour long workshop which is a kind of YouTube player application. And you can use those as a skeleton to start your own application, or you can just use it to learn the basics of the API and the approach that we take to build applications. So these are kind of two sample applications, but we have a lot of other samples for all the different scenarios like sensors and more complex uis, navigation and so on in our Uno samples repository on GitHub. So you can browse there and just try out things and learn from there or just copy paste code from there to your application as you see fit. So yeah, that’s all there.

Jamie : Get your Stack Overflow keyboards ready folks. Control-C, control-V.

Martin : And we have also YouTube videos. So if you go to our YouTube. There is a lot of YouTube videos for five minute videos for a specific feature where you learn something during your coffee break. So that’s kind of an ideal way to learn, especially nowadays in the hectic times where you don’t have much time, so you need to get your information quick and easy.

Jamie : So nice. Nice. I do like being able to get the 411 or the 101 or the really short, "here’s the top level, 10,000 foot view of what you need to know in the next 30 seconds." That’s pretty cool.

What about showcases or cool open source projects that you may know about? If I’m wanting to get started with Uno Platform, I probably want to… I want to learn the basics. I want to run through a tutorial. But then once I’ve done that, I might want to like compare with a pre existing app that maybe they’ve laid it out a certain way, like in the code files, or maybe they’ve laid out the UI a certain way. Are there any cool projects that you know of that are using Uno Platform that maybe I can check out to get a better idea of how everything hangs together?

Martin : Yeah, sure.

We ourselves released several applications under the Uno Platform name on Google Play Store, AppStore, on Ubuntu store as well and on the website so you can browse for Uno Platform where you will find some sample applications already released. We have,for example, Uno.Gallery which is kind of gallery application of all the controls or the APIs and sensors that Uno Platform offers, and you can play with those directly on your phone or in your browser.

And we also have some sample showcases which you can find on the platform Uno website. So there is a link with showcases where you can find many different applications that have been built with Uno Platform. And as an example of something that’s relatable to all listeners probably is: if you know or you probably know NuGet, right? It’s the default package manager for .NET dot when you go to the NuGet website and search for a package and, open that package page on NuGet, on the right side in the sidebar you can find open in NuGet package Explorer and when you click on that link, it will open a webassembly application built with Uno Platform which downloads that package, then extracts it and lets you see the contents of that package. You can see the assembly information, all the PDB info, you can see all the dependencies, you can even browse text files or image files there. So it’s kind of a good way for library authors to quite easily see what a specific NuGet package contains. And even you can open a local NuGet package that you have downloaded from somewhere and you want to just inspect it quickly. You can just upload it to that site and it will show you all the contents. So that’s pretty cool.

And that’s a good example of how extensive can a .NET application running in the browser go, because it’s just a website which takes a file, extracts it, and then gives you all the information in a fully local way. There is no network communication going on. If you open a no get Nougat file from a local file system, it just extracts it within the browser and shows you the contents locally without any network communication, which is super cool, right?

Jamie : That’s really cool because that’s like, that’s a use case that I have because I want to know what’s in NuGet packages and to be able to sort of poke around and see what’s there. So that’s. Yeah, folks, if you don’t do that already, go do that and use the NuGet package Explorer to do that.

Martin : Shout out here to Claire Novotny because she allowed us to take the existing NuGet package Explorer from WPF and rewrite it to be a webassembly application running in the browser. So that’s all her help that helped us get that application to the browser and to everyone through NuGet.org. That’s pretty cool.

Jamie : Nice. Okay, cool.

So what about like getting in touch with you or Uno Platform or anything like that, right? Like, let’s say someone’s listening in and they’re like, "this is really cool. And I’ve built something, but I’ve got a burning question." Can they reach out to you or is it better to go on, like, is there an Uno Platform discord or slack or some kind of community there? Or is GitHub the best place to go?

Martin : Because the team is quite large now. We have people all over the place. We have people in Canada, we have people in Brazil, we have people in Egypt. I’m in Czech Republic and we have a guy in Australia. So it’s a very diverse team with different time zones. So it’s the best to contact us all at the same time because always someone is online and is able to answer the questions. So we have a discord channel where you can, you can find it on our website, you can find the link there and you can ask all your questions there.

And for development, specific questions, usually we prefer GitHub discussions on the Uno Platform repository because there the content will stay for future generations to find answers as well. So we are on discord for the general chatter, but for developer specific questions and things like finding workarounds around issues or fixing some specific issues that could happen to many other people, we prefer to take it to GitHub discussions to preserve it for the future. So that’s probably the best way to contact us. But we also monitor stack overflow if you prefer to post there. And we also have all the social. So we are on X, we are on YouTube. We have also TikTok now. So everything you can reach out to us anywhere you prefer, and we should be able to answer.

Jamie : Nice. Nice.

So folks, go check out those showcases, go check out the NuGet package Explorer, go check out the repo and get building with Uno Platform. Awesome.

Well, thank you, Martin, for sitting with me today and having this chat, because I feel like, I feel like my personal opinion is that there are a few different options for building cross platform UIs with .NET, especially if you’re targeting desktop and mobile. But I feel like there’s very little, at least in, in my experience, there’s not much in the way of, "hey, you’re coming at this brand new, so let’s talk about this from a brand new perspective," which is what I aimed for today. Hopefully I hit that. But like, I feel like a lot of the discussion is, "hey, you already know XAML and you already know WPF and you already know these other platforms. You already already know Xamarin, so let’s go and do that." And I’m like, well, I don’t know any of those things, so thank you for indulging me in this conversation and having this conversation with me and for spending the time during your work day to do that.

So thank you very much.

Martin : Yeah, thank you very much. It was a pleasure.

Wrapping Up

Thank you for listening to this episode of The Modern .NET Show with me, Jamie Taylor. I’d like to thank this episode’s guest, Martin Zikmund, for graciously sharing his time, expertise, and knowledge.

Be sure to check out the show notes for a bunch of links to some of the stuff that we covered, and full transcription of the interview. The show notes, as always, can be found at the podcast's website, and there will be a link directly to them in your podcatcher.

And don’t forget to spread the word, leave a rating or review on your podcatcher of choice - head over to dotnetcore.show/review for ways to do that - reach out via our contact page, or join out discord server at dotnetcore.show/discord - all of which are linked in the show notes.

But above all, I hope you have a fantastic rest of your day, and I hope that I’ll see you again, next time for more .NET goodness.

I will see you again real soon. See you later folks.

Follow the show

You can find the show on any of these places