mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using Marechai.App.Presentation.ViewModels;
|
|
using Microsoft.UI.Xaml;
|
|
using Microsoft.UI.Xaml.Controls;
|
|
|
|
namespace Marechai.App.Presentation.Views;
|
|
|
|
/// <summary>
|
|
/// Professional list view for displaying all processors.
|
|
/// Features responsive layout and modern styling.
|
|
/// </summary>
|
|
public sealed partial class ProcessorListPage : Page
|
|
{
|
|
public ProcessorListPage()
|
|
{
|
|
InitializeComponent();
|
|
Loaded += ProcessorListPage_Loaded;
|
|
DataContextChanged += ProcessorListPage_DataContextChanged;
|
|
}
|
|
|
|
private void ProcessorListPage_DataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args)
|
|
{
|
|
if(DataContext is ProcessorsListViewModel vm)
|
|
{
|
|
// Load data when DataContext is set
|
|
vm.LoadData.Execute(null);
|
|
}
|
|
}
|
|
|
|
private void ProcessorListPage_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
if(DataContext is ProcessorsListViewModel vm)
|
|
{
|
|
// Load data when page is loaded (fallback)
|
|
vm.LoadData.Execute(null);
|
|
}
|
|
}
|
|
}
|