Everyone.
I got a lot of questions recently about windows set up with Don
Moe, preview eight, also doing hot reload with view models and
a bunch of other tips and tricks.
So I wanted to break it down really quick and an impromptu video right here.
So tune in.
Everyone James here.
I wanted to give you some quick tips and tricks when setting up
Donna and Maui preview eight.
So first few things that you want to do inside of your project and solution.
So double click on the Maui app one and make sure that you comment in
this line of code will be commented out by default is going to enable
you to deploy to your windows.
Now the other thing is if you can't deploy for some reason, right?
Click on your solution and go to configuration manager, you want to
make sure that this deploy is set up right there and check that checkbox.
Okay.
Now the last thing to deploy on windows is make sure you go to your
extensions and extension manner.
And make sure that you installed the single project, MSI X packaging
tools for visual studio 2022.
You can do this by going to online type in the word, a single, and it should show up.
Now, if you have problems installing this thing, close visual studio and download
it from this package resource right here, the visual studio marketplace,
it's all there from the Donna Maui installation only to download it like.
I click open and it will basically initialize the physics and I
already have it installed, but it'll walk you through the installation
and have visual studio closed.
Now, once you do that, you can then debug your windows application and complete.
But again, to make sure that this line of code is commented in.
So it's actually there, it's not commented out and here you can go
ahead and start clicking and debugging and doing all sorts of stuff.
You'll get the XAML live preview right here, which is quite cool.
And then additionally, you'll be able to do all sorts of fun stuff like hot
reload, your C-sharp or your XAML.
So for example, here, I actually have a, um, view model that's being
injected with the built independency.
And here I could change this to 20, hit this refresh, open up the app again, and
now we can see it's being increased by 20 or 30 or 40 over and over and over again.
So there you go.
Some quick tips and tricks right there to get started inside of Donna Maui.
Now, the other thing I want to show you really quick too, is that there
is dependency injection all the way through in this application.
So check this out inside of your Mallee program, you're going to see this ability.
And you can add the Microsoft extensions dependency, injection using statement,
which allows you to add singletons or other things into dependency injection.
I've added my counter view model and my main page.
Now the app here is already dependency injection.
So when I go into my app, we can see that I pass at the main
page page, and I set it here.
And additionally, in my main page, Here I pass it, the view model and that
trickles all the way down via dependency, injection, and inversion of control
all the way through to set this all up.
So you don't need to create anything.
You can just simply pass interfaces, pass objects, anything you
want down there, you have it.
Tips and tricks for not only window setup with Don MLB preview and
visual studio, 2022 also dependency, injection, and hot reload with.
Well there, you have it.
Keep the questions common and don't forget to ding that notification
bell hit subscribe, smash, all the things, all the things you want to do.
I'm sitting down and having fun.
I hope you enjoy these tips and tricks.
Let me know if you have more questions, I will try to come back
with even more goodies or answer your questions in the comment below.
Thanks for watching.