34 lines
830 B
C#
34 lines
830 B
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
using Estara.Contracts.ViewModels;
|
|
using Estara.Core.Contracts.Services;
|
|
using Estara.Core.Models;
|
|
|
|
namespace Estara.ViewModels;
|
|
|
|
public partial class ContentGridDetailViewModel : ObservableRecipient, INavigationAware
|
|
{
|
|
private readonly ISampleDataService _sampleDataService;
|
|
|
|
[ObservableProperty]
|
|
private SampleOrder? item;
|
|
|
|
public ContentGridDetailViewModel(ISampleDataService sampleDataService)
|
|
{
|
|
_sampleDataService = sampleDataService;
|
|
}
|
|
|
|
public async void OnNavigatedTo(object parameter)
|
|
{
|
|
if (parameter is long orderID)
|
|
{
|
|
var data = await _sampleDataService.GetContentGridDataAsync();
|
|
Item = data.First(i => i.OrderID == orderID);
|
|
}
|
|
}
|
|
|
|
public void OnNavigatedFrom()
|
|
{
|
|
}
|
|
}
|