-
-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3785 Update to MAUI sample for CSLA 9. This also fixes several desig…
…n issues for how a MAUI application should use dependency injection and navigation. The service locator has been removed. Fixing the issue with the navigation also fixed the issue with how dependency injection should be done. (#4418)
- Loading branch information
Showing
10 changed files
with
121 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace MauiExample; | ||
internal static class Constants | ||
{ | ||
public const string PersonEditRoute = "PersonEditRoute"; | ||
public const string PersonListRoute = "PersonListRoute"; | ||
|
||
public const string PersonIdParameter = "PersonId"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:vms="clr-namespace:MauiExample.ViewModels" | ||
xmlns:models="clr-namespace:BusinessLibrary;assembly=BusinessLibrary" | ||
x:Class="MauiExample.Pages.PersonListPage" | ||
Title="Person List"> | ||
|
||
<Grid> | ||
<ListView ItemsSource="{Binding Model}"> | ||
<ListView ItemsSource="{Binding Model, x:DataType=vms:PersonListViewModel}"> | ||
<ListView.ItemTemplate> | ||
<DataTemplate> | ||
<ViewCell> | ||
<StackLayout Orientation="Horizontal"> | ||
<Label Text="{Binding Name}" WidthRequest="100" Margin="5" TextColor="Black" /> | ||
<Label Text="{Binding Name, x:DataType=models:PersonInfo}" WidthRequest="100" Margin="5" TextColor="Black" /> | ||
<Button Text="Edit" Clicked="EditPerson" /> | ||
</StackLayout> | ||
</ViewCell> | ||
</DataTemplate> | ||
</ListView.ItemTemplate> | ||
</ListView> | ||
</Grid> | ||
|
||
</ContentPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters