DevExpress MAUI hozzáadása

This commit is contained in:
2025-02-19 18:05:53 +01:00
parent 5aae8fd067
commit bf97db26e5
5 changed files with 40 additions and 9 deletions
+9 -1
View File
@@ -7,6 +7,9 @@ using CommunityToolkit.Maui;
using WorkFlowCheck.MAUI.DataLayer;
using WorkFlowCheck.MAUI.Mapper;
using WorkFlowCheck.MAUI.Services.Interfaces;
using DevExpress.Maui;
using Microsoft.Maui.Controls.Hosting;
using Microsoft.Maui.Hosting;
namespace WorkFlowCheck.MAUI
{
@@ -15,6 +18,9 @@ namespace WorkFlowCheck.MAUI
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder.UseDevExpress(useLocalization: false)
.UseDevExpressControls()
.UseDevExpressCollectionView();
builder.Services.AddAutoMapper(typeof(MapperProfile));
// appsettings.json beállítása
string jsonFilePath = Path.Combine(FileSystem.AppDataDirectory, "appsettings.json");
@@ -43,7 +49,9 @@ namespace WorkFlowCheck.MAUI
builder.Services.AddTransient<MainPage>();
builder.UseMauiApp<App>().ConfigureFonts(fonts =>
builder.UseMauiApp<App>()
.UseDevExpressEditors()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
@@ -11,11 +11,14 @@
<StackLayout>
<Label Text="{Binding ShortName}" FontSize="16" FontAttributes="Bold" />
<Label Text="{Binding Code}" FontSize="14" />
<HorizontalStackLayout HorizontalOptions="End">
<Button Text="Edit"
VerticalOptions="Center"
HorizontalOptions="End"
Command="{Binding BindingContext.EditCommand, Source={x:Reference CheckPointsList}}"
CommandParameter="{Binding .}" />
<Button Text="Pair"
Command="{Binding BindingContext.PairCommand, Source={x:Reference CheckPointsList}}"
CommandParameter="{Binding .}" />
</HorizontalStackLayout>
</StackLayout>
</Frame>
</DataTemplate>
@@ -21,6 +21,7 @@ public partial class CheckPointsPage : ContentPage
public ICommand RefreshCommand { get; set; }
public ICommand EditCommand { get; set; }
public ICommand PairCommand { get; set; }
public bool IsRefreshing { get; set; }
protected override async void OnAppearing()
@@ -28,6 +29,7 @@ public partial class CheckPointsPage : ContentPage
base.OnAppearing();
RefreshCommand = new Command(async () => await LoadCheckPoints());
EditCommand = new Command<CheckPointDTO>(OnEditItem);
PairCommand = new Command<CheckPointDTO>(OnPairItem);
BindingContext = this;
await LoadCheckPoints();
@@ -46,6 +48,11 @@ public partial class CheckPointsPage : ContentPage
// Navigálás a CheckPointEdit.xaml-ra, és átadjuk az editálni kívánt elemet
await Navigation.PushAsync(new CheckPointEditPage(checkPointDTO));
}
private async void OnPairItem(CheckPointDTO checkPointDTO)
{
// Navigálás a CheckPointEdit.xaml-ra, és átadjuk az editálni kívánt elemet
await Navigation.PushAsync(new CheckPointEditPage(checkPointDTO));
}
protected override bool OnBackButtonPressed()
{
@@ -1,12 +1,21 @@
<?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"
xmlns:dx="http://schemas.devexpress.com/maui"
x:Class="WorkFlowCheck.MAUI.Pages.Security.LoginPage"
Title="Bejelentkezés"
>
<StackLayout Padding="20" VerticalOptions="Center">
<Entry x:Name="UsernameEntry" Placeholder="Felhasználói név" />
<Entry x:Name="PasswordEntry" Placeholder="PIN kód" IsPassword="True" Keyboard="Numeric"/>
<dx:PasswordEdit
Text="{Binding Password, Mode=TwoWay}"
HasError="{Binding PasswordHasError}"
LabelText="Password"
HelpText="*Required"
ErrorText="The password should contain more than 5 characters,
have at least one uppercase and one lowercase letter, and one number."
PlaceholderText="Enter password"/>
<Button x:Name="LoginBtn" Text="Bejelentkezés" Clicked="OnLoginClicked" />
<ActivityIndicator x:Name="LoadingIndicator"
IsRunning="False"
@@ -59,6 +59,10 @@
<ItemGroup>
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="CommunityToolkit.Maui" Version="8.0.1" />
<PackageReference Include="DevExpress.Maui.Controls" Version="24.1.10" />
<PackageReference Include="DevExpress.Maui.Core" Version="24.1.10" />
<PackageReference Include="DevExpress.Maui.Editors" Version="24.1.10" />
<PackageReference Include="DevExpress.Maui.ProjectTemplates" Version="24.2.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.12">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>