VC
This commit is contained in:
parent
883d1b0a70
commit
161180e5a5
11
BuyPage.xaml
Normal file
11
BuyPage.xaml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="MyDiplom.BuyPage">
|
||||
<VerticalStackLayout>
|
||||
<Label
|
||||
Text="Welcome to .NET MAUI!"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="Center" />
|
||||
</VerticalStackLayout>
|
||||
</ContentView>
|
9
BuyPage.xaml.cs
Normal file
9
BuyPage.xaml.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace MyDiplom;
|
||||
|
||||
public partial class BuyPage : ContentView
|
||||
{
|
||||
public BuyPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
@ -16,27 +16,44 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackLayout Grid.ColumnSpan="2" Orientation="Horizontal" Padding="10"
|
||||
Background="black" HeightRequest="80"
|
||||
|
||||
Background="black"
|
||||
HeightRequest="80"
|
||||
HorizontalOptions="Fill" >
|
||||
|
||||
|
||||
<Label Text="TgBots" TextColor="White" FontSize="40"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="StartAndExpand"/>
|
||||
|
||||
<Button Text="Регистироваться/Вход"
|
||||
<StackLayout HorizontalOptions="End" Orientation="Horizontal" Padding="0,0,10,0" Spacing="20">
|
||||
<Label Text="{Binding User.Balance, StringFormat='Ваш Баланс {0} Р'}" TextColor="White" VerticalOptions="Center" />
|
||||
|
||||
|
||||
<Button Text="Пополнить"
|
||||
Background="White"
|
||||
TextColor="Black"
|
||||
HorizontalOptions="EndAndExpand"
|
||||
WidthRequest="110"
|
||||
HeightRequest="20"/>
|
||||
|
||||
<Label Text="{Binding User.DisplayName}" TextColor="White" />
|
||||
|
||||
<Button Text="Профиль"
|
||||
TextColor="White"
|
||||
BackgroundColor="Transparent"
|
||||
HorizontalOptions="EndAndExpand"/>
|
||||
|
||||
</StackLayout>
|
||||
|
||||
</StackLayout>
|
||||
|
||||
<StackLayout Grid.Row="1" Grid.RowSpan="4" WidthRequest="250" Spacing="5" Padding="0,5,0,0">
|
||||
|
||||
<Border Stroke="Gray">
|
||||
<Border.StrokeShape>
|
||||
<RoundRectangle CornerRadius="25"/>
|
||||
</Border.StrokeShape>
|
||||
<StackLayout Background="LightGray" Spacing="2">
|
||||
<StackLayout Background="#F3F3F3" Spacing="2">
|
||||
|
||||
<Button Text="Главная" TextColor="Black"
|
||||
BackgroundColor="Transparent"/>
|
||||
@ -61,7 +78,7 @@
|
||||
<RoundRectangle CornerRadius="25"/>
|
||||
</Border.StrokeShape>
|
||||
|
||||
<StackLayout Background="AliceBlue"
|
||||
<StackLayout Background="#F3F3F3"
|
||||
Spacing="2" >
|
||||
<Label Text="Боты" HorizontalOptions="Center" Scale="2"/>
|
||||
<Button Text="1" TextColor="Black" Background="Transparent"/>
|
||||
@ -99,14 +116,14 @@
|
||||
<RoundRectangle CornerRadius="25"/>
|
||||
</Border.StrokeShape>
|
||||
|
||||
<VerticalStackLayout Background="Aqua" HeightRequest="235" >
|
||||
<VerticalStackLayout Background="#F3F3F3" HeightRequest="235" >
|
||||
|
||||
<StackLayout>
|
||||
<Label Text="Выберите фриланс биржу, с которой хотите работать:" FontSize="45" Padding="1" />
|
||||
</StackLayout>
|
||||
<StackLayout VerticalOptions="Center" >
|
||||
<StackLayout Padding="10,0,0,0" Orientation="Horizontal" Spacing="10" >
|
||||
<Button Text="Выделить всё" WidthRequest="130" TextColor="Black" Background="LightGray" />
|
||||
<Button Text="Выделить всё" WidthRequest="130" TextColor="Black" Background="LightSlateGray" />
|
||||
|
||||
<Button Text="Очистить" WidthRequest="130" TextColor="Black" Background="LightPink" />
|
||||
|
||||
@ -146,7 +163,7 @@
|
||||
<Border.StrokeShape>
|
||||
<RoundRectangle CornerRadius="25"/>
|
||||
</Border.StrokeShape>
|
||||
<Grid>
|
||||
<Grid Background="#F3F3F3">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@ -159,7 +176,7 @@
|
||||
<VerticalStackLayout Grid.ColumnSpan="2" Margin="10" >
|
||||
<Label Text="Выберите подходящую категорию:" FontSize="18" />
|
||||
<StackLayout Orientation="Horizontal" Spacing="10" >
|
||||
<Button Text="Выделить всё" WidthRequest="130" TextColor="Black" Background="LightGray" />
|
||||
<Button Text="Выделить всё" WidthRequest="130" TextColor="Black" Background="LightSlateGray" />
|
||||
<Button Text="Очистить" WidthRequest="130" TextColor="Black" Background="LightPink" />
|
||||
</StackLayout>
|
||||
</VerticalStackLayout>
|
||||
@ -289,9 +306,5 @@
|
||||
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
|
||||
<StackLayout Grid.Row="3" Background="Black" Grid.ColumnSpan="2">
|
||||
|
||||
</StackLayout>
|
||||
</Grid>
|
||||
</ContentPage>
|
||||
|
@ -1,4 +1,6 @@
|
||||
namespace MyDiplom
|
||||
using MyDiplom.ViewModels;
|
||||
|
||||
namespace MyDiplom
|
||||
{
|
||||
public partial class MainPage : ContentPage
|
||||
{
|
||||
@ -7,6 +9,8 @@
|
||||
public MainPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.BindingContext = new UserViewModels();
|
||||
}
|
||||
|
||||
|
||||
|
15
Models/Users.cs
Normal file
15
Models/Users.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MyDiplom.Models
|
||||
{
|
||||
public class ApplicationUser
|
||||
{
|
||||
public string? DisplayName { get; set; }
|
||||
public decimal Balance { get; set; } = 0;
|
||||
public string? InvitedUserId { get; set; }
|
||||
}
|
||||
}
|
@ -63,4 +63,10 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<MauiXaml Update="BuyPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</MauiXaml>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -6,6 +6,11 @@
|
||||
<ActiveDebugProfile>Windows Machine</ActiveDebugProfile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<MauiXaml Update="BuyPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</MauiXaml>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="App.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
|
41
ViewModels/BaseViewModels.cs
Normal file
41
ViewModels/BaseViewModels.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace MyDiplom.ViewModels
|
||||
{
|
||||
public class BaseViewModel : INotifyPropertyChanged
|
||||
{
|
||||
bool isBusy = false;
|
||||
public bool IsBusy
|
||||
{
|
||||
get { return isBusy; }
|
||||
set { SetProperty(ref isBusy, value); }
|
||||
}
|
||||
|
||||
protected bool SetProperty<T>(ref T backingStore, T value,
|
||||
[CallerMemberName] string propertyName = "",
|
||||
Action onChanged = null)
|
||||
{
|
||||
if (EqualityComparer<T>.Default.Equals(backingStore, value))
|
||||
return false;
|
||||
|
||||
backingStore = value;
|
||||
onChanged?.Invoke();
|
||||
OnPropertyChanged(propertyName);
|
||||
return true;
|
||||
}
|
||||
|
||||
#region INotifyPropertyChanged
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
protected void OnPropertyChanged([CallerMemberName] string propertyName = "")
|
||||
{
|
||||
var changed = PropertyChanged;
|
||||
if (changed == null)
|
||||
return;
|
||||
|
||||
changed.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
19
ViewModels/UserViewModels.cs
Normal file
19
ViewModels/UserViewModels.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using MyDiplom.Models;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MyDiplom.ViewModels
|
||||
{
|
||||
public class UserViewModels:BaseViewModel
|
||||
{
|
||||
public ApplicationUser User { get; set; } = new ApplicationUser();
|
||||
public UserViewModels()
|
||||
{
|
||||
User = new ApplicationUser { DisplayName = "Вася", Balance = 10.0m };
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user