Skip to content

Commit 71d038b

Browse files
committed
tabview added.
1 parent bbf2a8f commit 71d038b

File tree

3 files changed

+48
-11
lines changed

3 files changed

+48
-11
lines changed

MyFinance/MauiProgram.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ namespace MyFinance;
99
[MauiMarkup(typeof(StatusBarBehavior), typeof(TextEdit), typeof(TextEditBase), typeof(EditBase), typeof(ComboBoxEdit))]
1010
[MauiMarkup(typeof(PasswordEdit), typeof(CheckEdit), typeof(DXPopup), typeof(ComboBoxEditBase), typeof(ItemsEditBase))]
1111
[MauiMarkup(typeof(DXImage), typeof(DXButton), typeof(DXViewBase), typeof(DXBorder), typeof(DXContentPresenterBase))]
12-
[MauiMarkup(typeof(DXContentPresenter), typeof(DXCollectionView), typeof(CartesianChart))]
12+
[MauiMarkup(typeof(DXContentPresenter), typeof(DXCollectionView), typeof(CartesianChart), typeof(TabView), typeof(TabViewItem))]
13+
[MauiMarkup(typeof(TabItem))]
1314
public static class MauiProgram
1415
{
1516
public static MauiApp CreateMauiApp()

MyFinance/ViewModels/AccountPageViewModel.cs

+12
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,21 @@ public async void Logout()
8484
[RelayCommand]
8585
public async Task Save()
8686
{
87+
var accessUser = AuthCheckHelper.ParseBasicAuthToken(SecureStorage.GetAsync("USERAUTH").Result);
8788
var result = await _userRepo.UpdateAsync(UserModel);
8889
if (result)
8990
{
91+
if (UserModel.Email != accessUser.Item1 || UserModel.Password != accessUser.Item2)
92+
{
93+
var auth = AuthCheckHelper.BasicAuth(UserModel.Email, UserModel.Password, accessUser.Item3.Value);
94+
await SecureStorage.SetAsync("USERAUTH", auth);
95+
}
96+
User = new()
97+
{
98+
Name = $"{UserModel?.FirstName} {UserModel?.LastName}",
99+
Email = UserModel?.Email ?? string.Empty
100+
};
101+
90102
InfoPopupColor = SkyBlue;
91103
InfoPopupTitle = "BİLGİ";
92104
infoPopupDesc = "İşlem başarılı olmuştur.";

MyFinance/Views/ItemsPage.cs

+34-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,44 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
7-
namespace MyFinance.Views;
1+
namespace MyFinance.Views;
82

93
public partial class ItemsPage(ItemsPageViewModel viewModel) : FmgLibContentPage<ItemsPageViewModel>(viewModel)
104
{
115
public override void Build()
126
{
137
this
148
.Content(
15-
new Label()
16-
.Text("ItemsPage")
17-
.Center()
9+
new TabView()
10+
.ItemsSource(
11+
new List<TabViewItem>()
12+
{
13+
new TabViewItem()
14+
.HeaderText("Mail")
15+
.HeaderTextColor(Black)
16+
.HeaderIcon("home.png")
17+
.HeaderIconColor(Black)
18+
.Content(
19+
new Grid()
20+
.Children(
21+
new Label()
22+
.Text("Mail List")
23+
.Center()
24+
)
25+
),
26+
27+
new TabViewItem()
28+
.HeaderText("Temp")
29+
.HeaderTextColor(Black)
30+
.HeaderIconColor(Black)
31+
.HeaderIcon("home.png")
32+
.Content(
33+
new Grid()
34+
.Children(
35+
new Label()
36+
.Text("Mail List")
37+
.Center()
38+
)
39+
)
40+
}
41+
)
1842
);
1943
}
2044
}

0 commit comments

Comments
 (0)