diff --git a/Wintor/WinTorrent.sln b/Wintor/WinTorrent.sln
new file mode 100644
index 0000000..a8a57f4
--- /dev/null
+++ b/Wintor/WinTorrent.sln
@@ -0,0 +1,51 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30011.22
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinTorrent", "WinTorrent\WinTorrent.csproj", "{88F8E34F-0129-4856-A1F7-4A89DA892C9B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|ARM = Debug|ARM
+ Debug|ARM64 = Debug|ARM64
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|ARM = Release|ARM
+ Release|ARM64 = Release|ARM64
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Debug|ARM.ActiveCfg = Debug|ARM
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Debug|ARM.Build.0 = Debug|ARM
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Debug|ARM.Deploy.0 = Debug|ARM
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Debug|ARM64.Build.0 = Debug|ARM64
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Debug|ARM64.Deploy.0 = Debug|ARM64
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Debug|x64.ActiveCfg = Debug|x64
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Debug|x64.Build.0 = Debug|x64
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Debug|x64.Deploy.0 = Debug|x64
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Debug|x86.ActiveCfg = Debug|x86
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Debug|x86.Build.0 = Debug|x86
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Debug|x86.Deploy.0 = Debug|x86
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Release|ARM.ActiveCfg = Release|ARM
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Release|ARM.Build.0 = Release|ARM
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Release|ARM.Deploy.0 = Release|ARM
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Release|ARM64.ActiveCfg = Release|ARM64
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Release|ARM64.Build.0 = Release|ARM64
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Release|ARM64.Deploy.0 = Release|ARM64
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Release|x64.ActiveCfg = Release|x64
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Release|x64.Build.0 = Release|x64
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Release|x64.Deploy.0 = Release|x64
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Release|x86.ActiveCfg = Release|x86
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Release|x86.Build.0 = Release|x86
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}.Release|x86.Deploy.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {E3A42E8C-A604-4B2B-9820-C44F47BB4D17}
+ EndGlobalSection
+EndGlobal
diff --git a/Wintor/WinTorrent/App.xaml b/Wintor/WinTorrent/App.xaml
new file mode 100644
index 0000000..0f652a6
--- /dev/null
+++ b/Wintor/WinTorrent/App.xaml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+ DeepSkyBlue
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Wintor/WinTorrent/App.xaml.cs b/Wintor/WinTorrent/App.xaml.cs
new file mode 100644
index 0000000..ab38b67
--- /dev/null
+++ b/Wintor/WinTorrent/App.xaml.cs
@@ -0,0 +1,136 @@
+using System;
+using Windows.ApplicationModel;
+using Windows.ApplicationModel.Activation;
+using Windows.ApplicationModel.Core;
+using Windows.UI;
+using Windows.UI.ViewManagement;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+using WinTorrent.Pages;
+using WinTorrent.Utils;
+
+namespace WinTorrent
+{
+ ///
+ /// Provides application-specific behavior to supplement the default Application class.
+ ///
+ sealed partial class App : Application
+ {
+ ///
+ /// 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().
+ ///
+ public App()
+ {
+ InitializeComponent();
+ Suspending += OnSuspending;
+ }
+
+ public static void UpdateTitleBar(bool isDark)
+ {
+ ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
+ titleBar.ButtonBackgroundColor = Colors.Transparent;
+ titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
+ titleBar.ButtonInactiveForegroundColor = Colors.Gray;
+
+ if (isDark)
+ {
+ titleBar.ButtonForegroundColor =
+ titleBar.ButtonHoverForegroundColor =
+ titleBar.ButtonPressedForegroundColor = Colors.White;
+ titleBar.ButtonHoverBackgroundColor = Color.FromArgb(50, 255, 255, 255);
+ titleBar.ButtonPressedBackgroundColor = Color.FromArgb(30, 255, 255, 255);
+ }
+ else
+ {
+ titleBar.ButtonForegroundColor =
+ titleBar.ButtonHoverForegroundColor =
+ titleBar.ButtonPressedForegroundColor = Colors.Black;
+ titleBar.ButtonHoverBackgroundColor = Color.FromArgb(50, 0, 0, 0);
+ titleBar.ButtonPressedBackgroundColor = Color.FromArgb(70, 0, 0, 0);
+ }
+ }
+
+ ///
+ /// Invoked when the application is launched normally by the end user. Other entry points
+ /// will be used such as when the application is launched to open a specific file.
+ ///
+ /// Details about the launch request and process.
+ protected override void OnLaunched(LaunchActivatedEventArgs e)
+ {
+ CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
+
+ if (!(Window.Current.Content is Frame rootFrame))
+ {
+ rootFrame = new Frame();
+
+ rootFrame.NavigationFailed += OnNavigationFailed;
+
+ if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
+ {
+ //TODO: Load state from previously suspended application
+ }
+
+ Window.Current.Content = rootFrame;
+ }
+
+ if (!e.PrelaunchActivated)
+ {
+ if (rootFrame.Content == null)
+ rootFrame.Navigate(typeof(MainPage), e.Arguments);
+
+ Window.Current.Activate();
+ }
+
+ rootFrame.RequestedTheme = Settings.Theme switch
+ {
+ 0 => ElementTheme.Light,
+ 1 => ElementTheme.Dark,
+ _ => RequestedTheme == ApplicationTheme.Dark ? ElementTheme.Dark : ElementTheme.Light
+ };
+ if (rootFrame.RequestedTheme == ElementTheme.Dark)
+ rootFrame.Background = new AcrylicBrush
+ {
+ TintOpacity = .8,
+ TintColor = Colors.Black,
+ BackgroundSource = AcrylicBackgroundSource.HostBackdrop,
+ FallbackColor = Color.FromArgb(255, 31, 31, 31)
+ };
+ else
+ rootFrame.Background = new AcrylicBrush
+ {
+ TintOpacity = .5,
+ TintColor = Colors.White,
+ BackgroundSource = AcrylicBackgroundSource.HostBackdrop,
+ FallbackColor = Color.FromArgb(255, 230, 230, 230)
+ };
+ UpdateTitleBar(rootFrame.RequestedTheme == ElementTheme.Dark);
+ }
+
+ ///
+ /// Invoked when Navigation to a certain page fails
+ ///
+ /// The Frame which failed navigation
+ /// Details about the navigation failure
+ void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
+ {
+ throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
+ }
+
+ ///
+ /// Invoked when application execution is being suspended. Application state is saved
+ /// without knowing whether the application will be terminated or resumed with the contents
+ /// of memory still intact.
+ ///
+ /// The source of the suspend request.
+ /// Details about the suspend request.
+ private void OnSuspending(object sender, SuspendingEventArgs e)
+ {
+ var deferral = e.SuspendingOperation.GetDeferral();
+ //TODO: Save application state and stop any background activity
+ deferral.Complete();
+ }
+ }
+}
diff --git a/Wintor/WinTorrent/Assets/LargeTile.scale-100.png b/Wintor/WinTorrent/Assets/LargeTile.scale-100.png
new file mode 100644
index 0000000..f05c9f9
Binary files /dev/null and b/Wintor/WinTorrent/Assets/LargeTile.scale-100.png differ
diff --git a/Wintor/WinTorrent/Assets/LargeTile.scale-125.png b/Wintor/WinTorrent/Assets/LargeTile.scale-125.png
new file mode 100644
index 0000000..76e5d85
Binary files /dev/null and b/Wintor/WinTorrent/Assets/LargeTile.scale-125.png differ
diff --git a/Wintor/WinTorrent/Assets/LargeTile.scale-150.png b/Wintor/WinTorrent/Assets/LargeTile.scale-150.png
new file mode 100644
index 0000000..87b319f
Binary files /dev/null and b/Wintor/WinTorrent/Assets/LargeTile.scale-150.png differ
diff --git a/Wintor/WinTorrent/Assets/LargeTile.scale-200.png b/Wintor/WinTorrent/Assets/LargeTile.scale-200.png
new file mode 100644
index 0000000..c31b10c
Binary files /dev/null and b/Wintor/WinTorrent/Assets/LargeTile.scale-200.png differ
diff --git a/Wintor/WinTorrent/Assets/LargeTile.scale-400.png b/Wintor/WinTorrent/Assets/LargeTile.scale-400.png
new file mode 100644
index 0000000..1dcd683
Binary files /dev/null and b/Wintor/WinTorrent/Assets/LargeTile.scale-400.png differ
diff --git a/Wintor/WinTorrent/Assets/LockScreenLogo.scale-200.png b/Wintor/WinTorrent/Assets/LockScreenLogo.scale-200.png
new file mode 100644
index 0000000..735f57a
Binary files /dev/null and b/Wintor/WinTorrent/Assets/LockScreenLogo.scale-200.png differ
diff --git a/Wintor/WinTorrent/Assets/Ref.png b/Wintor/WinTorrent/Assets/Ref.png
new file mode 100644
index 0000000..ce0cf68
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Ref.png differ
diff --git a/Wintor/WinTorrent/Assets/SmallTile.scale-100.png b/Wintor/WinTorrent/Assets/SmallTile.scale-100.png
new file mode 100644
index 0000000..305a2f5
Binary files /dev/null and b/Wintor/WinTorrent/Assets/SmallTile.scale-100.png differ
diff --git a/Wintor/WinTorrent/Assets/SmallTile.scale-125.png b/Wintor/WinTorrent/Assets/SmallTile.scale-125.png
new file mode 100644
index 0000000..a3431ad
Binary files /dev/null and b/Wintor/WinTorrent/Assets/SmallTile.scale-125.png differ
diff --git a/Wintor/WinTorrent/Assets/SmallTile.scale-150.png b/Wintor/WinTorrent/Assets/SmallTile.scale-150.png
new file mode 100644
index 0000000..3cfd2e1
Binary files /dev/null and b/Wintor/WinTorrent/Assets/SmallTile.scale-150.png differ
diff --git a/Wintor/WinTorrent/Assets/SmallTile.scale-200.png b/Wintor/WinTorrent/Assets/SmallTile.scale-200.png
new file mode 100644
index 0000000..09080a4
Binary files /dev/null and b/Wintor/WinTorrent/Assets/SmallTile.scale-200.png differ
diff --git a/Wintor/WinTorrent/Assets/SmallTile.scale-400.png b/Wintor/WinTorrent/Assets/SmallTile.scale-400.png
new file mode 100644
index 0000000..1e4a6f2
Binary files /dev/null and b/Wintor/WinTorrent/Assets/SmallTile.scale-400.png differ
diff --git a/Wintor/WinTorrent/Assets/SplashScreen.scale-100.png b/Wintor/WinTorrent/Assets/SplashScreen.scale-100.png
new file mode 100644
index 0000000..efb658f
Binary files /dev/null and b/Wintor/WinTorrent/Assets/SplashScreen.scale-100.png differ
diff --git a/Wintor/WinTorrent/Assets/SplashScreen.scale-125.png b/Wintor/WinTorrent/Assets/SplashScreen.scale-125.png
new file mode 100644
index 0000000..704e52b
Binary files /dev/null and b/Wintor/WinTorrent/Assets/SplashScreen.scale-125.png differ
diff --git a/Wintor/WinTorrent/Assets/SplashScreen.scale-150.png b/Wintor/WinTorrent/Assets/SplashScreen.scale-150.png
new file mode 100644
index 0000000..dd9446d
Binary files /dev/null and b/Wintor/WinTorrent/Assets/SplashScreen.scale-150.png differ
diff --git a/Wintor/WinTorrent/Assets/SplashScreen.scale-200.png b/Wintor/WinTorrent/Assets/SplashScreen.scale-200.png
new file mode 100644
index 0000000..201aab5
Binary files /dev/null and b/Wintor/WinTorrent/Assets/SplashScreen.scale-200.png differ
diff --git a/Wintor/WinTorrent/Assets/SplashScreen.scale-400.png b/Wintor/WinTorrent/Assets/SplashScreen.scale-400.png
new file mode 100644
index 0000000..a1f6478
Binary files /dev/null and b/Wintor/WinTorrent/Assets/SplashScreen.scale-400.png differ
diff --git a/Wintor/WinTorrent/Assets/Square150x150Logo.scale-100.png b/Wintor/WinTorrent/Assets/Square150x150Logo.scale-100.png
new file mode 100644
index 0000000..8b2cded
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square150x150Logo.scale-100.png differ
diff --git a/Wintor/WinTorrent/Assets/Square150x150Logo.scale-125.png b/Wintor/WinTorrent/Assets/Square150x150Logo.scale-125.png
new file mode 100644
index 0000000..6dcb2b1
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square150x150Logo.scale-125.png differ
diff --git a/Wintor/WinTorrent/Assets/Square150x150Logo.scale-150.png b/Wintor/WinTorrent/Assets/Square150x150Logo.scale-150.png
new file mode 100644
index 0000000..da91d79
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square150x150Logo.scale-150.png differ
diff --git a/Wintor/WinTorrent/Assets/Square150x150Logo.scale-200.png b/Wintor/WinTorrent/Assets/Square150x150Logo.scale-200.png
new file mode 100644
index 0000000..3a795d5
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square150x150Logo.scale-200.png differ
diff --git a/Wintor/WinTorrent/Assets/Square150x150Logo.scale-400.png b/Wintor/WinTorrent/Assets/Square150x150Logo.scale-400.png
new file mode 100644
index 0000000..7a72842
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square150x150Logo.scale-400.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png
new file mode 100644
index 0000000..b7bb2ca
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png
new file mode 100644
index 0000000..c16e04b
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png
new file mode 100644
index 0000000..a67cac0
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png
new file mode 100644
index 0000000..57f4638
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png
new file mode 100644
index 0000000..61aafff
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.altform-unplated_targetsize-16.png b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-unplated_targetsize-16.png
new file mode 100644
index 0000000..b7bb2ca
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-unplated_targetsize-16.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.altform-unplated_targetsize-256.png b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-unplated_targetsize-256.png
new file mode 100644
index 0000000..a67cac0
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-unplated_targetsize-256.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.altform-unplated_targetsize-32.png b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-unplated_targetsize-32.png
new file mode 100644
index 0000000..57f4638
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-unplated_targetsize-32.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.altform-unplated_targetsize-48.png b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
new file mode 100644
index 0000000..61aafff
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.altform-unplated_targetsize-48.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.scale-100.png b/Wintor/WinTorrent/Assets/Square44x44Logo.scale-100.png
new file mode 100644
index 0000000..e3eaee1
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.scale-100.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.scale-125.png b/Wintor/WinTorrent/Assets/Square44x44Logo.scale-125.png
new file mode 100644
index 0000000..f76378b
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.scale-125.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.scale-150.png b/Wintor/WinTorrent/Assets/Square44x44Logo.scale-150.png
new file mode 100644
index 0000000..6fa05c1
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.scale-150.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.scale-200.png b/Wintor/WinTorrent/Assets/Square44x44Logo.scale-200.png
new file mode 100644
index 0000000..3c24051
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.scale-200.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.scale-400.png b/Wintor/WinTorrent/Assets/Square44x44Logo.scale-400.png
new file mode 100644
index 0000000..3adfea8
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.scale-400.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-16.png b/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-16.png
new file mode 100644
index 0000000..ca455fe
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-16.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-24.png b/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-24.png
new file mode 100644
index 0000000..a8827b8
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-24.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
new file mode 100644
index 0000000..02683b5
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-256.png b/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-256.png
new file mode 100644
index 0000000..eabfdd7
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-256.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-32.png b/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-32.png
new file mode 100644
index 0000000..dea2926
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-32.png differ
diff --git a/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-48.png b/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-48.png
new file mode 100644
index 0000000..33acad1
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Square44x44Logo.targetsize-48.png differ
diff --git a/Wintor/WinTorrent/Assets/StoreLogo.backup.png b/Wintor/WinTorrent/Assets/StoreLogo.backup.png
new file mode 100644
index 0000000..7385b56
Binary files /dev/null and b/Wintor/WinTorrent/Assets/StoreLogo.backup.png differ
diff --git a/Wintor/WinTorrent/Assets/StoreLogo.scale-100.png b/Wintor/WinTorrent/Assets/StoreLogo.scale-100.png
new file mode 100644
index 0000000..0a56091
Binary files /dev/null and b/Wintor/WinTorrent/Assets/StoreLogo.scale-100.png differ
diff --git a/Wintor/WinTorrent/Assets/StoreLogo.scale-125.png b/Wintor/WinTorrent/Assets/StoreLogo.scale-125.png
new file mode 100644
index 0000000..4599f06
Binary files /dev/null and b/Wintor/WinTorrent/Assets/StoreLogo.scale-125.png differ
diff --git a/Wintor/WinTorrent/Assets/StoreLogo.scale-150.png b/Wintor/WinTorrent/Assets/StoreLogo.scale-150.png
new file mode 100644
index 0000000..289e45b
Binary files /dev/null and b/Wintor/WinTorrent/Assets/StoreLogo.scale-150.png differ
diff --git a/Wintor/WinTorrent/Assets/StoreLogo.scale-200.png b/Wintor/WinTorrent/Assets/StoreLogo.scale-200.png
new file mode 100644
index 0000000..13358ac
Binary files /dev/null and b/Wintor/WinTorrent/Assets/StoreLogo.scale-200.png differ
diff --git a/Wintor/WinTorrent/Assets/StoreLogo.scale-400.png b/Wintor/WinTorrent/Assets/StoreLogo.scale-400.png
new file mode 100644
index 0000000..4ce93eb
Binary files /dev/null and b/Wintor/WinTorrent/Assets/StoreLogo.scale-400.png differ
diff --git a/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-100.png b/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-100.png
new file mode 100644
index 0000000..1be252c
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-100.png differ
diff --git a/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-125.png b/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-125.png
new file mode 100644
index 0000000..9fd514c
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-125.png differ
diff --git a/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-150.png b/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-150.png
new file mode 100644
index 0000000..f02eaca
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-150.png differ
diff --git a/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-200.png b/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-200.png
new file mode 100644
index 0000000..9497527
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-200.png differ
diff --git a/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-400.png b/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-400.png
new file mode 100644
index 0000000..36b9dd9
Binary files /dev/null and b/Wintor/WinTorrent/Assets/Wide310x150Logo.scale-400.png differ
diff --git a/Wintor/WinTorrent/Dialogs/AddTorrentDialog.xaml b/Wintor/WinTorrent/Dialogs/AddTorrentDialog.xaml
new file mode 100644
index 0000000..3f824bf
--- /dev/null
+++ b/Wintor/WinTorrent/Dialogs/AddTorrentDialog.xaml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/Wintor/WinTorrent/Dialogs/AddTorrentDialog.xaml.cs b/Wintor/WinTorrent/Dialogs/AddTorrentDialog.xaml.cs
new file mode 100644
index 0000000..ac4f436
--- /dev/null
+++ b/Wintor/WinTorrent/Dialogs/AddTorrentDialog.xaml.cs
@@ -0,0 +1,35 @@
+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 Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Content Dialog item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace WinTorrent.Dialogs
+{
+ public sealed partial class AddTorrentDialog : ContentDialog
+ {
+ public AddTorrentDialog()
+ {
+ this.InitializeComponent();
+ }
+
+ private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
+ {
+ }
+
+ private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
+ {
+ }
+ }
+}
diff --git a/Wintor/WinTorrent/Models/DataSize.cs b/Wintor/WinTorrent/Models/DataSize.cs
new file mode 100644
index 0000000..c741f22
--- /dev/null
+++ b/Wintor/WinTorrent/Models/DataSize.cs
@@ -0,0 +1,63 @@
+using System;
+using System.Collections.Generic;
+
+namespace WinTorrent.Models
+{
+ public struct DataSize : IComparable, IEquatable, IComparer
+ {
+ public long ByteSize { get; set; }
+
+ public DataSize(long sizeInBytes) =>
+ ByteSize = sizeInBytes;
+
+ public override string ToString() =>
+ $"{ByteSize} B";
+
+ public int CompareTo(DataSize other) =>
+ (int)Math.Clamp(ByteSize - other.ByteSize, -1, 1);
+
+ public bool Equals(DataSize other) =>
+ ByteSize == other.ByteSize;
+
+ public int Compare(DataSize x, DataSize y) =>
+ (int)Math.Clamp(x.ByteSize - y.ByteSize, -1, 1);
+
+ public static double operator /(DataSize s1, DataSize s2) =>
+ s1.ByteSize / s2.ByteSize;
+ public static bool operator ==(DataSize s1, DataSize s2) =>
+ s1.ByteSize == s2.ByteSize;
+ public static bool operator !=(DataSize s1, DataSize s2) =>
+ s1.ByteSize != s2.ByteSize;
+ public static bool operator ==(DataSize s1, int s2) =>
+ s1.ByteSize == s2;
+ public static bool operator !=(DataSize s1, int s2) =>
+ s1.ByteSize != s2;
+ }
+
+ public struct DownloadSpeed : IComparable, IEquatable, IComparer
+ {
+ public long BytesPerSecond { get; set; }
+
+ public DownloadSpeed(long bps) =>
+ BytesPerSecond = bps;
+
+ public override string ToString() =>
+ $"{BytesPerSecond} B/s";
+
+ public int CompareTo(DownloadSpeed other) =>
+ (int)Math.Clamp(BytesPerSecond - other.BytesPerSecond, -1, 1);
+
+ public bool Equals(DownloadSpeed other) =>
+ BytesPerSecond == other.BytesPerSecond;
+
+ public int Compare(DownloadSpeed x, DownloadSpeed y) =>
+ (int)Math.Clamp(x.BytesPerSecond - y.BytesPerSecond, -1, 1);
+
+ public static double operator /(DownloadSpeed s1, DownloadSpeed s2) =>
+ s1.BytesPerSecond / s2.BytesPerSecond;
+ public static bool operator ==(DownloadSpeed s1, DownloadSpeed s2) =>
+ s1.BytesPerSecond == s2.BytesPerSecond;
+ public static bool operator !=(DownloadSpeed s1, DownloadSpeed s2) =>
+ s1.BytesPerSecond != s2.BytesPerSecond;
+ }
+}
diff --git a/Wintor/WinTorrent/Models/PointerHoverStateTrigger.cs b/Wintor/WinTorrent/Models/PointerHoverStateTrigger.cs
new file mode 100644
index 0000000..cdca01f
--- /dev/null
+++ b/Wintor/WinTorrent/Models/PointerHoverStateTrigger.cs
@@ -0,0 +1,38 @@
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using WinTorrent.Pages;
+
+namespace WinTorrent.Models
+{
+ class PointerHoverStateTrigger : StateTriggerBase
+ {
+ public TorrentItem TargetItem
+ {
+ get => _targetItem;
+ set
+ {
+ if (_targetItem == value)
+ return;
+
+ if (_targetElement != null)
+ {
+ _targetElement.PointerEntered -= PointerEntered;
+ _targetElement.PointerExited -= PointerExited;
+ }
+
+ _targetItem = value;
+ _targetElement = ((Window.Current.Content as Frame).Content as MainPage).list.ContainerFromItem(_targetItem) as FrameworkElement;
+ _targetElement.PointerEntered += PointerEntered;
+ _targetElement.PointerExited += PointerExited;
+ }
+ }
+ private TorrentItem _targetItem;
+ private FrameworkElement _targetElement;
+
+ private void PointerExited(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e) =>
+ SetActive(false);
+
+ private void PointerEntered(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e) =>
+ SetActive(true);
+ }
+}
diff --git a/Wintor/WinTorrent/Models/TorrentItem.cs b/Wintor/WinTorrent/Models/TorrentItem.cs
new file mode 100644
index 0000000..5bfa2f6
--- /dev/null
+++ b/Wintor/WinTorrent/Models/TorrentItem.cs
@@ -0,0 +1,133 @@
+using System;
+using System.ComponentModel;
+using Windows.Storage;
+using WinTorrent.Utils;
+
+namespace WinTorrent.Models
+{
+ public enum TorrentState
+ {
+ Initializing = 0,
+ Downloading = 1,
+ Cancelling = 2,
+ Pausing = 3,
+ Paused = 4,
+ Resuming = 5,
+ Completed = 6,
+ Seeding = 7,
+ Error = 8
+ }
+
+ public class TorrentItem : INotifyPropertyChanged
+ {
+ public event TorrentStateChangedEventHandler StateChanged;
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ public string Title
+ {
+ get => _title;
+ set
+ {
+ if (_title == value)
+ return;
+
+ _title = value;
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Title)));
+ }
+ }
+ private string _title;
+
+ public TorrentState State
+ {
+ get => _state;
+ set
+ {
+ if (_state == value)
+ return;
+
+ TorrentState previousState = _state;
+ _state = value;
+ StateChanged?.Invoke(this, previousState);
+ TorrentClient.OnItemStateChanged(this, previousState);
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(State)));
+ }
+ }
+ private TorrentState _state = TorrentState.Initializing;
+
+ public DownloadSpeed TransmissionSpeed
+ {
+ get => _transmissionSpeed;
+ set
+ {
+ if (_transmissionSpeed == value)
+ return;
+
+ _transmissionSpeed = value;
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(TransmissionSpeed)));
+ }
+ }
+ private DownloadSpeed _transmissionSpeed;
+
+ public DataSize Downloaded
+ {
+ get => _downloaded;
+ set
+ {
+ if (_downloaded == value)
+ return;
+
+ _downloaded = value;
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Downloaded)));
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Progress)));
+ }
+ }
+ private DataSize _downloaded;
+
+ public DataSize TotalSize
+ {
+ get => _totalSize;
+ set
+ {
+ if (_totalSize == value)
+ return;
+
+ _totalSize = value;
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(TotalSize)));
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Progress)));
+ }
+ }
+ private DataSize _totalSize;
+
+ public double Progress => TotalSize != 0 ? ((double)Downloaded.ByteSize / TotalSize.ByteSize) : 0;
+
+ public int SeedCount
+ {
+ get => _seedCount;
+ set
+ {
+ if (_seedCount == value)
+ return;
+
+ _seedCount = value;
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SeedCount)));
+ }
+ }
+ private int _seedCount;
+
+ public TimeSpan RemainingTime
+ {
+ get => _remainingTime;
+ set
+ {
+ if (_remainingTime == value)
+ return;
+
+ _remainingTime = value;
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SeedCount)));
+ }
+ }
+ private TimeSpan _remainingTime;
+
+ public IStorageItem Files { get; set; }
+ }
+}
diff --git a/Wintor/WinTorrent/Models/TorrentStateDataTrigger.cs b/Wintor/WinTorrent/Models/TorrentStateDataTrigger.cs
new file mode 100644
index 0000000..40f4df8
--- /dev/null
+++ b/Wintor/WinTorrent/Models/TorrentStateDataTrigger.cs
@@ -0,0 +1,46 @@
+using Windows.UI.Xaml;
+
+namespace WinTorrent.Models
+{
+ public class TorrentStateDataTrigger : StateTriggerBase
+ {
+ public TorrentState TargetState
+ {
+ get => _targetState;
+ set
+ {
+ if (_targetState == value)
+ return;
+
+ _targetState = value;
+ UpdateTrigger();
+ }
+ }
+ private TorrentState _targetState;
+
+ public TorrentItem TargetElement
+ {
+ get => _targetElement;
+ set
+ {
+ if (_targetElement == value)
+ return;
+
+ if (_targetElement != null)
+ _targetElement.StateChanged -= TargetElementStateChanged;
+
+ _targetElement = value;
+ _targetElement.StateChanged += TargetElementStateChanged;
+
+ UpdateTrigger();
+ }
+ }
+ private TorrentItem _targetElement;
+
+ private void UpdateTrigger() =>
+ SetActive(TargetElement?.State == TargetState);
+
+ private void TargetElementStateChanged(TorrentItem sender, TorrentState previousState) =>
+ UpdateTrigger();
+ }
+}
diff --git a/Wintor/WinTorrent/Package.appxmanifest b/Wintor/WinTorrent/Package.appxmanifest
new file mode 100644
index 0000000..9b36fa4
--- /dev/null
+++ b/Wintor/WinTorrent/Package.appxmanifest
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+ Wintor
+ XFox
+ Assets\StoreLogo.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Wintor/WinTorrent/Pages/MainPage.xaml b/Wintor/WinTorrent/Pages/MainPage.xaml
new file mode 100644
index 0000000..5b50e08
--- /dev/null
+++ b/Wintor/WinTorrent/Pages/MainPage.xaml
@@ -0,0 +1,336 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ of
+
+
+ remaining
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Wintor/WinTorrent/Pages/MainPage.xaml.cs b/Wintor/WinTorrent/Pages/MainPage.xaml.cs
new file mode 100644
index 0000000..49c1221
--- /dev/null
+++ b/Wintor/WinTorrent/Pages/MainPage.xaml.cs
@@ -0,0 +1,119 @@
+using System;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Media.Animation;
+using Windows.UI.Xaml.Navigation;
+using WinTorrent.Dialogs;
+using WinTorrent.Models;
+using WinTorrent.Utils;
+
+namespace WinTorrent.Pages
+{
+ public sealed partial class MainPage : Page
+ {
+ public MainPage()
+ {
+ InitializeComponent();
+
+ sharedShadow.Receivers.Add(shadowRecieverGrid);
+ search.Translation += new System.Numerics.Vector3(0, 0, 10);
+
+ navigationList.SelectedIndex = 0;
+ TorrentClient.TorrentItemStateChanged += (s, e) => NavigationViewList_SelectionChanged(this, null);
+ }
+
+ protected override void OnNavigatedTo(NavigationEventArgs e)
+ {
+ base.OnNavigatedTo(e);
+
+ Window.Current.SetTitleBar(TitleBar);
+ }
+
+ private void OpenSettings(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) =>
+ Frame.Navigate(typeof(SettingsPage), null, new SlideNavigationTransitionInfo { Effect = SlideNavigationTransitionEffect.FromLeft });
+
+ private async void AddTorrent(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) =>
+ await new AddTorrentDialog().ShowAsync();
+
+ private void NavigationViewList_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ list.ItemsSource = (navigationList.SelectedItem as NavigationViewItem)?.Tag as string switch
+ {
+ "downloading" => TorrentClient.Torrents.FindAll(i => i.State.BelongsTo(TorrentState.Downloading, TorrentState.Cancelling, TorrentState.Error, TorrentState.Initializing, TorrentState.Pausing)),
+ "seeding" => TorrentClient.Torrents.FindAll(i => i.State.BelongsTo(TorrentState.Seeding)),
+ "completed" => TorrentClient.Torrents.FindAll(i => i.State.BelongsTo(TorrentState.Completed, TorrentState.Seeding)),
+ "paused" => TorrentClient.Torrents.FindAll(i => i.State.BelongsTo(TorrentState.Paused, TorrentState.Resuming)),
+ _ => TorrentClient.Torrents
+ };
+ search.ItemsSource = null;
+ }
+
+ private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
+ {
+ if (args.Reason != AutoSuggestionBoxTextChangeReason.UserInput)
+ return;
+
+ sender.ItemsSource = null;
+ navigationList.SelectedIndex = 0;
+ var result = TorrentClient.Torrents.FindAll(i =>
+ i.Title.ToLowerInvariant().Contains(sender.Text.ToLowerInvariant()) ||
+ (i.Files?.Path.ToLowerInvariant().Contains(sender.Text.ToLowerInvariant()) ?? false) ||
+ i.State.ToString().ToLowerInvariant().Contains(sender.Text.ToLowerInvariant()));
+
+ list.ItemsSource = result;
+
+ if (result.Count < 1)
+ {
+ if (sender.Text.ToUri() is Uri magnetUrl && magnetUrl.IsAbsoluteUri)
+ {
+ sender.ItemsSource = new[] { $"Add torrent from URL: {magnetUrl.AbsoluteUri}" };
+ }
+ else
+ {
+ sender.ItemsSource = new[] { "No results found" };
+ }
+ }
+ }
+
+ private void AutoSuggestBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args)
+ {
+ if (args.SelectedItem as string == "No results found")
+ return;
+ // TODO: Add torrent from URL
+ }
+
+ private void PauseItem(object sender, RoutedEventArgs e)
+ {
+
+ }
+
+ private void list_ItemClick(object sender, ItemClickEventArgs e) =>
+ OpenItem(e.ClickedItem as TorrentItem);
+
+ private void ViewItem(object sender, RoutedEventArgs e) =>
+ OpenItem(list.ItemFromContainer(((sender as FrameworkElement).Parent as FrameworkElement).Parent) as TorrentItem);
+
+ private void OpenItem(TorrentItem item)
+ {
+ if (list.ContainerFromItem(item) as ListViewItem != null)
+ list.PrepareConnectedAnimation("ca1", item, "caTarget");
+
+ Frame.Navigate(typeof(TorrentDetailsPage), item);
+ }
+
+ private void SetSeeding(object sender, RoutedEventArgs e)
+ {
+
+ }
+
+ private void SetPriority(object sender, RoutedEventArgs e)
+ {
+
+ }
+
+ private void DeleteItem(object sender, RoutedEventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/Wintor/WinTorrent/Pages/SettingsPage.xaml b/Wintor/WinTorrent/Pages/SettingsPage.xaml
new file mode 100644
index 0000000..42107aa
--- /dev/null
+++ b/Wintor/WinTorrent/Pages/SettingsPage.xaml
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ It's an open source software! Check out the code on GitHub
+
+
+ Idea and design by @proxedised
+
+ Reddit: @proxedised
+
+
+
+
+ Developed by Michael "XFox" Gordeev
+
+ Twitter: @xfox111
+ LinkedIn: @xfox
+ Website: https://xfox111.net/
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Wintor/WinTorrent/Pages/SettingsPage.xaml.cs b/Wintor/WinTorrent/Pages/SettingsPage.xaml.cs
new file mode 100644
index 0000000..cd27ecb
--- /dev/null
+++ b/Wintor/WinTorrent/Pages/SettingsPage.xaml.cs
@@ -0,0 +1,71 @@
+using Windows.UI;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Media.Animation;
+using WinTorrent.Utils;
+
+namespace WinTorrent.Pages
+{
+ public sealed partial class SettingsPage : Page
+ {
+ public SettingsPage()
+ {
+ InitializeComponent();
+ Window.Current.SetTitleBar(TitleBar);
+
+ feedback.Visibility = Feedback.HasFeedbackHub ? Visibility.Visible : Visibility.Collapsed;
+
+ switch (Settings.Theme)
+ {
+ case 0:
+ light.IsChecked = true;
+ break;
+ case 1:
+ dark.IsChecked = true;
+ break;
+ case 2:
+ system.IsChecked = true;
+ break;
+ }
+
+ // TODO: Add settings management
+ }
+
+ private void BackRequested(object sender, RoutedEventArgs e) =>
+ Frame.Navigate(typeof(MainPage), null, new DrillInNavigationTransitionInfo());
+
+ private void ThemeChanged(object sender, RoutedEventArgs e)
+ {
+ if (Settings.Theme.ToString() == (string)(sender as RadioButton).Tag)
+ return;
+
+ Settings.Theme = int.Parse((sender as RadioButton).Tag as string);
+
+ Frame.RequestedTheme = (sender as RadioButton).Name switch
+ {
+ "light" => ElementTheme.Light,
+ "dark" => ElementTheme.Dark,
+ _ => Application.Current.RequestedTheme == ApplicationTheme.Dark ? ElementTheme.Dark : ElementTheme.Light
+ };
+
+ if (Frame.RequestedTheme == ElementTheme.Dark)
+ Frame.Background = new AcrylicBrush
+ {
+ TintOpacity = .8,
+ TintColor = Colors.Black,
+ BackgroundSource = AcrylicBackgroundSource.HostBackdrop,
+ FallbackColor = Color.FromArgb(255, 31, 31, 31)
+ };
+ else
+ Frame.Background = new AcrylicBrush
+ {
+ TintOpacity = .5,
+ TintColor = Colors.White,
+ BackgroundSource = AcrylicBackgroundSource.HostBackdrop,
+ FallbackColor = Color.FromArgb(255, 230, 230, 230)
+ };
+ App.UpdateTitleBar(Frame.RequestedTheme == ElementTheme.Dark);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Wintor/WinTorrent/Pages/TorrentDetailsPage.xaml b/Wintor/WinTorrent/Pages/TorrentDetailsPage.xaml
new file mode 100644
index 0000000..069f7a6
--- /dev/null
+++ b/Wintor/WinTorrent/Pages/TorrentDetailsPage.xaml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Wintor/WinTorrent/Pages/TorrentDetailsPage.xaml.cs b/Wintor/WinTorrent/Pages/TorrentDetailsPage.xaml.cs
new file mode 100644
index 0000000..4526af9
--- /dev/null
+++ b/Wintor/WinTorrent/Pages/TorrentDetailsPage.xaml.cs
@@ -0,0 +1,32 @@
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Media.Animation;
+using Windows.UI.Xaml.Navigation;
+using WinTorrent.Models;
+
+namespace WinTorrent.Pages
+{
+ public sealed partial class TorrentDetailsPage : Page
+ {
+ public TorrentItem Item { get; private set; }
+
+ public TorrentDetailsPage()
+ {
+ InitializeComponent();
+ Window.Current.SetTitleBar(TitleBar);
+ }
+
+ protected override void OnNavigatedTo(NavigationEventArgs e)
+ {
+ base.OnNavigatedTo(e);
+
+ Item = e.Parameter as TorrentItem;
+
+ if (ConnectedAnimationService.GetForCurrentView().GetAnimation("ca1") is ConnectedAnimation animation)
+ animation.TryStart(caTarget);
+ }
+
+ private void BackRequested(object sender, RoutedEventArgs e) =>
+ Frame.Navigate(typeof(MainPage), null, new DrillInNavigationTransitionInfo());
+ }
+}
diff --git a/Wintor/WinTorrent/Properties/AssemblyInfo.cs b/Wintor/WinTorrent/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..19efec6
--- /dev/null
+++ b/Wintor/WinTorrent/Properties/AssemblyInfo.cs
@@ -0,0 +1,29 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Wintor")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Wintor")]
+[assembly: AssemblyCopyright("Copyright © 2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: ComVisible(false)]
\ No newline at end of file
diff --git a/Wintor/WinTorrent/Properties/Default.rd.xml b/Wintor/WinTorrent/Properties/Default.rd.xml
new file mode 100644
index 0000000..af00722
--- /dev/null
+++ b/Wintor/WinTorrent/Properties/Default.rd.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Wintor/WinTorrent/TemplateDictionaries/AutoSuggestBoxTemplateDictionary.xaml b/Wintor/WinTorrent/TemplateDictionaries/AutoSuggestBoxTemplateDictionary.xaml
new file mode 100644
index 0000000..5171c0f
--- /dev/null
+++ b/Wintor/WinTorrent/TemplateDictionaries/AutoSuggestBoxTemplateDictionary.xaml
@@ -0,0 +1,258 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Visible
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Wintor/WinTorrent/TemplateDictionaries/ListViewItemTemplateDictionary.xaml b/Wintor/WinTorrent/TemplateDictionaries/ListViewItemTemplateDictionary.xaml
new file mode 100644
index 0000000..57666a1
--- /dev/null
+++ b/Wintor/WinTorrent/TemplateDictionaries/ListViewItemTemplateDictionary.xaml
@@ -0,0 +1,76 @@
+
+
+
+
diff --git a/Wintor/WinTorrent/TemplateDictionaries/NavigationViewItemTemplateDictionary.xaml b/Wintor/WinTorrent/TemplateDictionaries/NavigationViewItemTemplateDictionary.xaml
new file mode 100644
index 0000000..0b3a1ee
--- /dev/null
+++ b/Wintor/WinTorrent/TemplateDictionaries/NavigationViewItemTemplateDictionary.xaml
@@ -0,0 +1,493 @@
+
+
+
+
+
+
+
+
+
diff --git a/Wintor/WinTorrent/Utils/Extensions.cs b/Wintor/WinTorrent/Utils/Extensions.cs
new file mode 100644
index 0000000..386aed3
--- /dev/null
+++ b/Wintor/WinTorrent/Utils/Extensions.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Linq;
+
+namespace WinTorrent
+{
+ public static class Extensions
+ {
+ public static bool BelongsTo(this T obj, params T[] set) =>
+ set.Contains(obj);
+
+ public static Uri ToUri(this string str)
+ {
+ Uri.TryCreate(str, UriKind.RelativeOrAbsolute, out Uri uri);
+ return uri;
+ }
+ }
+}
diff --git a/Wintor/WinTorrent/Utils/Feedback.cs b/Wintor/WinTorrent/Utils/Feedback.cs
new file mode 100644
index 0000000..f84b98c
--- /dev/null
+++ b/Wintor/WinTorrent/Utils/Feedback.cs
@@ -0,0 +1,78 @@
+using Microsoft.Services.Store.Engagement;
+using System;
+using Windows.Services.Store;
+using Windows.UI.Xaml.Controls;
+
+namespace WinTorrent.Utils
+{
+ public static class Feedback
+ {
+ public static bool HasFeedbackHub => StoreServicesFeedbackLauncher.IsSupported();
+
+ public static async void OpenFeedbackHub()
+ {
+ if (HasFeedbackHub)
+ await StoreServicesFeedbackLauncher.GetDefault().LaunchAsync();
+ }
+
+ public static async void PromptFeedback()
+ {
+ if (!HasFeedbackHub)
+ {
+ Settings.PromptFeedback = false;
+ return;
+ }
+
+ ContentDialog dialog = new ContentDialog
+ {
+ Title = "Have some thoughts?",
+
+ PrimaryButtonText = "Sure!",
+ SecondaryButtonText = "Don't ask me anymore",
+ CloseButtonText = "Maybe later",
+
+ DefaultButton = ContentDialogButton.Primary,
+
+ Content = new TextBlock
+ {
+ Text = "Would you like to share something you like or dislike in the app? Or perhaps you have some ideas? Leave feedback!"
+ }
+ };
+
+ ContentDialogResult result = await dialog.ShowAsync();
+
+ if (result != ContentDialogResult.None)
+ Settings.PromptFeedback = false;
+
+ if (result == ContentDialogResult.Primary)
+ OpenFeedbackHub();
+ }
+
+ public static async void PromptReview()
+ {
+ ContentDialog dialog = new ContentDialog
+ {
+ Title = "Like our app?",
+
+ PrimaryButtonText = "Sure!",
+ SecondaryButtonText = "Don't ask me anymore",
+ CloseButtonText = "Maybe later",
+
+ DefaultButton = ContentDialogButton.Primary,
+
+ Content = new TextBlock
+ {
+ Text = "Could you leave a feedback on Microsfot Store page? It's very important for me :)"
+ }
+ };
+
+ ContentDialogResult result = await dialog.ShowAsync();
+
+ if (result != ContentDialogResult.None)
+ Settings.PromptReview = false;
+
+ if (result == ContentDialogResult.Primary)
+ await StoreContext.GetDefault().RequestRateAndReviewAppAsync();
+ }
+ }
+}
\ No newline at end of file
diff --git a/Wintor/WinTorrent/Utils/Metrics.cs b/Wintor/WinTorrent/Utils/Metrics.cs
new file mode 100644
index 0000000..1c8de64
--- /dev/null
+++ b/Wintor/WinTorrent/Utils/Metrics.cs
@@ -0,0 +1,57 @@
+using Microsoft.AppCenter;
+using Microsoft.AppCenter.Analytics;
+using Microsoft.AppCenter.Crashes;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+using Windows.ApplicationModel;
+using Windows.Storage;
+
+namespace WinTorrent.Utils
+{
+ public static class Metrics
+ {
+ static readonly ApplicationDataContainer storage = ApplicationData.Current.RoamingSettings;
+
+ static readonly Stopwatch sw = new Stopwatch();
+ public static TimeSpan Uptime
+ {
+ get => (TimeSpan?)storage.Values["Metrics.SpentTime"] ?? TimeSpan.FromSeconds(0);
+ set => storage.Values["Metrics.SpentTime"] = value;
+ }
+ public static string CurrentVersion
+ {
+ get
+ {
+ PackageVersion v = Package.Current.Id.Version;
+ return $"{v.Major}.{v.Minor}.{v.Revision}.{v.Build}";
+ }
+ }
+
+ public static void StartSession()
+ {
+ sw.Start();
+ AppCenter.Start("45774462-9ea7-438a-96fc-03982666f39e", typeof(Analytics), typeof(Crashes));
+ AppCenter.SetCountryCode(new RegionInfo(CultureInfo.CurrentUICulture.Name).TwoLetterISORegionName);
+ }
+
+ public static void EndSession()
+ {
+ sw.Stop();
+ Uptime += sw.Elapsed;
+
+ AddEvent("Session closed",
+ ("Duration", sw.Elapsed.ToString()),
+ ("Spend time total", Uptime.ToString()));
+ }
+
+ public static void AddEvent(string eventName, params (string key, string value)[] details)
+ {
+ Dictionary parameters = new Dictionary();
+ foreach (var (key, value) in details)
+ parameters.Add(key, value);
+ Analytics.TrackEvent(eventName, parameters.Count > 0 ? parameters : null);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Wintor/WinTorrent/Utils/Settings.cs b/Wintor/WinTorrent/Utils/Settings.cs
new file mode 100644
index 0000000..125c1dc
--- /dev/null
+++ b/Wintor/WinTorrent/Utils/Settings.cs
@@ -0,0 +1,70 @@
+using System;
+using System.Threading.Tasks;
+using Windows.ApplicationModel;
+using Windows.Storage;
+using Windows.Storage.AccessCache;
+
+namespace WinTorrent.Utils
+{
+ public static class Settings
+ {
+ static readonly ApplicationDataContainer settings = ApplicationData.Current.RoamingSettings;
+
+ public static bool Startup
+ {
+ get => (bool?)settings.Values["Startup"] ?? false;
+ set => settings.Values["Startup"] = value;
+ }
+ public static bool RunOnSaver
+ {
+ get => (bool?)settings.Values["RunOnSaver"] ?? false;
+ set => settings.Values["RunOnSaver"] = value;
+ }
+
+ public static bool SeedCompleted
+ {
+ get => (bool?)settings.Values["SeedCompleted"] ?? true;
+ set => settings.Values["SeedCompleted"] = value;
+ }
+ public static string DefaultFolder
+ {
+ get => (string)settings.Values["DefaultFolder"] ?? "";
+ set => settings.Values["DefaultFolder"] = value;
+ }
+
+ public static int DownloadLimit
+ {
+ get => (int?)settings.Values["DownloadLimit"] ?? 0;
+ set => settings.Values["DownloadLimit"] = value;
+ }
+ public static int UploadLimit
+ {
+ get => (int?)settings.Values["UploadLimit"] ?? 0;
+ set => settings.Values["UploadLimit"] = value;
+ }
+
+ public static bool PromptReview
+ {
+ get => (bool?)settings.Values["PromptReview"] ?? Metrics.Uptime.TotalHours > 24;
+ set => settings.Values["PromptReview"] = value;
+ }
+ public static bool PromptFeedback
+ {
+ get => (bool?)settings.Values["PromptFeedback"] ?? Metrics.Uptime.TotalHours > 12;
+ set => settings.Values["PromptFeedback"] = value;
+ }
+ public static int Theme
+ {
+ get => (int?)settings.Values["PreferedUITheme"] ?? 2; //System
+ set => settings.Values["PreferedUITheme"] = value;
+ }
+
+ public static async Task GetDefaultFolder()
+ {
+ if (string.IsNullOrWhiteSpace(DefaultFolder))
+ return await DownloadsFolder.CreateFolderAsync(Package.Current.DisplayName, CreationCollisionOption.OpenIfExists);
+ else
+ return await StorageApplicationPermissions.FutureAccessList.GetFolderAsync(DefaultFolder);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Wintor/WinTorrent/Utils/TorrentClient.cs b/Wintor/WinTorrent/Utils/TorrentClient.cs
new file mode 100644
index 0000000..dc96393
--- /dev/null
+++ b/Wintor/WinTorrent/Utils/TorrentClient.cs
@@ -0,0 +1,140 @@
+using System;
+using System.Collections.Generic;
+using WinTorrent.Models;
+
+namespace WinTorrent.Utils
+{
+ public delegate void TorrentStateChangedEventHandler(TorrentItem sender, TorrentState previousState);
+
+ public static class TorrentClient
+ {
+ public static event TorrentStateChangedEventHandler TorrentItemStateChanged;
+
+ public static List Torrents { get; }
+
+ static TorrentClient()
+ {
+ Torrents = new List
+ {
+ new TorrentItem
+ {
+ Title = "Microsoft Edge",
+ TotalSize = new DataSize(3221225472),
+ Downloaded = new DataSize(125829120),
+ TransmissionSpeed = new DownloadSpeed(33554432),
+ RemainingTime = TimeSpan.FromSeconds(36),
+ State = TorrentState.Downloading,
+ SeedCount = 15
+ },
+ new TorrentItem
+ {
+ Title = "Microsoft Edge",
+ TotalSize = new DataSize(3221225472),
+ Downloaded = new DataSize(125829120),
+ TransmissionSpeed = new DownloadSpeed(33554432),
+ RemainingTime = TimeSpan.FromSeconds(36),
+ State = TorrentState.Completed,
+ SeedCount = 15
+ },
+ new TorrentItem
+ {
+ Title = "Microsoft Edge",
+ TotalSize = new DataSize(3221225472),
+ Downloaded = new DataSize(125829120),
+ TransmissionSpeed = new DownloadSpeed(33554432),
+ RemainingTime = TimeSpan.FromSeconds(36),
+ State = TorrentState.Paused,
+ SeedCount = 15
+ },
+ new TorrentItem
+ {
+ Title = "Microsoft Edge",
+ TotalSize = new DataSize(3221225472),
+ Downloaded = new DataSize(125829120),
+ TransmissionSpeed = new DownloadSpeed(33554432),
+ RemainingTime = TimeSpan.FromSeconds(36),
+ State = TorrentState.Seeding,
+ SeedCount = 15
+ },
+ new TorrentItem
+ {
+ Title = "Microsoft Edge",
+ TotalSize = new DataSize(3221225472),
+ Downloaded = new DataSize(125829120),
+ TransmissionSpeed = new DownloadSpeed(33554432),
+ RemainingTime = TimeSpan.FromSeconds(36),
+ State = TorrentState.Cancelling,
+ SeedCount = 15
+ },
+ new TorrentItem
+ {
+ Title = "Microsoft Edge",
+ TotalSize = new DataSize(3221225472),
+ Downloaded = new DataSize(125829120),
+ TransmissionSpeed = new DownloadSpeed(33554432),
+ RemainingTime = TimeSpan.FromSeconds(36),
+ State = TorrentState.Initializing,
+ SeedCount = 15
+ },
+ new TorrentItem
+ {
+ Title = "Microsoft Edge",
+ TotalSize = new DataSize(3221225472),
+ Downloaded = new DataSize(125829120),
+ TransmissionSpeed = new DownloadSpeed(33554432),
+ RemainingTime = TimeSpan.FromSeconds(36),
+ State = TorrentState.Pausing,
+ SeedCount = 15
+ },
+ new TorrentItem
+ {
+ Title = "Microsoft Edge",
+ TotalSize = new DataSize(3221225472),
+ Downloaded = new DataSize(125829120),
+ TransmissionSpeed = new DownloadSpeed(33554432),
+ RemainingTime = TimeSpan.FromSeconds(36),
+ State = TorrentState.Resuming,
+ SeedCount = 15
+ },
+ new TorrentItem
+ {
+ Title = "Microsoft Edge",
+ TotalSize = new DataSize(3221225472),
+ Downloaded = new DataSize(125829120),
+ TransmissionSpeed = new DownloadSpeed(33554432),
+ RemainingTime = TimeSpan.FromSeconds(36),
+ State = TorrentState.Error,
+ SeedCount = 15
+ }
+ };
+ }
+
+ public static void AddTorrent()
+ {
+
+ }
+
+ public static void PauseTorrent()
+ {
+
+ }
+
+ public static void CancelTorrent()
+ {
+
+ }
+
+ public static void ResumeTorrent()
+ {
+
+ }
+
+ public static void SeedTorrent()
+ {
+
+ }
+
+ public static void OnItemStateChanged(TorrentItem item, TorrentState previousState) =>
+ TorrentItemStateChanged?.Invoke(item, previousState);
+ }
+}
\ No newline at end of file
diff --git a/Wintor/WinTorrent/WinTorrent.csproj b/Wintor/WinTorrent/WinTorrent.csproj
new file mode 100644
index 0000000..7c38e01
--- /dev/null
+++ b/Wintor/WinTorrent/WinTorrent.csproj
@@ -0,0 +1,279 @@
+
+
+
+
+ 8.0
+ Debug
+ x86
+ {88F8E34F-0129-4856-A1F7-4A89DA892C9B}
+ AppContainerExe
+ Properties
+ WinTorrent
+ WinTorrent
+ en-US
+ UAP
+ 10.0.18362.0
+ 10.0.18362.0
+ 14
+ 512
+ {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ true
+ false
+
+
+ true
+ bin\x86\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ x86
+ false
+ prompt
+ true
+
+
+ bin\x86\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x86
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\ARM\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ ARM
+ false
+ prompt
+ true
+
+
+ bin\ARM\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ ARM
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\ARM64\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ ARM64
+ false
+ prompt
+ true
+ true
+
+
+ bin\ARM64\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ ARM64
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ x64
+ false
+ prompt
+ true
+
+
+ bin\x64\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x64
+ false
+ prompt
+ true
+ true
+
+
+ PackageReference
+
+
+
+ App.xaml
+
+
+ AddTorrentDialog.xaml
+
+
+
+
+
+ TorrentDetailsPage.xaml
+
+
+
+ MainPage.xaml
+
+
+
+ SettingsPage.xaml
+
+
+
+
+
+
+
+
+
+ Designer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+ 3.2.1
+
+
+ 3.2.1
+
+
+ 6.2.10
+
+
+ 10.1901.28001
+
+
+ 1.0.21
+
+
+ 12.0.3
+
+
+
+
+ Microsoft Engagement Framework
+
+
+ Visual C++ 2015 Runtime for Universal Windows Platform Apps
+
+
+
+ 14.0
+
+
+
+
\ No newline at end of file