Initial commit
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Application
|
||||
x:Class="WinWARP.Ui.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:WinWARP.Ui">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
||||
<!-- Other merged dictionaries here -->
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<!-- Other app resources here -->
|
||||
<x:Double x:Key="TitleBarHeightTall">48</x:Double>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
@@ -0,0 +1,123 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Microsoft.UI.Xaml.Shapes;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.ApplicationModel.Activation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Windows.UI.ApplicationSettings;
|
||||
using WinUI3Localizer;
|
||||
using WinWARP.Core.Services;
|
||||
using WinWARP.Core.ViewModels;
|
||||
using WinWARP.Core.ViewModels.ConfigSettings;
|
||||
using WinWARP.Core.ViewModels.Settings;
|
||||
using WinWARP.Ui.Services;
|
||||
using WinWARP.Ui.Views;
|
||||
using WinWARP.Ui.Views.Settings;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WinWARP.Ui;
|
||||
/// <summary>
|
||||
/// Provides application-specific behavior to supplement the default Application class.
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
public static IServiceProvider Services
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
private Window? _window;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the singleton application object. This is the first line of authored code
|
||||
/// executed, and as such is the logical equivalent of main() or WinMain().
|
||||
/// </summary>
|
||||
public App()
|
||||
{
|
||||
InitializeComponent();
|
||||
Services = ConfigureServices();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Configures the services for dependency injection.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static IServiceProvider ConfigureServices()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
|
||||
var navigationService = new NavigationService();
|
||||
navigationService.Configure(typeof(HomeViewModel), typeof(HomePage));
|
||||
navigationService.Configure(typeof(SettingsViewModel), typeof(SettingsPage));
|
||||
navigationService.Configure(typeof(SubsSettingsViewModel), typeof(SubsSettingsPage));
|
||||
navigationService.Configure(typeof(ConfigSettingsViewModel), typeof(ConfigSettingsPage));
|
||||
|
||||
navigationService.Configure(typeof(GeneralSettingsViewModel), typeof(GeneralSettingsPage));
|
||||
navigationService.Configure(typeof(UpdateSettingsViewModel), typeof(UpdateSettingsPage));
|
||||
|
||||
navigationService.Configure(typeof(InboundSettingsViewModel), typeof(InboundSettingsPage));
|
||||
navigationService.Configure(typeof(RoutingSettingsViewModel), typeof(RoutingSettingsPage));
|
||||
navigationService.Configure(typeof(DnsSettingsViewModel), typeof(DnsSettingsPage));
|
||||
navigationService.Configure(typeof(TlsSettingsViewModel), typeof(TlsSettingsPage));
|
||||
navigationService.Configure(typeof(WarpSettingsViewModel), typeof(WarpSettingsPage));
|
||||
|
||||
services.AddSingleton<ILocalizationService, LocalizationService>();
|
||||
|
||||
services.AddSingleton<INavigationService>(navigationService);
|
||||
|
||||
// ViewModels
|
||||
services.AddTransient<HomeViewModel>();
|
||||
services.AddTransient<SettingsViewModel>();
|
||||
services.AddTransient<SubsSettingsViewModel>();
|
||||
services.AddTransient<ConfigSettingsViewModel>();
|
||||
services.AddSingleton<MainViewModel>();
|
||||
|
||||
services.AddTransient<DnsSettingsViewModel>();
|
||||
services.AddTransient<GeneralSettingsViewModel>();
|
||||
services.AddTransient<InboundSettingsViewModel>();
|
||||
services.AddTransient<RoutingSettingsViewModel>();
|
||||
services.AddTransient<TlsSettingsViewModel>();
|
||||
services.AddTransient<WarpSettingsViewModel>();
|
||||
|
||||
// Views
|
||||
services.AddTransient<MainWindow>();
|
||||
|
||||
return services.BuildServiceProvider();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the application is launched.
|
||||
/// </summary>
|
||||
/// <param name="args">Details about the launch request and process.</param>
|
||||
protected async override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
|
||||
{
|
||||
|
||||
var stringsFolderPath = System.IO.Path.Combine(AppContext.BaseDirectory, "Strings");
|
||||
ILocalizer localizer = await new LocalizerBuilder()
|
||||
.AddStringResourcesFolderForLanguageDictionaries(stringsFolderPath)
|
||||
.SetOptions(options =>
|
||||
{
|
||||
options.DefaultLanguage = "en-US";
|
||||
})
|
||||
.Build();
|
||||
|
||||
_window = Services.GetRequiredService<MainWindow>();
|
||||
_window.Activate();
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 432 B |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 637 B |
|
After Width: | Height: | Size: 283 B |
|
After Width: | Height: | Size: 456 B |
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
|
||||
namespace WinWARP.Ui.Converters;
|
||||
|
||||
public class ItemInvokedEventArgsConverter : IValueConverter
|
||||
{
|
||||
public object? Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
if (value is NavigationViewItemInvokedEventArgs args)
|
||||
{
|
||||
if (args.InvokedItemContainer?.Tag is Type viewModelType)
|
||||
{
|
||||
return viewModelType;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
|
||||
namespace WinWARP.Ui.Converters;
|
||||
|
||||
public class LanguageCodeToNameConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
if (value is string languageCode && !string.IsNullOrWhiteSpace(languageCode))
|
||||
{
|
||||
try
|
||||
{
|
||||
CultureInfo culture = new CultureInfo(languageCode);
|
||||
|
||||
// DisplayName returns "English (United States)"
|
||||
// NativeName returns "English (United States)" or "Español (España)"
|
||||
return culture.NativeName;
|
||||
}
|
||||
catch (CultureNotFoundException)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Microsoft.UI.Xaml.Markup;
|
||||
|
||||
namespace WinWARP.Ui.Helpers;
|
||||
|
||||
[MarkupExtensionReturnType(ReturnType = typeof(Type))]
|
||||
public sealed class TypeExtension : MarkupExtension
|
||||
{
|
||||
public Type? TargetType
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
protected override object? ProvideValue()
|
||||
{
|
||||
return TargetType;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Window
|
||||
x:Class="WinWARP.Ui.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:WinWARP.Ui"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:av="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals"
|
||||
xmlns:i="using:Microsoft.Xaml.Interactivity"
|
||||
xmlns:conv="using:WinWARP.Ui.Converters"
|
||||
xmlns:vm="using:WinWARP.Core.ViewModels"
|
||||
xmlns:h="using:WinWARP.Ui.Helpers"
|
||||
xmlns:u="using:WinUI3Localizer"
|
||||
mc:Ignorable="d"
|
||||
Title="{x:Bind ViewModel.Title, Mode=OneWay}">
|
||||
|
||||
<Window.SystemBackdrop>
|
||||
<MicaBackdrop />
|
||||
</Window.SystemBackdrop>
|
||||
|
||||
<Grid x:Name="RootGrid">
|
||||
<Grid.Resources>
|
||||
<conv:ItemInvokedEventArgsConverter x:Key="ItemInvokedEventArgsConverter" />
|
||||
</Grid.Resources>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TitleBar
|
||||
Title="{x:Bind ViewModel.Title, Mode=OneWay}" x:Name="TopAppBar"
|
||||
Subtitle="alpha"
|
||||
IsBackButtonVisible="{x:Bind RootFrame.CanGoBack, Mode=OneWay}" BackRequested="TitleBar_BackRequested"
|
||||
IsPaneToggleButtonVisible="True" PaneToggleRequested="TitleBar_PaneToggleRequested">
|
||||
<TitleBar.IconSource>
|
||||
<ImageIconSource ImageSource="/Assets/Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
</TitleBar.IconSource>
|
||||
<TitleBar.Content>
|
||||
<Border/>
|
||||
</TitleBar.Content>
|
||||
</TitleBar>
|
||||
<NavigationView Grid.Row="1" x:Name="RootNavigationView"
|
||||
IsBackButtonVisible="Collapsed" IsBackEnabled="True"
|
||||
IsPaneToggleButtonVisible="False" IsPaneOpen="True"
|
||||
IsSettingsVisible="False">
|
||||
<i:Interaction.Behaviors>
|
||||
<i:EventTriggerBehavior EventName="ItemInvoked">
|
||||
<i:InvokeCommandAction
|
||||
Command="{x:Bind ViewModel.NavigateCommand}"
|
||||
InputConverter="{StaticResource ItemInvokedEventArgsConverter}" />
|
||||
</i:EventTriggerBehavior>
|
||||
</i:Interaction.Behaviors>
|
||||
<NavigationView.MenuItems>
|
||||
<NavigationViewItem u:Uids.Uid="HomePageNavPaneTitle" Tag="{h:Type TargetType=vm:HomeViewModel}" IsSelected="True">
|
||||
<NavigationViewItem.Icon>
|
||||
<FontIcon Glyph="" />
|
||||
</NavigationViewItem.Icon>
|
||||
</NavigationViewItem>
|
||||
<NavigationViewItem u:Uids.Uid="SubsSettingsPageNavPaneTitle" Tag="{h:Type TargetType=vm:SubsSettingsViewModel}">
|
||||
<NavigationViewItem.Icon>
|
||||
<FontIcon Glyph="" />
|
||||
</NavigationViewItem.Icon>
|
||||
</NavigationViewItem>
|
||||
<NavigationViewItem u:Uids.Uid="ConfigSettingsPageNavPaneTitle" Tag="{h:Type TargetType=vm:ConfigSettingsViewModel}">
|
||||
<NavigationViewItem.Icon>
|
||||
<FontIcon Glyph="" />
|
||||
</NavigationViewItem.Icon>
|
||||
</NavigationViewItem>
|
||||
</NavigationView.MenuItems>
|
||||
<NavigationView.FooterMenuItems>
|
||||
<NavigationViewItem u:Uids.Uid="SettingsPageNavPaneTitle" Tag="{h:Type TargetType=vm:SettingsViewModel}">
|
||||
<NavigationViewItem.Icon>
|
||||
<AnimatedIcon>
|
||||
<AnimatedIcon.Source>
|
||||
<av:AnimatedSettingsVisualSource/>
|
||||
</AnimatedIcon.Source>
|
||||
<AnimatedIcon.FallbackIconSource>
|
||||
<FontIconSource Glyph=""/>
|
||||
</AnimatedIcon.FallbackIconSource>
|
||||
</AnimatedIcon>
|
||||
</NavigationViewItem.Icon>
|
||||
</NavigationViewItem>
|
||||
</NavigationView.FooterMenuItems>
|
||||
<Frame x:Name="RootFrame">
|
||||
<Frame.ContentTransitions>
|
||||
<TransitionCollection>
|
||||
<NavigationThemeTransition>
|
||||
<NavigationThemeTransition.DefaultNavigationTransitionInfo>
|
||||
<SlideNavigationTransitionInfo Effect="FromRight"/>
|
||||
</NavigationThemeTransition.DefaultNavigationTransitionInfo>
|
||||
</NavigationThemeTransition>
|
||||
</TransitionCollection>
|
||||
</Frame.ContentTransitions>
|
||||
</Frame>
|
||||
</NavigationView>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Input;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using WinWARP.Core.Services;
|
||||
using WinWARP.Core.ViewModels;
|
||||
using WinWARP.Ui.Services;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WinWARP.Ui;
|
||||
/// <summary>
|
||||
/// An empty window that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class MainWindow : Window
|
||||
{
|
||||
public MainViewModel ViewModel { get; }
|
||||
|
||||
public MainWindow(MainViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
ViewModel = viewModel;
|
||||
|
||||
ExtendsContentIntoTitleBar = true;
|
||||
AppWindow.TitleBar.PreferredHeightOption = Microsoft.UI.Windowing.TitleBarHeightOption.Tall;
|
||||
SetTitleBar(TopAppBar);
|
||||
AppWindow.SetIcon("Assets/Square44x44Logo.targetsize-24_altform-unplated.png");
|
||||
|
||||
AppWindow.Resize(new Windows.Graphics.SizeInt32(1024, 759));
|
||||
|
||||
var navService = (NavigationService)App.Services.GetRequiredService<INavigationService>();
|
||||
navService.NavigatedToViewModel += NavService_NavigatedToViewModel;
|
||||
navService.RegisterFrame(RootFrame);
|
||||
|
||||
navService.NavigateTo<HomeViewModel>();
|
||||
|
||||
RootGrid.AddHandler(UIElement.PointerPressedEvent, new PointerEventHandler(Window_PointerPressed), true);
|
||||
}
|
||||
|
||||
private void NavService_NavigatedToViewModel(object? sender, Type e)
|
||||
{
|
||||
var targetItem = RootNavigationView.MenuItems
|
||||
.Concat(RootNavigationView.FooterMenuItems)
|
||||
.OfType<NavigationViewItem>()
|
||||
.FirstOrDefault(item => item.Tag is Type itemVmType && itemVmType == e);
|
||||
|
||||
if (targetItem != null)
|
||||
{
|
||||
RootNavigationView.SelectedItem = targetItem;
|
||||
}
|
||||
}
|
||||
|
||||
private void TitleBar_BackRequested(TitleBar sender, object args)
|
||||
{
|
||||
if (RootFrame.CanGoBack)
|
||||
{
|
||||
RootFrame.GoBack();
|
||||
}
|
||||
}
|
||||
|
||||
private void TitleBar_PaneToggleRequested(TitleBar sender, object args)
|
||||
{
|
||||
RootNavigationView.IsPaneOpen = !RootNavigationView.IsPaneOpen;
|
||||
}
|
||||
|
||||
private void Window_PointerPressed(object sender, PointerRoutedEventArgs e)
|
||||
{
|
||||
var properties = e.GetCurrentPoint(sender as UIElement).Properties;
|
||||
|
||||
// Check if mouse back button (XButton1) was pressed
|
||||
if (properties.PointerUpdateKind == PointerUpdateKind.XButton1Pressed)
|
||||
{
|
||||
e.Handled = true;
|
||||
|
||||
if (RootFrame.CanGoBack)
|
||||
{
|
||||
RootFrame.GoBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||
xmlns:systemai="http://schemas.microsoft.com/appx/manifest/systemai/windows10"
|
||||
IgnorableNamespaces="uap rescap systemai">
|
||||
|
||||
<Identity
|
||||
Name="1423afec-48f0-4a56-a39b-a7c21bf136c9"
|
||||
Publisher="CN=retrd"
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="1423afec-48f0-4a56-a39b-a7c21bf136c9" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Properties>
|
||||
<DisplayName>WinWARP.Ui</DisplayName>
|
||||
<PublisherDisplayName>retrd</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.26226.0" />
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.26226.0" />
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate"/>
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="App"
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="$targetentrypoint$">
|
||||
<uap:VisualElements
|
||||
DisplayName="WinWARP.Ui"
|
||||
Description="WinWARP.Ui"
|
||||
BackgroundColor="transparent"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
Square44x44Logo="Assets\Square44x44Logo.png">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" />
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
<Capabilities>
|
||||
<rescap:Capability Name="runFullTrust" />
|
||||
<systemai:Capability Name="systemAIModels"/>
|
||||
</Capabilities>
|
||||
</Package>
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"profiles": {
|
||||
"WinWARP.Ui (Package)": {
|
||||
"commandName": "MsixPackage"
|
||||
},
|
||||
"WinWARP.Ui (Unpackaged)": {
|
||||
"commandName": "Project"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WinUI3Localizer;
|
||||
using WinWARP.Core.Services;
|
||||
|
||||
namespace WinWARP.Ui.Services;
|
||||
|
||||
public class LocalizationService : ILocalizationService
|
||||
{
|
||||
public IEnumerable<string> GetSupportedLanguages() =>
|
||||
Localizer.Get().GetAvailableLanguages();
|
||||
|
||||
public string GetCurrentLanguage() =>
|
||||
Localizer.Get().GetCurrentLanguage();
|
||||
|
||||
public Task SetLanguageAsync(string languageCode)
|
||||
{
|
||||
Localizer.Get().SetLanguage(languageCode);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public string GetString(string resourceKey) =>
|
||||
Localizer.Get().GetLocalizedString(resourceKey);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using WinWARP.Core.Services;
|
||||
|
||||
namespace WinWARP.Ui.Services;
|
||||
|
||||
public class NavigationService : INavigationService
|
||||
{
|
||||
private readonly Dictionary<Type, Type> _mappings = new();
|
||||
private Frame _frame;
|
||||
|
||||
public void Configure(Type viewModelType, Type pageType)
|
||||
{
|
||||
_mappings[viewModelType] = pageType;
|
||||
_mappings[pageType] = viewModelType;
|
||||
}
|
||||
|
||||
public void RegisterFrame(Frame frame)
|
||||
{
|
||||
_frame = frame;
|
||||
_frame.Navigated += OnFrameNavigated;
|
||||
}
|
||||
|
||||
public bool CanGoBack => _frame?.CanGoBack ?? false;
|
||||
|
||||
public void GoBack()
|
||||
{
|
||||
if (CanGoBack)
|
||||
{
|
||||
_frame.GoBack();
|
||||
}
|
||||
}
|
||||
|
||||
public void NavigateTo<TViewModel>(object parameter = null) where TViewModel : class
|
||||
{
|
||||
var viewModelType = typeof(TViewModel);
|
||||
|
||||
if (!_mappings.TryGetValue(viewModelType, out var pageType))
|
||||
{
|
||||
throw new ArgumentException($"No registered page found for ViewModel: {viewModelType.FullName}");
|
||||
}
|
||||
|
||||
if (_frame != null)
|
||||
{
|
||||
_frame.Navigate(pageType, parameter);
|
||||
}
|
||||
}
|
||||
|
||||
public Type CurrentViewModelType
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
public event EventHandler<Type> NavigatedToViewModel;
|
||||
|
||||
private void OnFrameNavigated(object sender, NavigationEventArgs e)
|
||||
{
|
||||
var pageType = e.SourcePageType;
|
||||
|
||||
if (_mappings.TryGetValue(pageType, out var viewModelType))
|
||||
{
|
||||
CurrentViewModelType = viewModelType;
|
||||
|
||||
NavigatedToViewModel?.Invoke(this, viewModelType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="HomePageNavPaneTitle.Content" xml:space="preserve">
|
||||
<value>Home page</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguageSetting.Description" xml:space="preserve">
|
||||
<value>Will be applied whenever possible in the app</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguageSettingsHeader.Text" xml:space="preserve">
|
||||
<value>Language</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguageSettingSyncSetting.Header" xml:space="preserve">
|
||||
<value>Use system language</value>
|
||||
</data>
|
||||
<data name="SettingsPageNavPaneTitle.Content" xml:space="preserve">
|
||||
<value>Settings</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguageSetting.Header" xml:space="preserve">
|
||||
<value>WinWARP language</value>
|
||||
</data>
|
||||
<data name="SettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>Settings</value>
|
||||
</data>
|
||||
<data name="SettingsPageAppSettingsHeader.Text" xml:space="preserve">
|
||||
<value>App Settings</value>
|
||||
</data>
|
||||
<data name="SettingsPageGeneralSettings.Header" xml:space="preserve">
|
||||
<value>General settings</value>
|
||||
</data>
|
||||
<data name="SettingsPageGeneralSettings.Description" xml:space="preserve">
|
||||
<value>Theme, launch behavior, and more</value>
|
||||
</data>
|
||||
<data name="SettingsPageUpdateSettings.Header" xml:space="preserve">
|
||||
<value>Update settings</value>
|
||||
</data>
|
||||
<data name="SettingsPageUpdateSettings.Description" xml:space="preserve">
|
||||
<value>Automatic updates, update behavior</value>
|
||||
</data>
|
||||
<data name="SettingsPageVPNSettingsHeader.Text" xml:space="preserve">
|
||||
<value>VPN Settings</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguageSettingSyncSettingToggle.OnContent" xml:space="preserve">
|
||||
<value>On</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguageSettingSyncSettingToggle.OffContent" xml:space="preserve">
|
||||
<value>Off</value>
|
||||
</data>
|
||||
<data name="SettingsPageInboundSettings.Header" xml:space="preserve">
|
||||
<value>Inbound</value>
|
||||
</data>
|
||||
<data name="SettingsPageInboundSettings.Description" xml:space="preserve">
|
||||
<value>Service mode, port, local share</value>
|
||||
</data>
|
||||
<data name="SettingsPageRoutingSettings.Header" xml:space="preserve">
|
||||
<value>Routing</value>
|
||||
</data>
|
||||
<data name="SettingsPageRoutingSettings.Description" xml:space="preserve">
|
||||
<value>LAN bypass, per-program, per-host split tunneling</value>
|
||||
</data>
|
||||
<data name="SettingsPageDnsSettings.Header" xml:space="preserve">
|
||||
<value>DNS</value>
|
||||
</data>
|
||||
<data name="SettingsPageDnsSettings.Description" xml:space="preserve">
|
||||
<value>DNS provider, fake DNS, DNS strategies</value>
|
||||
</data>
|
||||
<data name="SettingsPageTLSSettings.Header" xml:space="preserve">
|
||||
<value>TLS</value>
|
||||
</data>
|
||||
<data name="SettingsPageTLSSettings.Description" xml:space="preserve">
|
||||
<value>Fragmentation parameters</value>
|
||||
</data>
|
||||
<data name="SettingsPageWARPSettings.Header" xml:space="preserve">
|
||||
<value>WARP</value>
|
||||
</data>
|
||||
<data name="SettingsPageWARPSettings.Description" xml:space="preserve">
|
||||
<value>Clouflare's WARP configuration</value>
|
||||
</data>
|
||||
<data name="SettingsUpdateSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>Update Settings</value>
|
||||
</data>
|
||||
<data name="SettingsWARPSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>WARP Settings</value>
|
||||
</data>
|
||||
<data name="SettingsTLSSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>TLS Settings</value>
|
||||
</data>
|
||||
<data name="SettingsRoutingSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>Routing Settings</value>
|
||||
</data>
|
||||
<data name="SettingsInboundSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>Inbound Settings</value>
|
||||
</data>
|
||||
<data name="SettingsGeneralSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>General Settings</value>
|
||||
</data>
|
||||
<data name="SettingsDNSSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>DNS Settings</value>
|
||||
</data>
|
||||
<data name="SubsSettingsPageNavPaneTitle.Content" xml:space="preserve">
|
||||
<value>Subscriptions and servers</value>
|
||||
</data>
|
||||
<data name="ConfigSettingsPageNavPaneTitle.Content" xml:space="preserve">
|
||||
<value>Configs settings</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,222 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="HomePageNavPaneTitle.Content" xml:space="preserve">
|
||||
<value>Домашняя</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguageSetting.Description" xml:space="preserve">
|
||||
<value>Будет использован где возможно в приложении</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguageSettingsHeader.Text" xml:space="preserve">
|
||||
<value>Язык</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguageSettingSyncSetting.Header" xml:space="preserve">
|
||||
<value>Использовать язык системы</value>
|
||||
</data>
|
||||
<data name="SettingsPageNavPaneTitle.Content" xml:space="preserve">
|
||||
<value>Настройки</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguageSetting.Header" xml:space="preserve">
|
||||
<value>Язык приложения</value>
|
||||
</data>
|
||||
<data name="SettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>Настройки</value>
|
||||
</data>
|
||||
<data name="SettingsPageAppSettingsHeader.Text" xml:space="preserve">
|
||||
<value>Настройки приложения</value>
|
||||
</data>
|
||||
<data name="SettingsPageGeneralSettings.Header" xml:space="preserve">
|
||||
<value>Общие настройки</value>
|
||||
</data>
|
||||
<data name="SettingsPageGeneralSettings.Description" xml:space="preserve">
|
||||
<value>Тема, поведение при запуске, и пр.</value>
|
||||
</data>
|
||||
<data name="SettingsPageUpdateSettings.Header" xml:space="preserve">
|
||||
<value>Настройки обновлений</value>
|
||||
</data>
|
||||
<data name="SettingsPageUpdateSettings.Description" xml:space="preserve">
|
||||
<value>Автоматические обновления, поведение обновлений</value>
|
||||
</data>
|
||||
<data name="SettingsPageVPNSettingsHeader.Text" xml:space="preserve">
|
||||
<value>Настройки VPN</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguageSettingSyncSettingToggle.OnContent" xml:space="preserve">
|
||||
<value>Вкл.</value>
|
||||
</data>
|
||||
<data name="SettingsPageLanguageSettingSyncSettingToggle.OffContent" xml:space="preserve">
|
||||
<value>Выкл.</value>
|
||||
</data>
|
||||
<data name="SettingsPageInboundSettings.Header" xml:space="preserve">
|
||||
<value>Вход</value>
|
||||
</data>
|
||||
<data name="SettingsPageInboundSettings.Description" xml:space="preserve">
|
||||
<value>Режим сервиса, порт, локальный доступ</value>
|
||||
</data>
|
||||
<data name="SettingsPageRoutingSettings.Header" xml:space="preserve">
|
||||
<value>Маршруты</value>
|
||||
</data>
|
||||
<data name="SettingsPageRoutingSettings.Description" xml:space="preserve">
|
||||
<value>Локальная сеть, исключения для программ и сайтов</value>
|
||||
</data>
|
||||
<data name="SettingsPageDnsSettings.Header" xml:space="preserve">
|
||||
<value>DNS</value>
|
||||
</data>
|
||||
<data name="SettingsPageDnsSettings.Description" xml:space="preserve">
|
||||
<value>DNS провайдер, fake DNS, DNS стратегия</value>
|
||||
</data>
|
||||
<data name="SettingsPageTLSSettings.Header" xml:space="preserve">
|
||||
<value>TLS</value>
|
||||
</data>
|
||||
<data name="SettingsPageTLSSettings.Description" xml:space="preserve">
|
||||
<value>Параметры фрагментации</value>
|
||||
</data>
|
||||
<data name="SettingsPageWARPSettings.Header" xml:space="preserve">
|
||||
<value>WARP</value>
|
||||
</data>
|
||||
<data name="SettingsPageWARPSettings.Description" xml:space="preserve">
|
||||
<value>Настройки Cloudflare WARP</value>
|
||||
</data>
|
||||
<data name="SettingsUpdateSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>Настройки обновлений</value>
|
||||
</data>
|
||||
<data name="SettingsWARPSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>Настройки WARP</value>
|
||||
</data>
|
||||
<data name="SettingsTLSSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>Настройки TLS</value>
|
||||
</data>
|
||||
<data name="SettingsRoutingSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>Настройки маршрутов</value>
|
||||
</data>
|
||||
<data name="SettingsInboundSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>Настройки входа</value>
|
||||
</data>
|
||||
<data name="SettingsGeneralSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>Общие настройки</value>
|
||||
</data>
|
||||
<data name="SettingsDNSSettingsPageTitle.Text" xml:space="preserve">
|
||||
<value>Настройки DNS</value>
|
||||
</data>
|
||||
<data name="SubsSettingsPageNavPaneTitle.Content" xml:space="preserve">
|
||||
<value>Подписки и сервера</value>
|
||||
</data>
|
||||
<data name="ConfigSettingsPageNavPaneTitle.Content" xml:space="preserve">
|
||||
<value>Конфигурации</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page
|
||||
x:Class="WinWARP.Ui.Views.Settings.DnsSettingsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:WinWARP.Ui.Views.Settings"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="using:WinUI3Localizer"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
<ScrollView>
|
||||
<StackPanel Margin="24,14,24,24">
|
||||
<TextBlock u:Uids.Uid="SettingsDNSSettingsPageTitle" Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10"/>
|
||||
</StackPanel>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WinWARP.Ui.Views.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class DnsSettingsPage : Page
|
||||
{
|
||||
public DnsSettingsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page
|
||||
x:Class="WinWARP.Ui.Views.Settings.InboundSettingsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:WinWARP.Ui.Views.Settings"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="using:WinUI3Localizer"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
<ScrollView>
|
||||
<StackPanel Margin="24,14,24,24">
|
||||
<TextBlock u:Uids.Uid="SettingsInboundSettingsPageTitle" Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10"/>
|
||||
</StackPanel>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WinWARP.Ui.Views.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class InboundSettingsPage : Page
|
||||
{
|
||||
public InboundSettingsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page
|
||||
x:Class="WinWARP.Ui.Views.Settings.RoutingSettingsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:WinWARP.Ui.Views.Settings"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="using:WinUI3Localizer"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
<ScrollView>
|
||||
<StackPanel Margin="24,14,24,24">
|
||||
<TextBlock u:Uids.Uid="SettingsRoutingSettingsPageTitle" Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10"/>
|
||||
</StackPanel>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WinWARP.Ui.Views.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class RoutingSettingsPage : Page
|
||||
{
|
||||
public RoutingSettingsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page
|
||||
x:Class="WinWARP.Ui.Views.Settings.TlsSettingsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:WinWARP.Ui.Views.Settings"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="using:WinUI3Localizer"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
<ScrollView>
|
||||
<StackPanel Margin="24,14,24,24">
|
||||
<TextBlock u:Uids.Uid="SettingsTLSSettingsPageTitle" Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10"/>
|
||||
</StackPanel>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WinWARP.Ui.Views.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class TlsSettingsPage : Page
|
||||
{
|
||||
public TlsSettingsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page
|
||||
x:Class="WinWARP.Ui.Views.Settings.WarpSettingsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:WinWARP.Ui.Views.Settings"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="using:WinUI3Localizer"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
<ScrollView>
|
||||
<StackPanel Margin="24,14,24,24">
|
||||
<TextBlock u:Uids.Uid="SettingsWARPSettingsPageTitle" Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10"/>
|
||||
</StackPanel>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WinWARP.Ui.Views.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class WarpSettingsPage : Page
|
||||
{
|
||||
public WarpSettingsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page
|
||||
x:Class="WinWARP.Ui.Views.ConfigSettingsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:WinWARP.Ui.Views"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WinWARP.Ui.Views;
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class ConfigSettingsPage : Page
|
||||
{
|
||||
public ConfigSettingsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page
|
||||
x:Class="WinWARP.Ui.Views.HomePage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:WinWARP.Ui.Views"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<Button Command="{x:Bind ViewModel.TestTransitionCommand}" Content="Test Transition"/>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using WinWARP.Core.ViewModels;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WinWARP.Ui.Views;
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class HomePage : Page
|
||||
{
|
||||
public HomeViewModel ViewModel { get; }
|
||||
|
||||
public HomePage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
ViewModel = App.Services.GetRequiredService<HomeViewModel>();
|
||||
DataContext = ViewModel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page
|
||||
x:Class="WinWARP.Ui.Views.Settings.GeneralSettingsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:WinWARP.Ui.Views.Settings"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="using:WinUI3Localizer"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
<ScrollView>
|
||||
<StackPanel Margin="24,14,24,24">
|
||||
<TextBlock u:Uids.Uid="SettingsGeneralSettingsPageTitle" Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10"/>
|
||||
</StackPanel>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WinWARP.Ui.Views.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class GeneralSettingsPage : Page
|
||||
{
|
||||
public GeneralSettingsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page
|
||||
x:Class="WinWARP.Ui.Views.Settings.UpdateSettingsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:WinWARP.Ui.Views.Settings"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="using:WinUI3Localizer"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
<ScrollView>
|
||||
<StackPanel Margin="24,14,24,24">
|
||||
<TextBlock u:Uids.Uid="SettingsUpdateSettingsPageTitle" Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10"/>
|
||||
</StackPanel>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WinWARP.Ui.Views.Settings;
|
||||
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class UpdateSettingsPage : Page
|
||||
{
|
||||
public UpdateSettingsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page
|
||||
x:Class="WinWARP.Ui.Views.SettingsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:WinWARP.Ui.Views"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="using:WinWARP.Core.ViewModels.Settings"
|
||||
xmlns:c="using:CommunityToolkit.WinUI.Controls"
|
||||
xmlns:conv="using:WinWARP.Ui.Converters"
|
||||
xmlns:h="using:WinWARP.Ui.Helpers"
|
||||
xmlns:u="using:WinUI3Localizer"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ScrollView>
|
||||
<StackPanel Margin="24,14,24,24">
|
||||
<StackPanel.Resources>
|
||||
<conv:LanguageCodeToNameConverter x:Key="LanguageCodeToNameConverter" />
|
||||
</StackPanel.Resources>
|
||||
<TextBlock u:Uids.Uid="SettingsPageTitle" Style="{StaticResource TitleTextBlockStyle}" Margin="0,0,0,10"/>
|
||||
|
||||
<!--App settings-->
|
||||
<TextBlock u:Uids.Uid="SettingsPageAppSettingsHeader" Style="{StaticResource BodyStrongTextBlockStyle}" Margin="0,16,0,10"/>
|
||||
<c:SettingsCard IsClickEnabled="True" u:Uids.Uid="SettingsPageGeneralSettings" Command="{x:Bind ViewModel.NavigateCommand}" CommandParameter="{h:Type TargetType=vm:GeneralSettingsViewModel}">
|
||||
<c:SettingsCard.HeaderIcon>
|
||||
<FontIcon Glyph="" />
|
||||
</c:SettingsCard.HeaderIcon>
|
||||
</c:SettingsCard>
|
||||
<c:SettingsCard IsClickEnabled="True" u:Uids.Uid="SettingsPageUpdateSettings" Command="{x:Bind ViewModel.NavigateCommand}" CommandParameter="{h:Type TargetType=vm:UpdateSettingsViewModel}">
|
||||
<c:SettingsCard.HeaderIcon>
|
||||
<FontIcon Glyph="" />
|
||||
</c:SettingsCard.HeaderIcon>
|
||||
</c:SettingsCard>
|
||||
|
||||
<!--VPN settings--><!--
|
||||
<TextBlock u:Uids.Uid="SettingsPageVPNSettingsHeader" Style="{StaticResource BodyStrongTextBlockStyle}" Margin="0,16,0,10"/>
|
||||
<c:SettingsCard IsClickEnabled="True" u:Uids.Uid="SettingsPageInboundSettings" Command="{x:Bind ViewModel.NavigateCommand}" CommandParameter="{h:Type TargetType=vm:InboundSettingsViewModel}">
|
||||
<c:SettingsCard.HeaderIcon>
|
||||
<FontIcon Glyph="" />
|
||||
</c:SettingsCard.HeaderIcon>
|
||||
</c:SettingsCard>
|
||||
<c:SettingsCard IsClickEnabled="True" u:Uids.Uid="SettingsPageRoutingSettings" Command="{x:Bind ViewModel.NavigateCommand}" CommandParameter="{h:Type TargetType=vm:RoutingSettingsViewModel}">
|
||||
<c:SettingsCard.HeaderIcon>
|
||||
<FontIcon Glyph="" />
|
||||
</c:SettingsCard.HeaderIcon>
|
||||
</c:SettingsCard>
|
||||
<c:SettingsCard IsClickEnabled="True" u:Uids.Uid="SettingsPageDnsSettings" Command="{x:Bind ViewModel.NavigateCommand}" CommandParameter="{h:Type TargetType=vm:DnsSettingsViewModel}">
|
||||
<c:SettingsCard.HeaderIcon>
|
||||
<FontIcon Glyph="" />
|
||||
</c:SettingsCard.HeaderIcon>
|
||||
</c:SettingsCard>
|
||||
<c:SettingsCard IsClickEnabled="True" u:Uids.Uid="SettingsPageTLSSettings" Command="{x:Bind ViewModel.NavigateCommand}" CommandParameter="{h:Type TargetType=vm:TlsSettingsViewModel}">
|
||||
<c:SettingsCard.HeaderIcon>
|
||||
<FontIcon Glyph="" />
|
||||
</c:SettingsCard.HeaderIcon>
|
||||
</c:SettingsCard>
|
||||
<c:SettingsCard IsClickEnabled="True" u:Uids.Uid="SettingsPageWARPSettings" Command="{x:Bind ViewModel.NavigateCommand}" CommandParameter="{h:Type TargetType=vm:WarpSettingsViewModel}">
|
||||
<c:SettingsCard.HeaderIcon>
|
||||
<FontIcon Glyph="" />
|
||||
</c:SettingsCard.HeaderIcon>
|
||||
</c:SettingsCard>-->
|
||||
|
||||
<!--Language setting-->
|
||||
<TextBlock u:Uids.Uid="SettingsPageLanguageSettingsHeader" Style="{StaticResource BodyStrongTextBlockStyle}" Margin="0,16,0,10"/>
|
||||
<c:SettingsExpander u:Uids.Uid="SettingsPageLanguageSetting">
|
||||
<ComboBox ItemsSource="{x:Bind ViewModel.Languages}" SelectedItem="{x:Bind ViewModel.SelectedLanguage, Mode=TwoWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate x:DataType="x:String">
|
||||
<TextBlock Text="{Binding Converter={StaticResource LanguageCodeToNameConverter}}"/>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<c:SettingsExpander.HeaderIcon>
|
||||
<FontIcon Glyph="" />
|
||||
</c:SettingsExpander.HeaderIcon>
|
||||
<c:SettingsExpander.Items>
|
||||
<c:SettingsCard u:Uids.Uid="SettingsPageLanguageSettingSyncSetting">
|
||||
<ToggleSwitch u:Uids.Uid="SettingsPageLanguageSettingSyncSettingToggle"/>
|
||||
</c:SettingsCard>
|
||||
</c:SettingsExpander.Items>
|
||||
</c:SettingsExpander>
|
||||
</StackPanel>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
using WinWARP.Core.ViewModels;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WinWARP.Ui.Views;
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class SettingsPage : Page
|
||||
{
|
||||
public SettingsViewModel ViewModel
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public SettingsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
ViewModel = App.Services.GetRequiredService<SettingsViewModel>();
|
||||
DataContext = ViewModel;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page
|
||||
x:Class="WinWARP.Ui.Views.SubsSettingsPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:WinWARP.Ui.Views"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WinWARP.Ui.Views;
|
||||
/// <summary>
|
||||
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||
/// </summary>
|
||||
public sealed partial class SubsSettingsPage : Page
|
||||
{
|
||||
public SubsSettingsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net10.0-windows10.0.19041.0</TargetFramework>
|
||||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
|
||||
<RootNamespace>WinWARP.Ui</RootNamespace>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<Platforms>x86;x64;ARM64</Platforms>
|
||||
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
|
||||
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
|
||||
<UseWinUI>true</UseWinUI>
|
||||
<WinUISDKReferences>false</WinUISDKReferences>
|
||||
<WindowsPackageType>None</WindowsPackageType>
|
||||
<WindowsAppSdkBootstrapInitialize>true</WindowsAppSdkBootstrapInitialize>
|
||||
<EnableMsixTooling>true</EnableMsixTooling>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Views\HomePage.xaml" />
|
||||
<None Remove="Views\SettingsPage.xaml" />
|
||||
<None Remove="Views\Settings\DnsSettingsPage.xaml" />
|
||||
<None Remove="Views\Settings\GeneralSettingsPage.xaml" />
|
||||
<None Remove="Views\Settings\InboundSettingsPage.xaml" />
|
||||
<None Remove="Views\Settings\RoutingSettingsPage.xaml" />
|
||||
<None Remove="Views\Settings\TLSSettingsPage.xaml" />
|
||||
<None Remove="Views\Settings\UpdateSettingsPage.xaml" />
|
||||
<None Remove="Views\Settings\WarpSettingsPage.xaml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||
<Content Include="Assets\LockScreenLogo.scale-200.png" />
|
||||
<Content Include="Assets\Square150x150Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Content Include="Assets\StoreLogo.png" />
|
||||
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
|
||||
<Content Include="Strings\**\*.resw">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Manifest Include="$(ApplicationManifest)" />
|
||||
</ItemGroup>
|
||||
|
||||
<!--
|
||||
Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
|
||||
Tools extension to be activated for this project even if the Windows App SDK Nuget
|
||||
package has not yet been restored.
|
||||
-->
|
||||
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
|
||||
<ProjectCapability Include="Msix" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Behaviors" Version="8.2.251219" />
|
||||
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.251219" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.10" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.10" />
|
||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.28000.2526" />
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="2.3.1" />
|
||||
<PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="3.53.3" />
|
||||
<PackageReference Include="WinUI3Localizer" Version="2.3.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WinWARP.Core\WinWARP.Core.csproj" />
|
||||
<ProjectReference Include="..\WinWARP.Shared\WinWARP.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="..\Shared\greet.proto" Link="Protos\greet.proto" GrpcServices="None" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="Views\Settings\WarpSettingsPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="Views\Settings\TlsSettingsPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="Views\Settings\DnsSettingsPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="Views\Settings\RoutingSettingsPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="Views\Settings\InboundSettingsPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="Views\Settings\UpdateSettingsPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="Views\SettingsPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="Views\HomePage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="Views\Settings\GeneralSettingsPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Views\ConfigSettings\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="Views\SubsSettingsPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="Views\ConfigSettingsPage.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
<!--
|
||||
Defining the "HasPackageAndPublishMenuAddedByProject" property here allows the Solution
|
||||
Explorer "Package and Publish" context menu entry to be enabled for this project even if
|
||||
the Windows App SDK Nuget package has not yet been restored.
|
||||
-->
|
||||
<PropertyGroup Condition="'$(DisableHasPackageAndPublishMenuAddedByProject)'!='true' and '$(EnableMsixTooling)'=='true'">
|
||||
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Publish Properties -->
|
||||
<PropertyGroup>
|
||||
<PublishReadyToRun Condition="'$(Configuration)' == 'Debug'">False</PublishReadyToRun>
|
||||
<PublishReadyToRun Condition="'$(Configuration)' != 'Debug'">True</PublishReadyToRun>
|
||||
<PublishTrimmed Condition="'$(Configuration)' == 'Debug'">False</PublishTrimmed>
|
||||
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">True</PublishTrimmed>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="WinWARP.Ui.app"/>
|
||||
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- The ID below informs the system that this application is compatible with OS features first introduced in Windows 10.
|
||||
It is necessary to support features in unpackaged applications, for example the custom titlebar implementation.
|
||||
For more info see https://docs.microsoft.com/windows/apps/windows-app-sdk/use-windows-app-sdk-run-time#declare-os-compatibility-in-your-application-manifest -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||
</application>
|
||||
</compatibility>
|
||||
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
||||