Welcome back everyone to another Xamarin one-on-one video today, I'm
going to show you how to prepare your xamarinforms shell application for
real world work by clearing out all this stuff in the default template.
So you're ready to go.
So tune in.
Hey everyone.
Welcome back.
I'm James Monta Magno.
I'm a program manager lead over at Microsoft, but the dinette community team.
And I've been a long time Zammarin developer for over
a decade or nearly a decade.
At this point, I would like to say I'm focusing on cross platform, mobile
development with Xamarin, and we've been building out our Xamarin application.
I've been walking.
Through deep dive videos of getting started with Xamarin
going into late 20, 20 into 2021.
And I'm really excited to talk about shell and all the amazing things that we can do.
And we've been building out my mind, coffee application.
We have a few videos that I put over there or down there looking at the description
of creating your first app, setting it up.
Upgrading new gets kind of doing everything you need to do.
And now we're at the point where our application is ready to begin code.
And the default templates for shell have a lot of stuff in them.
And I love shell because it has URL navigation.
It's easy to set up tabs and fly out and really gives you a
lot of benefits to using shell.
And it sort of the next generation of how you're going to build
apps with Xamarin and Xamarin forms and going into Donna Maui.
But.
There's a lot of stuff in there.
So we want to walk through what's in the templates, what we can
delete, and then we're going to start building our application.
So let's head over to the desktop.
All right.
I'm over here inside of my application.
And as we can see, I have my coffee app.
Now this is the default template, which means that you
have a lot of things in here.
So you have.
Models services, view models, views.
This is an MVVM type of architecture.
We're going to talk about MVVM in a future video.
So make sure you subscribe to the channel, hit that notification bell.
So you get up to dates of all the new episodes that I have here.
Now we have, uh, stuff in my, my coffee app, Android and iOS, and
those are gonna remain the same.
There's really nothing in there.
Um, that is pertinent to this application.
Um, maybe I guess, inside of resources, there are some images that we may
update at some point, same thing on iOS.
If we go down here to resources, we may see some things that we can
delete in the future, but for the most part, uh, we can just sort of.
Stay and live inside of this world.
Now, if we run this application, we'll see why the Xamarin team has given us
such a large template is because they want to sort of give us everything.
We need to understand the shell concepts.
And in fact, there's a getting started page that walks you through.
Using hot reload, more information with an AK out Ms.
Link documentation is sort of everything you need.
So there's default application, whether you select bottom navigation
or fly out, navigation are going to give you a master detail.
Sort of items, details, view.
And I think the team did that mostly because that's what
a lot of applications are.
And, uh, this is probably a good structure for your application where
you might open up, you may have a fly out, you may have a list of items here.
You may click on one, go to the next page, add one, you know, come in and
have some type of application here.
Now our application is not going to be.
Similar to this at all, because we're building a coffee application,
that'll have probably different tabs.
We may use the fly out.
We may use tabs.
We may change that in the future.
Um, we are going to have a way of tracking our coffee consumption.
We're going to have a way of browsing a list of coffee items, which is cool.
Um, but for our application here, we're going to just delete everything.
Uh, that's what I'm really going to show you today is how I start
applications as I like to come in.
Look at this template, browse how this thing is set up.
How are the view models?
How is the navigation working?
And this is sort of a good reference to how I may start my application.
Today.
Um, but I don't need all this stuff.
Right.
My application doesn't have a login view.
It doesn't have a new item view.
So we're just going to delete everything inside these folders.
So I'm going to delete all my view models.
Let's go ahead and minimize this emulator here.
Um, we are going to go ahead and delete that.
Okay.
Here are item, which is just a simple, you know, item of ID, text description.
We're going to delete that.
These are our models.
So this might be our coffee, you know, equipment, things like that in the future,
all of our views for our about page items page, and we're going to delete
all those delete, delete them all here.
Now I think the data services are actually quite interesting.
You may want to keep sort of the, the interface that it has here.
Um, but it has this idea of.
Add update, delete, and it's all generic, which is really cool.
So this actually can stick, stick around fully with our item inside of here.
It allows us to kind of have a data store that is all set up for us and
even has a mock data store here.
And what's nice about this is that while it does have items.
We could put in some sort of other item inside of here just
to lead this market data store.
And this just shows us how to add insert, delete items in here.
So if you're interested in sort of an in-memory cash, that's not too
bad, but for us, we're going to delete them, delete all the things.
Delete those here.
Now I like to keep the folders because this is exactly how
I create my application.
Um, uh, in 2020, as I have models, view models and views and the VVM,
uh, inside of here, um, I like to then come and create like whatever
our default page is going to be.
So let's just say, I say, create new item.
And here under Xamarin forms, we're going to create a content page.
Now there are two types of content pages here, a content page with,
um, Uh, XAML is the first one.
And then the next one is just C-sharp.
I use XAML as our markup language, create our UI.
So I'm going to go ahead and select that.
And let's just for now, we'll just call this, um, coffee
equip mint page, uh, in general.
So I like to just have one page that says something.
So at least I can put it in my UI.
Then, what we're going to do is come and look at what's in our app and app XAML.
Well, if I dropped down, we can see there's code behind here and
our app XAML has some things in it.
Um, it's nothing special.
There's, um, a primary color for our application.
That's here and then there's this style for our button.
I'm just going to delete that.
So it's empty.
That looks fine.
Let's go to our code behind.
Here, we're going to delete this dependency service, our mock data store.
We don't need that.
And that looks good in our app shell.
Most of this stuff is going to say it gives us all of our tab bar and
fly out styles that are in here.
There is some styling specifically for the fly out items.
We'll keep those for now.
And then down here, we have a bunch of just information for our
log-in screen, some templates.
Let's just go ahead and delete all of this for now.
And we'll leave one fly-out item, which I'd just like to keep one in
there and it'll be the, um, let's say equipment, the route, which
we'll get to later for navigation.
Well, go ahead and say, equip men page.
Then all we're going to do is change this over to coffee equipment page, and that
we'll go ahead and find it there for us.
So perfect.
So we have our about page.
We have one fly out item, one, shell content and some visual states.
So these are mostly.
Important for the, how the fly-out is set up.
So here's so far just deleting some stuff, not too bad.
Now, the last thing we needed to go is to the code behind for the app shell
here, we're going to be registering some routes so we can delete that.
We can also delete this on menu, click, and now we're sort of in a.
Blank type of page.
We'll go ahead and just remove unnecessary.
Usings up top.
Let's double check our app.
XAML shell.
Sure enough.
We need to go ahead and remove those two and hopefully we can compile
our dotnet standard library, which would give us a clean blank template.
And if so, then we are, we're kind of ready to code.
We still have our folder structure in place, but we have our blank
shell application and you may be saying, well, James, why did you.
Not just create a blank application.
And why did you create a shell application?
Well, the blank application doesn't have any of the shell infrastructure styling.
So I figure it takes me one minute to delete everything and let's
just go with them with that.
Because to me it's easier to have that template in place,
all the infrastructure in place.
So I'm ready to go.
And in fact, here we have our blank application.
We should see that I have one page for equipment.
If I come into my page here and I change the background color to orange, I guess
this would be background, color to orange.
It's going to go ahead and, uh, should update for me on the page.
There we go.
So, so far we have our page set up or ready to go.
We have our default equipment page that we're going to start building out, but
our shell application is good to go.
There's nothing in our models, nothing on our services.
Our views will be created.
And the rest of our application is all set.
I could delete those other icons if I'm going to delete those, but we're going
to, if we're not going to use them, but in the future, we're going to actually
be using fonts icons, which I'll show you how to set up in a future video law.
Right.
That was a short video just to get us started building our
application was shell at a sort of.
Remove and get shell to the default blank templates or ready to go anyways.
Hopefully you've been enjoying these Xamarin one oh one series, got a lot
of good feedback in the comments of what type of things you want me to
be building what you want me to show.
I do like these to be a little bit longer.
So I'm able to kind of describe in more detail what I'm doing, what I'm
diluted, deleting, and what I'm updating.
Of course, make sure you subscribe, ending that notification bell.
So you get.
Updates of all the news Amarin one-on-one videos or other
videos I do here on my channel.
And don't forget that I am building applications live on my Twitch account
at twitch.tv/james Monta Magno.
And for anything me, you can go to dot com or follow me on
Twitter at James Monte Magno.
Thanks for tuning in, make sure you like and subscribe, like I said
earlier, and thanks for watching.