GetAllServices view model
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
using WD7UVN_HFT_2023241.Models;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels
|
||||||
|
{
|
||||||
|
public class GetAllServicesViewModel
|
||||||
|
{
|
||||||
|
public RestCollection<Service> Services { get; set; }
|
||||||
|
|
||||||
|
public static bool IsInDesignMode
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var prop = DesignerProperties.IsInDesignModeProperty;
|
||||||
|
return (bool)DependencyPropertyDescriptor.FromProperty(prop, typeof(FrameworkElement)).Metadata.DefaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public GetAllServicesViewModel()
|
||||||
|
{
|
||||||
|
if (!IsInDesignMode)
|
||||||
|
{
|
||||||
|
Services = new RestCollection<Service>("http://localhost:5000/", "api/Service", "hub");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user