Files
Prog4_Beadando/WD7UVN_SzTGUI_2023242.Client.WPF/ViewModels/GetResponsibleEmployeeViewModel.cs

31 lines
1019 B
C#
Raw Normal View History

2024-05-04 20:33:50 +02:00
using WD7UVN_HFT_2023241.Models;
using System.ComponentModel;
using System.Windows;
using CommunityToolkit.Mvvm.ComponentModel;
namespace WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels
{
public class GetResponsibleEmployeeViewModel : ObservableRecipient
{
//Hiába egyetlen eredmény van, meghagyom RestCollection-nek a SignalR miatt
2024-05-04 20:47:42 +02:00
public RestCollection<Employee> Employees { get; set; }
2024-05-04 20:33:50 +02:00
public static bool IsInDesignMode
{
get
{
var prop = DesignerProperties.IsInDesignModeProperty;
return (bool)DependencyPropertyDescriptor.FromProperty(prop, typeof(FrameworkElement)).Metadata.DefaultValue;
}
}
public GetResponsibleEmployeeViewModel(Service s)
{
if (!IsInDesignMode)
{
2024-05-04 20:47:42 +02:00
Employees = new RestCollection<Employee>("http://localhost:5000/", "api/WhoIsResponsibleForService?id=" + s.ID.ToString(), "hub", true);
2024-05-04 20:33:50 +02:00
}
}
}
}