This commit is contained in:
MiskolcziRichard
2024-03-26 13:00:50 +01:00
parent a3e4fdb5fd
commit b175b0e24b
3 changed files with 6 additions and 76 deletions

View File

@@ -1,62 +0,0 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System.ComponentModel;
using System.Windows;
using System.Windows.Input;
using WD7UVN_HFT_2023241.Models;
namespace WD7UVN_SzTGUI_2023242.Client.WPF
{
internal class ServiceViewModel : ObservableRecipient
{
private string errorService;
public string ErrorService
{
get { return errorService; }
set { SetProperty(ref errorService, value); }
}
public RestCollection<Service> Services { get; set; }
private string newServiceText;
public string NewServiceText
{
get
{
return newServiceText;
}
set
{
newServiceText = value;
}
}
public ICommand SendServiceCommand { get; set; }
public static bool IsInDesignMode
{
get
{
var prop = DesignerProperties.IsInDesignModeProperty;
return (bool)DependencyPropertyDescriptor.FromProperty(prop, typeof(FrameworkElement)).Metadata.DefaultValue;
}
}
public ServiceViewModel()
{
if (!IsInDesignMode)
{
Services = new RestCollection<Service>("http://localhost:62005/", "Service", "hub");
SendServiceCommand = new RelayCommand(() =>
{
Services.Add(new Service(1, NewServiceText, DateTime.Now, new User(1, "Én")));
});
}
}
}
}

View File

@@ -54,7 +54,6 @@
<Label Grid.Row="8" Grid.Column="0" Content="Maintainer Team ID:" /> <Label Grid.Row="8" Grid.Column="0" Content="Maintainer Team ID:" />
<Label Grid.Row="8" Grid.Column="1" Content="{Binding MAINTAINER_ID}" /> <Label Grid.Row="8" Grid.Column="1" Content="{Binding MAINTAINER_ID}" />
</Grid> </Grid>
</Border> </Border>
</DataTemplate> </DataTemplate>

View File

@@ -1,16 +1,5 @@
using System; using System.Windows;
using System.Collections.Generic; using WD7UVN_HFT_2023241.Models;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace WD7UVN_SzTGUI_2023242.Client.WPF namespace WD7UVN_SzTGUI_2023242.Client.WPF
{ {
@@ -19,9 +8,13 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF
/// </summary> /// </summary>
public partial class GetAllServices : Window public partial class GetAllServices : Window
{ {
public RestCollection<Service> Services { get; }
public GetAllServices() public GetAllServices()
{ {
InitializeComponent(); InitializeComponent();
Services = new RestCollection<Service>("https://localhost:5001", "Service", "hub");
} }
} }
} }