Do you ever wish that the .NET
MAUI templates were a little bit more extensive? Maybe it installs a couple
of plugins when you start a new project. Well, then this video is for you. In this video, I'm going to show you
not 1, but 2 options to get much more extensive templates
for .NET MAUI apps. For starting .NET MAUI apps, the
first is going to be by Allan Ritchie. You probably know him from
the Shiny plugins, the amazing open source work that he's been doing with
that. And of course, he's been doing amazing open source work for Xamarin
and for a long time. So definitely check out his profile and all the plugins
that he has and consider sponsoring them. That also goes for the other person
that we're about to see. But Allan has been around for a long,
long time. And now also under his Shiny name, he has created a
very extensive template package for .NET MAUI apps. It has a
full list of checkboxes basically that you can put in there
and it will all come along inside of your .NET MAUI
application. And you will have a very complete project from starting a new
.NET MAUI application. So that's really great. The second one
is by Matt Lacey, also open source out there, longtime
community member since Xamarin. Now .NET MAUI doing some
amazing work and he kind of like followed the same path
as Allan, but a little bit different. So I decided to do a little video
about this and show you what all the options are, how to get started
yourself. Do let me know in the comments. What do you like or
don't like about the current templates of .NET MAUI, and what do you like
about these templates that you're about to see? All right, let's just dig in.
And here we are in Visua... No wait, this is not Visual Studio.
What's happening? All right, so here we are in a command line prompt. This is
the Windows Terminal. If you have the old school terminal, that's fine too.
Whatever works. And I'm just going to fire a command
in here that will install the templates for Allan Ritchie's thing. So
let's look at the shiny templates first. And what you can do is dotnet
new -i Shiny.Templates. So what this basically does is this is
a NuGet Identifier. So this just downloads a NuGet package
with templates and the net new command. I will tell .NET like, hey, this is a templates package. Install that inside
of my .NET instance on this machine, right? So whenever
you do that, it's going to think a little. The following
templates will be installed. Success. The version number is
installed and it provides you with, let me make this window a little bit
bigger so that it shows a little bit nicer. So we have these three
templates that it installed. So it's not just .NET
MAUI, it's also Bluetooth hosted characteristics. I have to ask
Allan what this is actually all about. But the most important one
for us here is the shinymaui one and the
shinymauitests, right? So there's also a little test
project in here. So what you can also do from the command line, but it's a
little bit less impressive than in Visual Studio. You can definitely do dotnet new, And then you can use this short name
right here, right? So under this column you can now use any of those
Identifiers and create a new project that way. So I can do shinymaui and then I
can think, I think do -n to specify a name. MauiTest, right? So it's going
to generate the template like this. So I got options here as well.
You can actually influence all the options that Allan has put in here
through the CLI as well. I'm not going to do that. I'm
going to show you because I'm a lazy developer. I'm going to show
you in Visual Studio. So let's start Visual Studio right now. 2022, the community
edition. You can get started entirely for free
if that's what you want. And I'm going to scroll down. Don't worry, this is
not a new Visual Studio 2022 feature. That all the
fonts and the things are blown up like this. This is just so I did it for you so
that you can review it good on your screen so that you can
read all the things. So that's why it might look a little
bit off here and there in the layout, but nothing to worry about for
you. It will probably show up fine. So create a new project
right here. And whenever we do, we're probably going to it's going
to think a little bit. Searching for the new templates. And here you can see we
got a couple with like a new tag on here, right? So we see the same
templates that we've just installed here in Visual Studio. So you can see
the Shiny MAUI Application. That's the one that I'm after. We can
also see that device runner one, and the other one is probably
somewhere in here as well. But I'm going to click the Shiny MAUI Application and
do next do Project2. It comes up with that
name. Sounds perfect to me. Project2. And now we get to a
dialogue that Allan well, you know, this is inside of
Visual Studio already. Allan just provided this configuration, right?
But this is the dialog that Allan added for us with all the
configuration here. So you can still choose the framework, right? So .NET
6, .NET 7, set the ApplicationIdD. So you can change the
ApplicationId from right here. No need to go to your csproj
afterwards or the project properties or something like that. You can do it
from right here. You can have check marks for adding the Shiny
framework. So that adds like all the Shiny bits. Go look into that or
let me know down in the comments if that's something that you're
interested in. Add a AppSettings. So Shiny also has a package for reading the
configuration from a JSON file. So that's something that is ticked
right here and you can get that out of the box. Your App Center key. So if
you haven't seen my videos on App Center, go check out the corner of
your screen right now. App Center is back, has support for .NET MAUI and you can
input your key right here and that's automatically hooked up for you. So
how cool is that? Now let's check out what else do we got here? So we got a bunch
of Shiny options. Obviously this is created by shiny by Allan Richie. So
we're going to have a lot of Shiny. You can add Bluetooth, low
energy client hosting, beacons, background jobs, GPS. I can
use this as a checklist for a todo list for all
kinds of videos, basically. NFC. So you can do all the Shiny things
right here. Local notification, speech recognition. You can actually
add push notifications so it will probably generate some
boilerplate code. You can here also go over like these little i icons and
it will come up with a tooltip with a little bit
more information. So add push notifications. This will probably add
some boilerplate code for adding push notifications in a native
way, using together with Firebase. It will install a plugin
with that as well, maybe Azure Notification Hubs. You can get all
that out of the box. Authentication setup. Just plug in
your Microsoft Authentication Library
Client ID and it will probably set it all up for
you automatically. That would be amazing. So again, let me know for all the
stuff what you want to see down in the comments. But you can see it
also has a couple of other libraries that you can install, right?
So .NET MAUI Essentials with the media picker. The .NET MAUI Community Toolkit
already checked. You should totally have that in all of your
projects. So the .NET MAUI Community Toolkit is in here if that's what you want. Add
barcode scanning, in-app... Well I could read them all to you but it
has this great, great list of plugins. A lot of the plugins that are
out there for .NET MAUI right now, you can just check them and you can be
added inside of your new .NET MAUI app. So if you do fingerprint,
audio, barcode scanning, let's add a couple of these
and just click Create basically. And then it's going to create a File, New App project just as you expect it to, just as you
would normally do from Visual Studio. But now with all of this stuff already
installed so if we look at the dependencies it's
restoring them right now. I can go to net iOS packages and you
will see all the packages that I've just clicked, right? So you will
see the Toolkit, you will see the fingerprint, the MAUI
Audio. All these packages are right here for you to use. And if
we go to like the MauiProgram, then you can see that it's all set up here inside of this
MauiProgram, inside of your app host builder. So it will have the UseBarcodeReader,
it will UseCommunityToolkit, already configured. You don't need to
do anything. Basically, you can just click Run and it will start running your
application. So that's it for the Shiny template, which is
already very extensive. But now let's have a look at the other one. So back
in Visual Studio 2022, I closed the previous .NET MAUI
application. I'm sure that you can run it and you believe that
everything you'll see there. So let's have a look at the other package,
which is called the MAUI App Accelerator by Matt Lacey. So you install this a
little bit different. You go to the Extensions. It's distributed as a
Visual Studio extension. You can do Manage Extensions. And here you can search
for all kinds of extensions. You can see ReSharper, you can see
Serene, you can see SQLite, all kinds of things. We're going to
search here in the search box. Now again, this looks a little bit blown up with
all the fonts. So you can see it right here on this video, a little
bit more clear. And you search for the MAUI App
Accelerator. We have this package right here with a little goat icon. I should ask
him what that's all about. And you can just click Download. But
what's happening here? It will download the package, but it only will
go through if Visual Studio is restarted.
You can see it here down at the bottom with this gold
bar. Your changes are scheduled, will begin when all Microsoft useful
Studio windows are closed. So I need to close all the windows. And
then it starts actually installing this extension for
some extensions that's needed. So you can see the installer coming up
here. It's going to have to do this thing, read all the
licenses, all the release notes, click Modify and it's going to
install this inside of my Visual Studio Community 2022. So let's
just wait for this to finish up. So the modifications are
complete. I can just close this window and I can now restart a Visual Studio.
And whenever I do, I will see the template. So let's
scroll down here again and create a new template. And what I
should see now is again, the MAUI App Accelerator with a little new tag
here. And I can start a new MAUI App Accelerated app, which is still
going to be a .NET MAUI app. But now with all the options in here,
right? So let's select that, click Next again, configure all the
options that you would normally do the project
name, location, etc. Create. And now I get this new
dialog. Oh, my gosh. And again, this might be styled a
little bit weird because I have the fonts all blown up so hopefully it will look
a little bit nicer for you. But this is with a divided in a couple
of different sections where the Allen one is just a list of
checkboxes which is totally fine, but this looks a
little bit different. So here you can select the .NET version, same as
before, .NET 6, .NET 7. And here on the left you
can go through all the steps or you have this project details here on
the right as well. But let's go through the left thing here, coding
style. So you can choose if you want to implement MVVM through the MVVM
Toolkit. You've got that right here. You can click on the details, read all
about what this is actually is. Go to the licenses, go to, I don't know, the website maybe. So
you have all these things or you can just do the code behind,
right? So the code behind as it is from the default template, you just
get XAML code behind and that's basically your thing. I'm gonna go with the MVVM
toolkit navigation style. You can choose for flyouts,
completely blank or tabs. So that's basically a couple of
different ways to go about your .NET MAUI app and have that navigation
already ready for your new app. You can already include pages, so if
you know that you're going to have a couple of pages that
you just want to have from your new template, you can add blank pages.
You can see that plus button here and I can add new ones and you can see
them here, pop up on the right and you can name them already.
So you can already have all your names, all your pages set up. Or
you can have a different type of page with a ListDetail or a DrawingView.
So this is the .NET MAUI Community Toolkit DrawingView
and you will have a page dedicated to the DrawingView ready for you to go. And a WebView, same thing, just a
sample one, a localization example. All of that
inside of the box, you can just add it. So let's add the localization
example and see what that's all about. And we get that in here. Now then we
have features, so you can also have a
xUnit test project. I can just add that. So let's do that
and see what's coming up here. This is probably more features will
show up here over time, whenever Matt gets to implement them.
And here down at the bottom, this is really cool. So he has listed the
sponsors that make this possible. So the GitHub sponsors for his project
are down here and if you want to be there, I suggest
that you do want to be there, then join them, click that
button and figure out how to sponsor him for whatever amount
that you can miss that's. Really cool for his hard work. And whenever you
have set up everything, the buttons are a little bit hard to view here.
Oh, I see. I should have brought this to the side a little bit. Sorry
about that. And you have this Create button here, right? So again, it feels
a little bit weird here, but it's definitely there. So click Create and
it's going to create again this project with everything that is set up,
everything that you have selected in this template. So let's wait a
little bit for this project here to come back up. And whenever it does,
we should have a ready to go runnable application with the
pages, with the unit test project. Everything here ready
for you to go. So let's see if I can get this out of
here. There we are. You can see this test
project has created that. Here we have our MauiProgram
with Views and ViewModels because I set like the
MVVM Toolkit. I want that right. A couple of MarkupExtensions for our
localization right here. And all the views and all the things. Also the MauiProgram. So
this doesn't have as much plugins like Allan's one. So
Allan's templates revolves a lot around like,
hey, the plugins that you can already install and configure. And
this is more about how you want your project structure to work and the navigation
and that kind of stuff. So how cool would it be if they could maybe
find each other and create one Megatemplate Configurator 2000 for
this so that we all have this in one place.
But these are like depending on what you need really cool solutions to get
your .NET MAUI app kickstarted. Now, I don't know about you, but I am
pretty excited about all of this stuff. This will make it so easy to
make a configurable .NET MAUI app. If you're starting from scratch,
you select all the things, you select the navigation, the plugins that you
want, and boom. You have such a complete .NET MAUI application that you can
start working on productivity from the first minute, basically. So
that is amazing. Thank you so much, Allan and Matt, for putting this
together. This is really powerful stuff and I can recommend everyone to start
looking into this. Now, what's next? I already mentioned it a
couple of times. Please let me know down in the comments a couple of things.
What do you think about our default templates from .NET MAUI? What do
you think about these template solutions? And what video should I make more
from? All the options that you've seen in these templates right here. So
please let me know down in the comments. Click the like button if you actually
like this video so that it spreads throughout the YouTubes and more
people will benefit and know about all this goodness. Thank you so much
for doing that. And I'll be seeing you for my next video. And
might I suggest this playlist right here with more .NET MAUI videos so you can
binge watch all you want. And this suggested video by YouTube,
which is customized to your needs only. See you for the next
one.