diff --git a/AutoCat/App.axaml.cs b/AutoCat/App.axaml.cs index f2aaf53..db9617b 100644 --- a/AutoCat/App.axaml.cs +++ b/AutoCat/App.axaml.cs @@ -22,7 +22,7 @@ public partial class App : Application services.AddSingleton(); // ViewModels - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); diff --git a/AutoCat/Pages/HistoryListPage.axaml b/AutoCat/Pages/HistoryListPage.axaml deleted file mode 100644 index 098ec52..0000000 --- a/AutoCat/Pages/HistoryListPage.axaml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AutoCat/Pages/HistoryListPage.axaml.cs b/AutoCat/Pages/HistoryListPage.axaml.cs deleted file mode 100644 index a7f8472..0000000 --- a/AutoCat/Pages/HistoryListPage.axaml.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Avalonia; -using Avalonia.Controls; -using Avalonia.Markup.Xaml; - -namespace AutoCat.Pages; - -public partial class HistoryListPage : UserControl -{ - public HistoryListPage() - { - InitializeComponent(); - } -} \ No newline at end of file diff --git a/AutoCat/Pages/HistoryPage.axaml b/AutoCat/Pages/HistoryPage.axaml index 0ff9a7f..8fcb507 100644 --- a/AutoCat/Pages/HistoryPage.axaml +++ b/AutoCat/Pages/HistoryPage.axaml @@ -3,10 +3,26 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:pages="clr-namespace:AutoCat.Pages" + + xmlns:utils="using:AutoCat.Utils" + xmlns:vm="using:AutoCat.ViewModels" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" - x:Class="AutoCat.Pages.HistoryPage"> + x:Class="AutoCat.Pages.HistoryPage" + x:DataType="vm:HistoryViewModel" + x:CompileBindings="True" + DataContext="{utils:ViewModelProvider vm:HistoryViewModel}"> + + + + + + + + + - + diff --git a/AutoCat/Templates/VehicleCell.axaml b/AutoCat/Templates/VehicleCell.axaml new file mode 100644 index 0000000..00477b0 --- /dev/null +++ b/AutoCat/Templates/VehicleCell.axaml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + diff --git a/AutoCat/ViewModels/HistoryListViewModel.cs b/AutoCat/ViewModels/HistoryViewModel.cs similarity index 83% rename from AutoCat/ViewModels/HistoryListViewModel.cs rename to AutoCat/ViewModels/HistoryViewModel.cs index e94aa95..8d1e09e 100644 --- a/AutoCat/ViewModels/HistoryListViewModel.cs +++ b/AutoCat/ViewModels/HistoryViewModel.cs @@ -7,7 +7,7 @@ using DynamicData; namespace AutoCat.ViewModels; -public class HistoryListViewModel: ViewModelBase +public class HistoryViewModel: ViewModelBase { #region Dependencies @@ -21,7 +21,7 @@ public class HistoryListViewModel: ViewModelBase #endregion - public HistoryListViewModel(IApiService apiService) + public HistoryViewModel(IApiService apiService) { _apiService = apiService; Vehicles = new ObservableCollection(); @@ -35,8 +35,6 @@ public class HistoryListViewModel: ViewModelBase var pagedResponse = await _apiService.GetVehicles(); Vehicles.Clear(); Vehicles.AddRange(pagedResponse.Items); - - Console.WriteLine($"Loaded vehicles: {Vehicles.Count}"); } catch (Exception ex) { diff --git a/AutoCat/Views/PlateView.axaml.cs b/AutoCat/Views/PlateView.axaml.cs index 44b3483..dd9690f 100644 --- a/AutoCat/Views/PlateView.axaml.cs +++ b/AutoCat/Views/PlateView.axaml.cs @@ -51,7 +51,7 @@ public partial class PlateView : UserControl { if (Bounds.Height > 0) { - Console.WriteLine($"=== new height: {Bounds.Height}"); + //Console.WriteLine($"=== new height: {Bounds.Height}"); } } } \ No newline at end of file