Initial commit
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace WinWARP.Core.ViewModels.ConfigSettings;
|
||||
|
||||
public partial class DnsSettingsViewModel : ObservableObject
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace WinWARP.Core.ViewModels.ConfigSettings;
|
||||
|
||||
public partial class InboundSettingsViewModel : ObservableObject
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace WinWARP.Core.ViewModels.ConfigSettings;
|
||||
|
||||
public partial class RoutingSettingsViewModel : ObservableObject
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace WinWARP.Core.ViewModels.ConfigSettings;
|
||||
|
||||
public partial class TlsSettingsViewModel : ObservableObject
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace WinWARP.Core.ViewModels.ConfigSettings;
|
||||
|
||||
public partial class WarpSettingsViewModel : ObservableObject
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace WinWARP.Core.ViewModels;
|
||||
|
||||
public class ConfigSettingsViewModel : ObservableObject
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using WinWARP.Core.Services;
|
||||
|
||||
namespace WinWARP.Core.ViewModels;
|
||||
|
||||
public partial class HomeViewModel : ObservableObject
|
||||
{
|
||||
private readonly INavigationService _navigationService;
|
||||
|
||||
public HomeViewModel(INavigationService navigationService)
|
||||
{
|
||||
_navigationService = navigationService;
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void TestTransition()
|
||||
{
|
||||
_navigationService.NavigateTo<SettingsViewModel>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using WinWARP.Core.Services;
|
||||
|
||||
namespace WinWARP.Core.ViewModels;
|
||||
|
||||
public partial class MainViewModel : ObservableObject
|
||||
{
|
||||
private readonly INavigationService _navigationService;
|
||||
|
||||
public MainViewModel(INavigationService navigationService)
|
||||
{
|
||||
_navigationService = navigationService;
|
||||
}
|
||||
|
||||
[ObservableProperty]
|
||||
public partial string Title { get; set; } = "WinWARP";
|
||||
|
||||
[ObservableProperty]
|
||||
public partial Type CurrentViewModelType { get; set; }
|
||||
|
||||
[RelayCommand]
|
||||
private void Navigate(object? tagParameter)
|
||||
{
|
||||
if (tagParameter is Type viewModelType)
|
||||
{
|
||||
var method = _navigationService.GetType().GetMethod("NavigateTo")?.MakeGenericMethod(viewModelType);
|
||||
method?.Invoke(_navigationService, [null]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace WinWARP.Core.ViewModels.Settings;
|
||||
|
||||
public partial class GeneralSettingsViewModel : ObservableObject
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace WinWARP.Core.ViewModels.Settings;
|
||||
|
||||
public partial class UpdateSettingsViewModel : ObservableObject
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using WinWARP.Core.Services;
|
||||
|
||||
namespace WinWARP.Core.ViewModels;
|
||||
|
||||
public partial class SettingsViewModel : ObservableObject
|
||||
{
|
||||
private readonly ILocalizationService _localizationService;
|
||||
private readonly INavigationService _navigationService;
|
||||
|
||||
public SettingsViewModel(ILocalizationService localizationService, INavigationService navigationService)
|
||||
{
|
||||
_navigationService = navigationService;
|
||||
_localizationService = localizationService;
|
||||
SelectedLanguage = _localizationService.GetCurrentLanguage();
|
||||
Languages = new ObservableCollection<string>(_localizationService.GetSupportedLanguages());
|
||||
}
|
||||
|
||||
|
||||
[RelayCommand]
|
||||
private void Navigate(object? tagParameter)
|
||||
{
|
||||
if (tagParameter is Type viewModelType)
|
||||
{
|
||||
var method = _navigationService.GetType().GetMethod("NavigateTo")?.MakeGenericMethod(viewModelType);
|
||||
method?.Invoke(_navigationService, [null]);
|
||||
}
|
||||
}
|
||||
|
||||
[ObservableProperty]
|
||||
public partial string SelectedLanguage
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
partial void OnSelectedLanguageChanged(string value)
|
||||
{
|
||||
_localizationService.SetLanguageAsync(value);
|
||||
}
|
||||
|
||||
public ObservableCollection<string> Languages;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace WinWARP.Core.ViewModels;
|
||||
|
||||
public class SubsSettingsViewModel : ObservableObject
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user