Skip to content

Commit 30a38af

Browse files
committed
main page started.
1 parent 3d7cddc commit 30a38af

12 files changed

+138
-70
lines changed

MyFinance/Imports.cs

+3
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@
2929
global using DevExpress.Maui.Editors;
3030
global using DevExpress.Maui.DataForm;
3131
global using DevExpress.Maui.CollectionView;
32+
global using DevExpress.Maui.Core;
3233
global using DevExpress.Maui;
34+
global using static Microsoft.Maui.Controls.BindingMode;
3335
global using static Microsoft.Maui.Controls.FontAttributes;
3436
global using static Microsoft.Maui.Controls.LayoutAlignment;
3537
global using static Microsoft.Maui.Graphics.Colors;
3638
global using static Microsoft.Maui.TextDecorations;
3739
global using static Microsoft.Maui.LineBreakMode;
3840
global using static Microsoft.Maui.Keyboard;
41+
global using static DevExpress.Maui.Core.DXButtonType;
3942

4043
global using MC = Microsoft.Maui.Controls;
4144
global using DC = DevExpress.Maui.Controls;

MyFinance/MauiProgram.cs

+3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
using Microsoft.Extensions.Logging;
2+
using DXImage = DevExpress.Maui.Core.DXImage;
23

34
namespace MyFinance;
45

56

