improvements to settings page

This commit is contained in:
Enstrayed
2025-02-06 16:30:21 -08:00
parent 5d59bc8ecd
commit a4ea94e269
7 changed files with 149 additions and 3 deletions

View File

@@ -1,7 +1,10 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Reflection;
using System.Runtime.InteropServices.WindowsRuntime;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
@@ -28,6 +31,9 @@ namespace APIToolkit
this.SetTitleBar(AppTitleBar);
ContentArea.Navigate(typeof(URLShortener)); // Set default page
GlobalMethods.WebRequest.BaseAddress = new Uri("https://enstrayed.com/api/"); // Set base address for web requests being made
GlobalMethods.WebRequest.DefaultRequestHeaders.UserAgent.ParseAdd($"DotNet/{Environment.Version} APIToolkit/{GlobalMethods.Version}"); // Set user agent of client
}
private void NavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
@@ -51,4 +57,10 @@ namespace APIToolkit
}
}
public static class GlobalMethods
{
public static HttpClient WebRequest = new();
public static string Version = "1.0";
}
}