Today, I'm going to break down all of the new features and dotnet Maui preview 13.
The team has been working super hard and I'm really excited to
show off some of these new features that they've been working on.
And that I can't wait to use myself.
Now, some of the improvements here are things such as making your apps smaller
and faster, some brand new hammers.
Optimize those controls and a real focus on the startup to configure your
application and add a whole bunch of new, awesome APIs with essentials.
So today I'm going to break it down from start to finish.
So tune in.
Hi everyone.
I'm James, and I'm back with another dinette Mallory preview video.
This time.
Teen, whatever I ever do, 13 with your hands.
Uh, 13.
Now I got to say that David was recent on the Don and Malley
podcast, which you can subscribe to.
I'll put a link in the show notes below.
He was mentioning that perhaps some RC bits are on our way,
but we're not quite there.
Um, we have pre-vis 13 and it's packed with all sorts of good stuff.
And the team has really optimized the start-up of the applications.
They've optimized the configuration and even the templates.
Tune and tweaked even further.
So today I'm going to break it all down now as always, David has a great blog post
announcing the latest features such as all sorts of new enhancements to label format,
text, brand new Maui documentation, hybrid documentation for blazer, um, plus add-on
Maui and all sorts of other enhancements, like new handlers for radio buttons, swipe
view, and tons of control for the web.
And if you haven't checked out the docs, they're always being updated.
So go and check those all out, all sorts of good things like
graphics and controls and brushes and all sorts of beautiful things.
But also you can start building those hybrid applications with blazer
inside of your Don Moe applications, all sorts of good things here.
I'll link to all the documentation that is here as well.
Now, one other thing that David points out is this bootstrapping and focusing
in on the Maui program and you kind of like highlighted this and there's
a lot of new things that are going on.
So the first thing that I want to point out is that when you start
your application, um, the main Maui program is the entry point.
So here, this is where the builder is created.
Configuration happens and it builds it up now, thanks to an
awesome community contribution.
A lot of this.
Rebuilt under the hood for an optimized for speed and performance,
um, and making your apps smaller.
So a whole lot of new optimizations, just when you upgrade to preview
13, you don't have to change any coaches happens automatic.
Now, one thing that you'll notice here is that I'm creating a Maui app.
I'm configuring fonts, but there's a lot more that you can do.
In fact, when you do a dot on the builder, you'll see that there's yes.
Use Maui app, but there's other things like configure animations, containers,
effects, essentials, fonts, image sources.
Um, you're going to get access to logging, to services and a whole bunch of.
Now you might be wondering, well, what is this create builder
thing and what is it doing?
Well, the create builder, it gives you a Maui app builder.
The goal is that you're getting a Maui app back.
So what is this a builder and what does it give me?
Well, the builder gives us things such as an eye service collection for
registering all of our singletons and transients for dependency injection, uh,
configuration manager and logging is.
So it's really nice that you can just get access to all that stuff.
Now let's take a look at some of these things that we have.
So for example, animations or configuring our animations cross-platform
we have effects if we're kind of spicing up existing controls.
If you're using Xamarin, uh, uh, uh, forms of facts, you'd configure them that way.
Essentially.
Now I'll get back to that one.
That's really exciting in this release, but of course we have fonts.
We have image handlers.
Can you figuring Maui handlers.
So actually overriding how the handlers work for displaying controls and
then the logging and the services like I talked about earlier.
Now let's talk about configure essentials, uh, because con configuring
essentials, um, enables us to use over 70.
Native platform integrations.
Cross-platform so this is really nice as the evolution of Xamarin essential.
So doing things like connectivity, file pickers, getting access to the
camera, um, to just getting access to some, um, nice methods like, uh,
campuses and sensors, they're all built.
Now you actually don't need to call this code if you don't need to.
It's more for configuring essentials.
Since essentials is built into .NET Maui, there's nothing else you need to do.
In fact, in this release, the team, optimize it and configure.
All of the boiler plate code automatically, but open the main activity.
It's all registered for me automatically here.
I don't have any boiler plate code for permissions or anything like that.
It's all handled same on my app, delegate.
Nothing is here.
Literally nine lines of code my app XAML same exact things.
Super minimal amount of code here to get my application up and
running, which is super awesome.
Now, what did that means though, is that if you want to configure some of these
more advanced, essential API APIs, you can come in and say configure essentials.
And what we're going to do is pass in, in a little, a little, a delegate here, lamp.
And this E for essentials or whatever you want to name, it gives us sort of, um,
methods or properties that we can set.
So for example, if I wanted to set a map service token for
windows, I can add it here.
If I wanted to use version tracking, I'm using version tracking.
If I want to come in and say, let's add an app action and pass it a new
app action, which is like, when you long press on iOS or Android, and it
jumps to that part of the application, I can say, oh, this is my ID.
This is my title.
And now I literally have an app action right there, which is super duper.
Now that's really nice to be able to automatically
configure these advanced things.
You don't have to figure it all out.
It's all in one nice location, but what about different life cycle events?
So for example, what if I wanted to come in and override?
Maybe when the back button on Android is pressed or a window
is added on windows, for example.
We don't see in here dot configure life cycle events.
Like you would assume we would have.
So if we were to do this, that's what we should get, but sure enough,
if I right click and go into the IntelliSense, we can see that I can
bring in a using statement of Microsoft Mallory, the life cycle events.
And that's going to add extension methods is going to be something very common
with Don Moe applications, which is parts of libraries or new gift packages
that use this app builder to configure.
Add on these different sort of startup code.
Now, this is actually really interesting.
If I do E dot, we have things such as add Android at iOS, add windows,
but as you can see, it's only available on a specific platform.
So that means that we're going to need to conditionally compile our code.
And we can do that with compiler directives.
So for example, Lb if windows over here and we have all these different
compiler directives here, or if I was to say, if Android O F iOS, they're all
in here and you can see that there's iOS 10, 12, 13, 14, 15, or greater
right inside of here, let's just do windows, which means any windows.
And I'm going to say NDF and we'll do is move this E.
And in this dropdown and visual studio, I'm going to say, let's now look at
the windows, see how this lit up here.
If I go to Android, it's not hitting this.
So it grays out.
So I'm going to go back to windows.
And now what I can do is like, I can do something like E dot and we
can see that I have an add event.
I have an added windows and these are different lifecycle events.
I'm looping into.
So here, if I did a windows, I could then say, Alright, windows
dot title, for example, or windows that on native message.
And I could pass in, uh, our Zen, uh, different things inside
of here and get access to these different lifecycle events.
And then I could say app dot extends can content into the title bar.
And I can said that's a false, for example.
So there's all these different properties of windows that I can
set here without having to go in to.
Android project iOS project or windows project.
They're all there for me, which I think is something that's really,
really nice right here automatically.
And I can just see what's happening automatically inside of the code.
Now, the other thing to talk about is actually dependency injection.
I talked about it a lot on the last previ 12, but I wanted to kind of talk about
it a little bit more and what the.net podcast application does and what you can
do in your applications to register your view models, consume them and a lot more.
Now one thing is when you're inside of this specific file, you have
that builder and you can do other things like do builder.services,
and you can add a Singleton.
You can add a scope, you can add logging, you can add a transient for example,
and you can add these different types in your application that you might pull down
later for dependency injection, which is something that's super duper nice.
Now one thing that I definitely want to show off is that inside of
our podcast application, let me go ahead and just pin this up over here.
We have some nice things.
So for example, we can add, um, our services.
So here we're adding a single 10 for our listen later.
Um, Here we can add a transient for our wifi options and basically
adding a transient means that it's going to create a new one.
Every time it's called a Singleton is a single instance of it.
So that's actually super duper.
Nice.
We can see that here.
So for example, if I was to add a Singleton.
Uh, for our, let's say a main page of our application.
I've now just set up our main page to have a Singleton and
return the same instance of it.
Every single time you can also do ad transient, right?
So probably you'd want a new page, a new view model, uh, to
be called up every single time.
Now the nice thing here is when you're using these builder services, you can
do, um, um, con constructor injection.
So on my main page, if I specifically put something into this constructor, like a
main page view model, registered my main page view model, it would automatically
figure out those dependencies and inflate them automatically for me.
So that's something that's super duper now.
Now that's it from a high level, those are some of the brand new things.
And .NET Maui preview 13, of course it is continuing its evolution,
which is great to see, of course, put links into all of the different blog,
posts, documentation, and source code references that are out there as well.
I hope that you're really enjoying these videos and if you are, and
if you've made it this far one, I appreciate you for being here.
And if you want to do me a solid group really appreciate it is
hit that like button down there.
And what that does is it tells YouTube that you literally like this video and
it helps other people find this video through the YouTube algorithm of goodness.
If you liked this video or any other ones that I put out here on my channel.
Super appreciate.
You could hit that subscribe button and ring that notification bell.
That's going to make sure that you're notified every time we put out a new
video, we don't want notifications.
That's okay, too.
They'll show up in your subscriptions feed.
And as always, I really appreciate all of you love doing these videos.
I do them all in my spare time.
It's literally literally seven o'clock here on 2 23.
22, which is pretty cool.
Um, now that I've dated this video really love it.
Um, but I hope that you enjoy it.
I love answering all of your questions in the comments below.
So feel free to head down there on any of the videos.
I try to keep up as much as I can only so many hours in the day, but of course.
Find me more and your subscribed.
Don't forget that I also live stream on occasion on Fridays, usually around
8:00 AM Pacific right here on YouTube.
And I actually have a live stream archive on the most recent live stream.
I actually built a clone of a clone of a Wordle, the popular trending word game,
all in .NET Maui, which is super fun.
So definitely check that out.
I'll put at the end of the video, if you want to go ahead and check
that out, but again, thanks.
Appreciate the likes of subscribes and until next time.