Add new pages
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
MainPage = new AppShell();
|
||||
MainPage = new NavigationPage(new MainPage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Shell
|
||||
x:Class="asugaksharp.AppShell"
|
||||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:asugaksharp"
|
||||
Shell.FlyoutBehavior="Disabled"
|
||||
Title="asugaksharp">
|
||||
|
||||
<ShellContent
|
||||
Title="Home"
|
||||
ContentTemplate="{DataTemplate local:MainPage}"
|
||||
Route="MainPage" />
|
||||
|
||||
</Shell>
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace asugaksharp
|
||||
{
|
||||
public partial class AppShell : Shell
|
||||
{
|
||||
public AppShell()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,34 +3,14 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="asugaksharp.MainPage">
|
||||
|
||||
<ScrollView>
|
||||
<VerticalStackLayout
|
||||
Padding="30,0"
|
||||
Spacing="25">
|
||||
<Image
|
||||
Source="dotnet_bot.png"
|
||||
HeightRequest="185"
|
||||
Aspect="AspectFit"
|
||||
SemanticProperties.Description="dot net bot in a race car number eight" />
|
||||
|
||||
<Label
|
||||
Text="Hello, World!"
|
||||
Style="{StaticResource Headline}"
|
||||
SemanticProperties.HeadingLevel="Level1" />
|
||||
<VerticalStackLayout Padding="20">
|
||||
<Label Text="Это MainPage" FontSize="24" />
|
||||
<Button Text="Перейти на Page1" Clicked="OnGoToPage1Clicked" />
|
||||
|
||||
<Label
|
||||
Text="Welcome to .NET Multi-platform App UI"
|
||||
Style="{StaticResource SubHeadline}"
|
||||
SemanticProperties.HeadingLevel="Level2"
|
||||
SemanticProperties.Description="Welcome to dot net Multi platform App U I" />
|
||||
<Label> </Label>
|
||||
<Button Text="Перейти на Perso" Clicked="OnGoToPersonClicked" />
|
||||
|
||||
<Button
|
||||
x:Name="CounterBtn"
|
||||
Text="Click me"
|
||||
SemanticProperties.Hint="Counts the number of times you click"
|
||||
Clicked="OnCounterClicked"
|
||||
HorizontalOptions="Fill" />
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
</VerticalStackLayout>
|
||||
|
||||
</ContentPage>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace asugaksharp
|
||||
using asugaksharp.Presentation.Views;
|
||||
|
||||
namespace asugaksharp
|
||||
{
|
||||
public partial class MainPage : ContentPage
|
||||
{
|
||||
@@ -9,16 +11,14 @@
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnCounterClicked(object sender, EventArgs e)
|
||||
private async void OnGoToPage1Clicked(object sender, EventArgs e)
|
||||
{
|
||||
count++;
|
||||
await Navigation.PushAsync(new Page1());
|
||||
}
|
||||
|
||||
if (count == 1)
|
||||
CounterBtn.Text = $"Clicked {count} time";
|
||||
else
|
||||
CounterBtn.Text = $"Clicked {count} times";
|
||||
|
||||
SemanticScreenReader.Announce(CounterBtn.Text);
|
||||
private async void OnGoToPersonClicked(object sender, EventArgs e)
|
||||
{
|
||||
await Navigation.PushAsync(new GakPersonCard());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
19
asugaksharp/Presentation/Views/GakPersonCard.xaml
Normal file
19
asugaksharp/Presentation/Views/GakPersonCard.xaml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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"
|
||||
x:Class="asugaksharp.Presentation.Views.GakPersonCard"
|
||||
Title="GakPersonCard">
|
||||
<VerticalStackLayout>
|
||||
<Label
|
||||
Text="Карточка члена ГЭК"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="Center" />
|
||||
|
||||
<StackLayout Orientation="Vertical" Spacing="10">
|
||||
<Label Text="Элемент 1" />
|
||||
<Label Text="Элемент 2" />
|
||||
</StackLayout>
|
||||
|
||||
</VerticalStackLayout>
|
||||
|
||||
</ContentPage>
|
||||
9
asugaksharp/Presentation/Views/GakPersonCard.xaml.cs
Normal file
9
asugaksharp/Presentation/Views/GakPersonCard.xaml.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace asugaksharp.Presentation.Views;
|
||||
|
||||
public partial class GakPersonCard : ContentPage
|
||||
{
|
||||
public GakPersonCard()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
13
asugaksharp/Presentation/Views/Page1.xaml
Normal file
13
asugaksharp/Presentation/Views/Page1.xaml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?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"
|
||||
x:Class="asugaksharp.Presentation.Views.Page1"
|
||||
Title="Page1">
|
||||
|
||||
<VerticalStackLayout Padding="20">
|
||||
<Label Text="Это страница 1" FontSize="20" />
|
||||
<Button Text="Перейти на другую страницу"
|
||||
Clicked="OnNextPageClicked" />
|
||||
</VerticalStackLayout>
|
||||
|
||||
</ContentPage>
|
||||
16
asugaksharp/Presentation/Views/Page1.xaml.cs
Normal file
16
asugaksharp/Presentation/Views/Page1.xaml.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using asugaksharp.Presentation.Views;
|
||||
|
||||
namespace asugaksharp.Presentation.Views;
|
||||
|
||||
public partial class Page1 : ContentPage
|
||||
{
|
||||
public Page1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private async void OnNextPageClicked(object sender, EventArgs e)
|
||||
{
|
||||
await Navigation.PushAsync(new Page2()); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> Page2 <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
}
|
||||
}
|
||||
12
asugaksharp/Presentation/Views/Page2.xaml
Normal file
12
asugaksharp/Presentation/Views/Page2.xaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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"
|
||||
x:Class="asugaksharp.Presentation.Views.Page2"
|
||||
Title="NewPage1">
|
||||
<VerticalStackLayout>
|
||||
<Label
|
||||
Text="Welcome to .NET MAUI!"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="Center" />
|
||||
</VerticalStackLayout>
|
||||
</ContentPage>
|
||||
9
asugaksharp/Presentation/Views/Page2.xaml.cs
Normal file
9
asugaksharp/Presentation/Views/Page2.xaml.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace asugaksharp.Presentation.Views;
|
||||
|
||||
public partial class Page2 : ContentPage
|
||||
{
|
||||
public Page2()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -62,4 +62,29 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Application\UseCases\" />
|
||||
<Folder Include="Domain\Entites\" />
|
||||
<Folder Include="Domain\Interfaces\" />
|
||||
<Folder Include="Infrastructure\Persistence\Repositories\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Presentation\Views\Page2.xaml.cs">
|
||||
<DependentUpon>Page2.xaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<MauiXaml Update="Presentation\Views\GakPersonCard.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</MauiXaml>
|
||||
<MauiXaml Update="Presentation\Views\Page2.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</MauiXaml>
|
||||
<MauiXaml Update="Presentation\Views\Page1.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</MauiXaml>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
<None Update="App.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Update="AppShell.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Update="MainPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
|
||||
Reference in New Issue
Block a user