Compare commits

..

4 Commits

Author SHA1 Message Date
Пупсинь
2d3aebedf8 added aurorization window 2025-03-10 09:22:36 +03:00
Пупсинь
103c501d56 rt 2025-03-05 09:11:53 +03:00
Пупсинь
0f4046b35d er 2025-03-05 08:58:53 +03:00
Пупсинь
19126a55a8 er 2025-03-05 08:54:33 +03:00
13 changed files with 75 additions and 258 deletions

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<FlyoutPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MobileApp.FlyoutPage1"
xmlns:pages="clr-namespace:MobileApp">
<FlyoutPage.Flyout>
<pages:FlyoutPage1Flyout x:Name="FlyoutPage" />
</FlyoutPage.Flyout>
<FlyoutPage.Detail>
<NavigationPage>
<x:Arguments>
<pages:FlyoutPage1Detail />
</x:Arguments>
</NavigationPage>
</FlyoutPage.Detail>
</FlyoutPage>

View File

@ -1,36 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace MobileApp
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FlyoutPage1 : FlyoutPage
{
public FlyoutPage1()
{
InitializeComponent();
FlyoutPage.ListView.ItemSelected += ListView_ItemSelected;
}
private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
{
var item = e.SelectedItem as FlyoutPage1FlyoutMenuItem;
if (item == null)
return;
var page = (Page)Activator.CreateInstance(item.TargetType);
page.Title = item.Title;
Detail = new NavigationPage(page);
IsPresented = false;
FlyoutPage.ListView.SelectedItem = null;
}
}
}

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MobileApp.FlyoutPage1Detail"
Title="Detail">
<StackLayout Padding="10">
<Label Text="This is a detail page. To get the 'triple' line icon on each platform add a icon to each platform and update the 'Flyout' page with an Icon that references it."/>
</StackLayout>
</ContentPage>

View File

@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace MobileApp
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FlyoutPage1Detail : ContentPage
{
public FlyoutPage1Detail()
{
InitializeComponent();
}
}
}

View File

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MobileApp.FlyoutPage1Flyout"
Title="Flyout">
<StackLayout>
<ListView x:Name="MenuItemsListView"
SeparatorVisibility="None"
HasUnevenRows="true"
ItemsSource="{Binding MenuItems}">
<ListView.Header>
<Grid BackgroundColor="#03A9F4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="80"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<Label
Grid.Column="1"
Grid.Row="2"
Text="AppName"
Style="{DynamicResource SubtitleStyle}"/>
</Grid>
</ListView.Header>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="15,10" HorizontalOptions="FillAndExpand">
<Label VerticalOptions="FillAndExpand"
VerticalTextAlignment="Center"
Text="{Binding Title}"
FontSize="24"/>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage>

View File

@ -1,56 +0,0 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace MobileApp
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FlyoutPage1Flyout : ContentPage
{
public ListView ListView;
public FlyoutPage1Flyout()
{
InitializeComponent();
BindingContext = new FlyoutPage1FlyoutViewModel();
ListView = MenuItemsListView;
}
private class FlyoutPage1FlyoutViewModel : INotifyPropertyChanged
{
public ObservableCollection<FlyoutPage1FlyoutMenuItem> MenuItems { get; set; }
public FlyoutPage1FlyoutViewModel()
{
MenuItems = new ObservableCollection<FlyoutPage1FlyoutMenuItem>(new[]
{
new FlyoutPage1FlyoutMenuItem { Id = 0, Title = "Page 1" },
new FlyoutPage1FlyoutMenuItem { Id = 1, Title = "Page 2" },
new FlyoutPage1FlyoutMenuItem { Id = 2, Title = "Page 3" },
new FlyoutPage1FlyoutMenuItem { Id = 3, Title = "Page 4" },
new FlyoutPage1FlyoutMenuItem { Id = 4, Title = "Page 5" },
});
}
#region INotifyPropertyChanged Implementation
public event PropertyChangedEventHandler PropertyChanged;
void OnPropertyChanged([CallerMemberName] string propertyName = "")
{
if (PropertyChanged == null)
return;
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
#endregion
}
}
}

View File

@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MobileApp
{
public class FlyoutPage1FlyoutMenuItem
{
public FlyoutPage1FlyoutMenuItem()
{
TargetType = typeof(FlyoutPage1FlyoutMenuItem);
}
public int Id { get; set; }
public string Title { get; set; }
public Type TargetType { get; set; }
}
}

View File

