GithubHelp home page GithubHelp logo

-learn-winui-3.0's Introduction

Learn WinUI 3.0

Learn WinUI 3.0

This is the code repository for Learn WinUI 3.0, published by Packt.

Leverage the power of WinUI, the future of native Windows application development

What is this book about?

This book covers the following exciting features:

  • Get up and running with WinUI and discover how it fits into the landscape of Project Reunion and Windows UI development
  • Build new Windows apps quickly with robust templates
  • Develop testable and maintainable apps using the MVVM pattern
  • Modernize WPF and WinForms applications with WinUI and XAML Islands
  • Discover how to build apps that can target Windows and leverage the power of the web
  • Install the XAML Controls Gallery sample app and explore available WinUI controls

If you feel this book is for you, get your copy today!

https://www.packtpub.com/

Instructions and Navigations

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

while (query.Read())
{
var medium = new Medium
{
Id = query.GetInt32(0),
Name = query.GetString(1),
MediaType = (ItemType)query.GetInt32(2)
};

Following is what you need for this book: This book is for anyone who wants to develop Windows applications with a modern user experience (UX). If you are familiar with UWP and WPF and are looking to enhance your knowledge of Windows development and modernize existing apps, you will find this book useful. Hands-on experience with C# and .NET is expected but no prior knowledge of WinUI is required.

With the following software and hardware list you can run all code files present in the book (Chapter 1-14).

Software and Hardware List

Chapter Software required OS required
1-14 Visual Studio 2019, WinUI 3.0 templates Windows, Mac OS X, and Linux (Any)

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.

Errata

  • Page 12: The sentence "The first ColumnDefinition has its Height set to Auto, and the second has Height="*"." must be read as "The first ColumnDefinition has its Width set to Auto, and the second has Width="*"."
  • Page 30: The sentence "For instance, applications targeting difference versions of .NET Core can be deployed side by side on a machine without creating version conflicts." must be read as "For instance, applications targeting different versions of .NET Core can be deployed side by side on a machine without creating version conflicts."
  • Page 43: The Third point "OnSuspended" must be read as "OnSuspending"
  • Page 47: The sentence "To add a new folder to the project, right-click on the MyMediaCollection project in Solution Explorer and select Add | New Folder." must be read as "To add a new folder to the project, right-click on the Enums folder in Solution Explorer and select Add | New Folder."
  • Page 78: The sentence "From this, you can derive that there is a markup extension class named Binding and that two of its properties are Path and Mode." must be read as "From this, you can derive that there is a markup extension class named Bind and that two of its properties are Path and Mode."
  • Page 78: The sentence "WPF and Xamarin have custom markup extensions, but UWP and WinUI do not." must be read as "WPF and Xamarin have custom markup extensions."
  • Page 92: The sentence "We added a unit test project to the solution with a suite of five unit tests, covering a majority of the MainViewModel logic." is not valid
  • Page 378: The sentence "The file is created in Ain't Markup Language (YAML) format.YAML files are becoming very popular for DevOps workflows." must be read as "The file is created in YAML Ain't Markup Language (YAML) format.YAML files are becoming very popular for DevOps workflows."

Related products

Get to Know the Author

Alvin Ashcraft is a software engineer and developer community champion with over 25 years of experience in software development. Working primarily with Microsoft Windows, web, and cloud technologies, his career has focused primarily on the healthcare industry. He has been awarded as a Microsoft MVP 11 times, most recently as a Windows Dev MVP. Alvin works in the Philadelphia area for Allscripts, a global healthcare software company, as a principal software engineer. He is also a board member of the TechBash Foundation, where he helps organize the annual TechBash developer conference. He has previously worked for companies such as Oracle, Genzeon, CSC, and ITG Pathfinders. Originally from the Allentown, PA area, Alvin currently resides in West Grove, PA with his wife and three daughters.

Download a free PDF

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781800208667

-learn-winui-3.0's People

Contributors

afshaank avatar alvinashcraft avatar christopher-ingram avatar packt-itservice avatar packtutkarshr avatar rashmictech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

-learn-winui-3.0's Issues

Chpt2 - Adding a new item button is not functional

Chpt2 - adding a new item button, calling async function to see MessageDialog is not working. Message window could be initialized

private async void AddButton_Click(object sender, RoutedEventArgs e)
{
var dialog = new MessageDialog("Adding new item is not available yet.");
InitializeWithWindow.Initialize(dialog, WindowNative.GetWindowHandle(this));
await dialog.ShowAsync();
}

Petr

At end of chp 4, OnNavigatedTo

I think this method should be this, so that that if you make a new item, it has items in the lists

protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var selectedItemId = (int)e.Parameter;

            //if (selectedItemId > 0)
            //{
                ViewModel.InitializeItemDetailData(selectedItemId);
            //}
        }

XAML designer will not render any forms in these projects?

XAML_issue

I have installed the WinUI extensions in VS2019 and followed all the steps in the beginning chapter of the book but I cannot get the form to paint in the IDE. I have checked all of the settings in the options menus and my other XAML projects render the form just fine. The only issue I can see is this complaint about the "Microsoft.ApplicationModel.Resources.winmd" in the project references (see screenshot). NOTE: The app will run and compile without issue, but will not render in the IDE.

Anyone have any ideas?

ICommand and other Inteface differences bewteen UWP and WinUI

I was wondering if anyone else was trying this:

I was going to see how far I could get in the book by using the built-in blank UWP template in VS2019.

When setting up a blank UWP project, it seems some of the interfaces aren't compatible.

Specifically the ICommand interface in the RelayCommand class.

I've changed "using Microsoft.UI.Xaml.Input;" to "using System.Windows.Input;" to see if that will work.

Same thing with the Microsoft.UI.Xaml.Interop.NotifyCollectionChangedAction, but I cannot find a replacement besides using System.Collections.Specialized

Is anyone else trying these projects using standard UWP, or is it impossible because of these specialized interfaces and the WinUI library?

@jvsca if you're out there, did you ever make it past chapter 4?

Win UI 3.0 project setup in VS 2019 is no longer correct in the book

Chapter 2 requires updating and including in the errata as it is not clear how to replicate the steps in the book for setting up a Win UI 3.0 project.

This is because the "WinUI Project Templates" in NuGet Manager now shows as depreciated. Yet the option to select "WinUI in UWP" does not yet exist in the latest version of VS Community 2019 Version 16.11.0 (fully update to as of today).

Therefore what is the "correct way" to setup a blank "WinUI 3.0 in UWP" project.

There is information here and i have installed the " Windows App SDK Experimental Extension for Visual Studio" as suggested, however the resulting project created using the experimental template does not contain any reference to Microsoft.WinUI as referred to in the book on page 45 "Reviewing project References"

Note that "WinUI in Desktop" does exist as a project template.

Are there any plans to update the source code for the book to VS 2022?

This book is very helpful even if it is outdated. I am running into the following error when trying to run the finish example for Chapter 3:
Error CS0012 The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. MyMediaCollection C:\aWorkspace\aWinUI\LearnWinUI3-Learn-WinUI-3.0-master\Chapter03\Complete\MyMediaCollection\App.xaml.cs 11 Active

How do I fix this error?

Ch05, IsDirty in ItemDetailsViewModel needs to be changed

old code

        public bool IsDirty
        {
            get => _isDirty; 
            set
            {
                if (_isDirty == value) return;

                _isDirty = value;
                ((RelayCommand)SaveCommand).RaiseCanExecuteChanged();
            }
        }

change to

        public bool IsDirty
        {
            get => _isDirty;
            set
            {
                SetProperty(ref _isDirty, value, nameof(IsDirty));
            }
        }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.