67
[MauiMarkup(typeof(StatusBarBehavior), typeof(TextEdit), typeof(TextEditBase), typeof(EditBase), typeof(ComboBoxEdit))]
78
[MauiMarkup(typeof(PasswordEdit), typeof(CheckEdit), typeof(DXPopup), typeof(ComboBoxEditBase), typeof(ItemsEditBase))]
9+
[MauiMarkup(typeof(DXImage), typeof(DXButton), typeof(DXViewBase), typeof(DXBorder), typeof(DXContentPresenterBase))]
10+
[MauiMarkup(typeof(DXContentPresenter), typeof(DXCollectionView))]
811
public static class MauiProgram
912
{
1013
public static MauiApp CreateMauiApp()

MyFinance/MyFinance.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@
4848
</ItemGroup>
4949

5050
<ItemGroup>
51+
<None Remove="Resources\Images\down_arrow.png" />
5152
<None Remove="Resources\Images\getstarted.png" />
53+
<None Remove="Resources\Images\loss.png" />
54+
<None Remove="Resources\Images\profits.png" />
55+
<None Remove="Resources\Images\up_arrow.png" />
5256
</ItemGroup>
5357

5458
<ItemGroup>
6.02 KB
Loading

MyFinance/Resources/Images/loss.png

11.2 KB
Loading
49.4 KB
Loading
11.4 KB
Loading
7.6 KB
Loading

MyFinance/Resources/Styles/AppStyles.cs

+1
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ public class AppStyles
345345

346346
new Style<Shell>(applyToDerivedTypes: true, e => e
347347
.ShellNavBarHasShadow(false)
348+
.ShellNavBarIsVisible(false)
348349
.ShellBackgroundColor(e => e.OnLight(AppColors.Primary).OnDark(AppColors.Gray950))
349350
.ShellForegroundColor(e => e.OnLight(AppColors.Primary).OnDark(Colors.White))
350351
.ShellTitleColor(e => e.OnLight(Colors.White).OnDark(Colors.White))
+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
namespace MyFinance.ViewModels
1+
namespace MyFinance.ViewModels;
2+
3+
public partial class MainPageViewModel : BaseViewModel
24
{
3-
public partial class MainPageViewModel : BaseViewModel
4-
{
5-
}
65
}

MyFinance/Views/MainPage.cs

+123-65
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,140 @@
1-
using System.Reflection;
1+
using DXImage = DevExpress.Maui.Core.DXImage;
22

3-
namespace MyFinance.Views
3+
namespace MyFinance.Views;
4+
5+
public partial class MainPage(MainPageViewModel viewModel) : BasePage<MainPageViewModel>(viewModel, "Main Page")
46
{
5-
public partial class MainPage(MainPageViewModel viewModel) : BasePage<MainPageViewModel>(viewModel, "Main Page")
7+
public override void Build()
68
{
7-
public override void Build()
8-
{
9-
var version = typeof(MauiApp).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
9+
this
10+
.Content(
11+
new VerticalStackLayout()
12+
.Spacing(20)
13+
.Margin(20,20,20,10)
14+
.Children(
15+
new HorizontalStackLayout()
16+
.AlignStart()
17+
.Spacing(5)
18+
.Children(
19+
new DXImage()
20+
.Source("profile.png")
21+
.SizeRequest(60,60),
1022

11-
this
12-
.Content(
13-
new ScrollView()
14-
.Content(
15-
new Grid()
16-
.RowDefinitions(e => e.Star(90).Star(10))
17-
.Children(
18-
new StackLayout()
19-
.Spacing(25)
20-
.Children(
21-
new Label()
22-
.Text("Hello, World!")
23-
.FontSize(32)
24-
.CenterHorizontal()
25-
.SemanticHeadingLevel(SemanticHeadingLevel.Level1),
23+
new VerticalStackLayout()
24+
.CenterVertical()
25+
.Children(
26+
new Label()
27+
.FontAttributes(Bold)
28+
.TextColor(Black)
29+
.Text("Lilliie-May Mcdonelli"),
2630

27-
new Label()
28-
.Text("Welcome to .NET Multi-platform App UI")
29-
.FontSize(18)
30-
.CenterHorizontal()
31-
.SemanticDescription("Welcome to dot net Multi platform App U I")
32-
.SemanticHeadingLevel(SemanticHeadingLevel.Level1),
31+
new Label()
32+
.TextColor(Gray)
33+
34+
)
35+
),
3336

34-
new Label()
35-
.Text("Current count: 0")
36-
.FontSize(18)
37-
.FontAttributes(Bold)
38-
.CenterHorizontal()
39-
.Assign(out CounterLabel),
37+
new VerticalStackLayout()
38+
.Spacing(-3)
39+
.Children(
40+
new Label()
41+
.FontAttributes(Bold)
42+
.TextColor(Black)
43+
.Text("Total balance"),
4044

41-
new Button()
42-
.Text("Click me")
43-
.CenterHorizontal()
44-
.InvokeOnElement(btn => btn.Clicked += OnCounterClicked)
45-
.SemanticHint("Counts the number of times you click"),
45+
new Grid()
46+
.RowDefinitions(e => e.Star().Star())
47+
.ColumnDefinitions(e => e.Star(7).Star(3))
48+
.Spacing(10,3)
49+
.Children(
50+
new Label()
51+
.Text("25,291.50 ₺")
52+
.FontAttributes(Bold)
53+
.FontSize(40)
54+
.RowSpan(2),
4655

47-
new Image()
48-
.Source("dotnet_bot.png")
49-
.WidthRequest(250)
50-
.HeightRequest(310)
51-
.CenterHorizontal()
52-
.SemanticDescription("Cute dot net bot waving hi to you!")
53-
),
56+
new Label()
57+
.Text("+130.65%")
58+
.TextColor(Green)
59+
.FontSize(12)
60+
.Column(1)
61+
.AlignBottomEnd(),
5462

55-
new Grid()
56-
.BackgroundColor(AppColors.Primary)
57-
.Row(1)
58-
.Children(
59-
new Label()
60-
.Text($"dotNet version: {version}")
61-
.TextColor(White)
62-
.Center()
63-
)
64-
)
63+
new Label()
64+
.Text("+2,367.72₺")
65+
.TextColor(DarkGray)
66+
.FontSize(12)
67+
.Column(1)
68+
.Row(1)
69+
.AlignTopEnd()
6570
)
71+
),
6672

67-
);
68-
}
73+
new Grid()
74+
.ColumnDefinitions(e => e.Star().Star())
75+
.ColumnSpacing(10)
76+
.Children(
77+
new DXButton()
78+
.HeightRequest(100)
79+
.Content("Buy")
80+
.TextColor(White)
81+
.FontSize(16)
82+
.ButtonType(Accent)
83+
.Icon("up_arrow.png")
84+
.IconColor(Red)
85+
.CornerRadius(new CornerRadius(20))
86+
.BackgroundColor(Black),
6987

70-
private int _count = 0;
71-
private Label CounterLabel;
88+
new DXButton()
89+
.HeightRequest(100)
90+
.Content("Sell")
91+
.TextColor(Black)
92+
.FontSize(16)
93+
.ButtonType(Accent)
94+
.Icon("down_arrow.png")
95+
.IconColor(Green)
96+
.CornerRadius(new CornerRadius(20))
97+
.BackgroundColor(DeepSkyBlue)
98+
.BorderColor(Black)
99+
.BorderThickness(1)
100+
.Column(1)
101+
),
72102

103+
new Frame()
104+
.CornerRadius(20)
105+
.BorderColor(Black)
106+
.BackgroundColor(Transparent)
107+
.Content(
108+
new VerticalStackLayout()
109+
.FillBothDirections()
110+
.Children(
111+
new Label()
112+
.FontAttributes(Bold)
113+
.TextColor(Black)
114+
.Text("Watchlist"),
115+
116+
new Border()
117+
.StrokeThickness(1),
73118

74-
private void OnCounterClicked(object? sender, EventArgs e)
75-
{
76-
_count++;
77-
CounterLabel.Text = $"Current count: {_count}";
119+
new DXCollectionView()
120+
.ItemsSource(e => e.Path(""))
121+
.IsRefreshing(e => e.Path("").BindingMode(TwoWay))
122+
.ItemTemplate(() =>
123+
new Grid()
124+
.RowDefinitions(e => e.Star().Star())
125+
.ColumnDefinitions(e => e.Star(1).Star(6).Star(3))
126+
.Margin(5)
127+
.Children(
128+
new DXImage()
129+
.Source(e => e.Path(""))
130+
.SizeRequest(40,40)
131+
.RowSpan(2)
78132

79-
SemanticScreenReader.Announce(CounterLabel.Text);
80-
}
133+
)
134+
)
135+
)
136+
)
137+
)
138+
);
81139
}
82140
}

MyFinance/Views/RegisterPage.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public override void Build()
7171

7272
new TextEdit()
7373
.LabelText("Email")
74-
.Text(e => e.Path("UserModel.Username")),
74+
.Text(e => e.Path("UserModel.Email")),
7575

7676
new PasswordEdit()
7777
.LabelText("Password")

0 commit comments

Comments
 (0)