Learning .NET MAUI – Part 3

Our app will spring to life in AppShell.xaml. We’ll be putting a few additional things there, but key for now is the ShellContent element

    <ShellContent
        Title="Home"
        ContentTemplate="{DataTemplate local:MainPage}"
        Route="MainPage" />

As you can see there are three attributes: the Title, the ContentTemplate and the Route. The interesting ones are the latter two. We’ll talk about ContentTemplate in a bit. The Route speaks to the way navigation is performed in MAUI, and that is (surprise!) by using “routes” (you can think of them as URIs.) In this case, the Route couldn’t be simpler: we’re going directly to MainPage.

Let’s turn to MainPage. We’re going to start by noting that MainPage is a contentPage – the most common sort of page for MAUI. You can add controls, but like in Xamarin.Forms the page can only have one control, but of course layout controls can have child controls, so that is not burdensome.

Continue reading
Posted in .NET MAUI, C#, Essentials, Maui, Programming | Tagged | Leave a comment

Learning .NET MAUI Part 2

As noted in part 0, I assume you are a Xamarin.Forms/C# programmer, familiar with Visual Studio. This series is not about converting your existing Xamarin.Forms apps; rather it is about converting your brain to MAUI. Since I’m learning as I’m going, your mileage may vary.

Community Toolkit

One of the tools you’ll absolutely want is the .NET Community Toolkit. It is available as an open-source project on GitHub. There are all sorts of goodies in there and you may want to take the time, at least, to read the Read.me file.

Continue reading
Posted in Essentials | Tagged , | Leave a comment

Learning .NET Maui Part 1

As noted in part 0, I assume you are a Xamarin.Forms/C# programmer, familiar with Visual Studio. This series is not about converting your existing Xamarin.Forms apps; rather it is about converting your brain to MAUI. Since I’m learning as I’m going, your mileage may vary.

To get started, install the preview edition of Visual Studio 2022 (that may not be necessary by the time you’re reading this) which fully supports MAUI. Next, create a new project. We’ll call it ZipCodeFinder because we’ll be using the web service ZipWise which is free for limited use (which is all we’ll need).

Open VS, create a new project, and choose the .NET MAUI app template:

All In One Project

Notice that the entire solution is now in one project. You could make the argument either way for this design, but this is what Microsoft decided, so let’s go with that.

Continue reading
Posted in Essentials | Tagged , | Leave a comment

Why Novice Programmers Can Be Confused

Programming is not easy. It is made particularly difficult by legitimate statements such as these from a Xamarin.Forms project:

 public Size Size = new Size(276, 180);

This can be followed by

               var popup = new SwipePopUp
               {
                   CheckBoxText = CheckBoxText,
                   GotItText = GotItText,
                   CentralText = CentralText,
                   Size = Size
               };

If the first line doesn’t kill you then the last ones will.

Posted in Essentials | Tagged | Leave a comment

Learning .Net Maui – Posting 0

I’m going to start a serious attempt to upgrade my skills from Xamarin.Forms to Maui. I’m not sure how difficult this will be, but I’m starting with James Montemagno’s excellent video/code course for beginners.

Unfortunate for me, and perhaps for you, is that his course is targeted at people new to Xamarin, Xaml, etc. In the following posts, which will come out sporadically, I will target my work towards intermediate and expert Xamarin.Forms programmers. That is I’ll assume you know and have experience with

  • Xamarin.Forms
  • Xaml
  • C# 7 or later

Since I’m really learning this myself, these will not come out on any strict cadence, but only as I learn something new. I will do everything I can to make sure what I provide is accurate, but let me know if I’ve done something dumb.

All the code will, of course, be publicly available on github.

Posted in C#, Maui | Tagged | Leave a comment

Robert “Uncle Bob” Martin on Agile and more…

Incredibly pleased to have one of the pioneers in Agile programming: Robert “Uncle Bob” Martin.