@ -3,34 +3,39 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MobileApp.MainPage"> x:Class="MobileApp.MainPage">
<ScrollView> <Grid>
<VerticalStackLayout <Grid.RowDefinitions>
Padding="30,0" <RowDefinition Height="100"/>
Spacing="25"> <RowDefinition Height="450"/>
<Image <RowDefinition Height="*"/>
Source="dotnet_bot.png" </Grid.RowDefinitions>
HeightRequest="185" <StackLayout>
Aspect="AspectFit"
SemanticProperties.Description="dot net bot in a race car number eight" />
<Label <Label
Text="Hello, World!" Text="Привет!" TextColor="Black" FontSize="32" HorizontalOptions="Center"/>
Style="{StaticResource Headline}"
SemanticProperties.HeadingLevel="Level1" />
<Label <Label
Text="Welcome to &#10;.NET Multi-platform App UI" Text="Заполните Свои Данные Или" TextColor="#707B81" FontSize="16" HorizontalOptions="Center"/>
Style="{StaticResource SubHeadline}" <Label Text="Продолжите Через Социальные Медиа" FontSize="16" TextColor="#707B81" HorizontalOptions="Center"/>
SemanticProperties.HeadingLevel="Level2" </StackLayout>
SemanticProperties.Description="Welcome to dot net Multi platform App U I" />
<Button <StackLayout Grid.Row="1">
x:Name="CounterBtn" <Label Text="Email" Margin="20" FontSize="16"/>
Text="Click me" <Frame CornerRadius="30" BackgroundColor="#F7F7F9" Padding="5" BorderColor="Transparent">
SemanticProperties.Hint="Counts the number of times you click" <Entry Placeholder="xyz@gmail.com" Background="Transparent" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand" TextColor="Black" />
Clicked="OnCounterClicked" </Frame>
HorizontalOptions="Fill" />
</VerticalStackLayout> <Label Text="Пароль" Margin="20" FontSize="16"/>
</ScrollView> <Frame CornerRadius="30" BackgroundColor="#F7F7F9" Padding="5" BorderColor="Transparent">
<Entry Placeholder="********" Background="Transparent" HorizontalOptions="FillAndExpand" VerticalOptions="CenterAndExpand" TextColor="Black" />
</Frame>
<Button Text="Восстановить" Background="Transparent" TextColor="#D8D8D8" HorizontalOptions="End"/>
<Button Text="Войти" Background="#48B2E7" Margin="10"/>
</StackLayout>
<HorizontalStackLayout Grid.Row="2" VerticalOptions="Center" HorizontalOptions="Center">
<Label Text="Вы впервые?" TextColor="#707B81" Margin="5" FontSize="12"/>
<Button Background="Transparent" Text="Создать ползователя" TextColor="Black" Margin="-10" FontSize="12"/>
</HorizontalStackLayout>
</Grid>
</ContentPage> </ContentPage>

View File

@ -9,17 +9,17 @@
InitializeComponent(); InitializeComponent();
} }
private void OnCounterClicked(object sender, EventArgs e) //private void OnCounterClicked(object sender, EventArgs e)
{ //{
count++; // count++;
if (count == 1) // if (count == 1)
CounterBtn.Text = $"Clicked {count} time"; // CounterBtn.Text = $"Clicked {count} time";
else // else
CounterBtn.Text = $"Clicked {count} times"; // CounterBtn.Text = $"Clicked {count} times";
SemanticScreenReader.Announce(CounterBtn.Text); // SemanticScreenReader.Announce(CounterBtn.Text);
} //}
} }
} }

View File

@ -57,27 +57,15 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MauiXaml Remove="FlyoutPage1.xaml" />
<MauiXaml Remove="FlyoutPage1Detail.xaml" />
<MauiXaml Remove="FlyoutPage1Flyout.xaml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="FlyoutPage1.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Include="FlyoutPage1Detail.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Include="FlyoutPage1Flyout.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" /> <PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" /> <PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<MauiXaml Update="NewPage1.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup>
</Project> </Project>

View File

@ -4,11 +4,16 @@
<IsFirstTimeProjectOpen>False</IsFirstTimeProjectOpen> <IsFirstTimeProjectOpen>False</IsFirstTimeProjectOpen>
<ActiveDebugFramework>net8.0-windows10.0.19041.0</ActiveDebugFramework> <ActiveDebugFramework>net8.0-windows10.0.19041.0</ActiveDebugFramework>
<ActiveDebugProfile>Windows Machine</ActiveDebugProfile> <ActiveDebugProfile>Windows Machine</ActiveDebugProfile>
<SelectedPlatformGroup>Emulator</SelectedPlatformGroup>
<DefaultDevice>pixel_2_q_10_0_-_api_29</DefaultDevice>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Update="FlyoutPage1FlyoutMenuItem.cs"> <MauiXaml Update="NewPage1.xaml">
<SubType>Code</SubType> <SubType>Designer</SubType>
</Compile> </MauiXaml>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Update="App.xaml"> <None Update="App.xaml">

12
NewPage1.xaml Normal file
View 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="MobileApp.NewPage1"
Title="NewPage1">
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>

9
NewPage1.xaml.cs Normal file
View File

@ -0,0 +1,9 @@
namespace MobileApp;
public partial class NewPage1 : ContentPage
{
public NewPage1()
{
InitializeComponent();
}
}