I am trying to develop a WinUI 3 application in C#. Following is the GitHub repository link for the application code:
My Friends Collection
It is basically a duplicate application from a Packt book “Learn WinUI 3.”
I am having two issues, that I have been unable to resolve.
- The SelectedMedium is not displayed in the view, while in the debut info, it gets the correct value and all other variables are displayed correctly. The problem code is located in FriendDetailsViewModel.cs at line 77. We can add friends to the collection through the add button on the main page. When one double clicks a friend on the main page, it is navigated to the Details page, where pre-populated information should be displayed, but SelectedMedium is not.
Image for Details View
- When on the page, if any friend is selected, the Delete button is activated. Upon clicking the Delete button, the friend should be deleted from the database. But it gives an exception and the application crashes. The code for the Delete command starts from the MainViewModel.cs line 126 and navigates to the Services.SqliteDataService.cs where the code for database deletion is handled.
If anyone can please help me in solving the above issues, I shall be very grateful.
I have tried all the debugging for my application.