Uncle Bob is known for, among other things, his SOLID principles of development. He is the author of the seminal book Clean Code along with Clean Coder and one of my new favorites Clean Agile.

  • 1995. Designing Object-Oriented C++ Applications Using the Booch Method. Prentice Hall. ISBN 978-0132038379.
  • 2002. Agile Software Development, Principles, Patterns, and Practices. Pearson. ISBN 978-0135974445.
  • 2009. Clean Code: A Handbook of Agile Software Craftsmanship. Prentice Hall. ISBN 978-0132350884.
  • 2011. The Clean Coder: A Code Of Conduct For Professional Programmers. Prentice Hall. ISBN 978-0137081073.
  • 2017. Clean Architecture: A Craftsman’s Guide to Software Structure and Design. Prentice Hall. ISBN 978-0134494166.
  • 2019. Clean Agile: Back to Basics. Prentice Hall. ISBN 978-0135781869.
  • 2021. Clean Craftsmanship: Disciplines, Standards, and Ethics. Addison-Wesley Professional. ISBN 978-0136915805

You can also listen to this wherever you get your Podcasts.

Posted in Agile, Essentials | Tagged | Leave a comment

Missed Patents and other sad stories

I expect most people my age have had great ideas they never patented. I’ll list a few here just to make myself feel better and to encourage you to post yours (these are ideas that are already patented or can’t be)

30 years ago when we got our puppy I put up some bells on the door and taught him that ringing the bells means we’ll take him out. He never abused the privilege. Now, doggy bells are every where.

My best invention was 25 years ago. I suggested to the people I was working with that we create a drop down button. The idea was a button with an arrow next to it. You click the arrow and a small menu appears. Whatever you pick from the menu appears as the text of the button, and clicking the button takes that action. Woe is me, it is everywhere today.

Also about 25 years ago I conceived of Quake Awake — I had read that people who awaken at the beginning of an earth quake are likelier to survive than those who sleep through: hence: Quake Awake. It would look like a smoke detector, and you could set the sensitivity, the necessary duration of quaking, the times of day (if you only want it to go off if you are sleeping) and etc. I even had a patent lawyer tell me it was a great idea. Woe is me, you could now write that as an app in about 4 hours.

Post your almost-inventions.

Posted in Non-technical | 1 Comment

James Montemagno on Maui!

I’m joined by James Montemagno, Principal Lead Program Manager for .NET Community at Microsoft, and the most enthusiastic person I know. James is the author of the .NET Presentations – .Net Maui In A Box, among many other things.

You can also listen to this wherever you get your Podcasts.

Note: My microphone was broken but I’ve edited most of my questions to the minimum and James sounds great. And, after all, it is James who you want to hear anyway!

Posted in Maui | Tagged | 1 Comment

.vsix with Mads Kristensen

.visx files are magic as far as I’m concerned. Mads takes us through their history and how they have become much easier to create.

 vsixcookbook.com

Yet Another Podcast is available wherever you get your podcasts.

Posted in Essentials, Visual Studio | Tagged | 1 Comment

Visual Studio Champ

Part 1 of Being a Visual Studio Champis now on video!

This is a 3 part conference streaming from Denmark and world-wide. vschamp.com

Do not miss the next one on Add-ons with (among others) Mads Kristensen. April 27, 10am Eastern.

vschamp.com

One of my secret wish items was the ability to set the background color differently for different projects so I always know where I am. The problem was that it tells you your project in the upper right, so I didn’t want to whine about it. Well guess what, I installed VS2022 Preview today and saw this:

Happy, happy, happy.

Awww snap! It works across projects (yay) but not across solutions (boo). Maybe next time.

Posted in Essentials | Leave a comment

What I Want in Visual Studio 2022 That Isn’t There (updated)

I love Visual Studio 2022. I spend all my work day in it. It is by far the best IDE I’ve ever worked with. Each iteration gets better, with amazing features. But I’m greedy, so here are some features I want…

  • Save and name my entire working state (e.g., windows open, breakpoints, bookmarks, etc.) Then if I have to switch to another branch I can come back, drop down a list of saved working states, select the one I just saved and get back to work.
  • Switch to make the default for C# classes public (rather than internal)
  • News Flash! Mads Kristenson’s Tweaks2022 let’s you create new files with Shift-F2 and the .cs files are born public!!
  • During debug of a Xamarin.Forms app, take some action (tbd) to find out what Xaml file you are looking at
  • Of course, a visual designer for Xamarin.Forms (Blend?) – Layout, visual states, animation

Send me more! jesseliberty@gmail.com

Posted in Opinion, Visual Studio | Leave a comment

Jon Galloway – Yet Another Podcast

Jon Galloway comes on Yet Another Podcast to talk about… well, a lot of stuff.

Posted in Essentials | Tagged | Leave a comment