From 93983993eb3433f8eadbde848efbde5a7b8e59b2 Mon Sep 17 00:00:00 2001 From: MiskolcziRichard Date: Sun, 28 Apr 2024 18:00:49 +0200 Subject: [PATCH] GetAllServices view model --- .../ViewModels/GetAllServicesViewModel.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 WD7UVN_SzTGUI_2023242.Client.WPF/ViewModels/GetAllServicesViewModel.cs diff --git a/WD7UVN_SzTGUI_2023242.Client.WPF/ViewModels/GetAllServicesViewModel.cs b/WD7UVN_SzTGUI_2023242.Client.WPF/ViewModels/GetAllServicesViewModel.cs new file mode 100644 index 0000000..41ddaa0 --- /dev/null +++ b/WD7UVN_SzTGUI_2023242.Client.WPF/ViewModels/GetAllServicesViewModel.cs @@ -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 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("http://localhost:5000/", "api/Service", "hub"); + } + } + } +}