DevExpress MAUI hozzáadása
This commit is contained in:
@@ -11,11 +11,14 @@
|
||||
<StackLayout>
|
||||
<Label Text="{Binding ShortName}" FontSize="16" FontAttributes="Bold" />
|
||||
<Label Text="{Binding Code}" FontSize="14" />
|
||||
<Button Text="Edit"
|
||||
VerticalOptions="Center"
|
||||
HorizontalOptions="End"
|
||||
<HorizontalStackLayout HorizontalOptions="End">
|
||||
<Button Text="Edit"
|
||||
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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user