Adding some new controls to the project
In this section, we are going to use two controls that are only available to Windows applications with WinUI. We are going to change the Save button to SplitButton
to allow users to save and return to a list of items, or save and continue adding another item to the item details page. Then, we will add a TeachingTip
control to inform users of the new saving capabilities. To follow along with these steps, you can use the Start project on GitHub (https://github.com/PacktPublishing/-Learn-WinUI-3.0/tree/master/Chapter05/Start). Let's start by updating the Save button.
Using the SplitButton control
Follow these steps:
- First, in
ItemDetailsViewModel
, add a newSaveItemAndContinue
method to be bound to theClick
event of our newSplitButton
:public void SaveItemAndContinue() { SaveItem(); _itemId = 0; ItemName = ""; SelectedMedium...