From 22e060e14aa9bfcac93e0502a288b8796995645f Mon Sep 17 00:00:00 2001 From: next-autumn Date: Sat, 8 May 2021 18:52:59 +0800 Subject: [PATCH] mvvmcross --- ProxySU.sln | 18 +++ ProxySU_Core/Views/MainWindow.xaml | 1 - ProxySuper.Core/App.cs | 18 +++ ProxySuper.Core/Properties/AssemblyInfo.cs | 36 +++++ ProxySuper.Core/ProxySuper.Core.csproj | 59 ++++++++ ProxySuper.Core/ViewModels/MainViewModel.cs | 47 ++++++ ProxySuper.Core/ViewModels/SecondViewModel.cs | 30 ++++ ProxySuper.Core/packages.config | 5 + ProxySuper.WPF/App.config | 6 + ProxySuper.WPF/App.xaml | 18 +++ ProxySuper.WPF/App.xaml.cs | 24 +++ ProxySuper.WPF/MainWindow.xaml | 34 +++++ ProxySuper.WPF/MainWindow.xaml.cs | 29 ++++ ProxySuper.WPF/MvxMetroWindow .cs | 119 +++++++++++++++ ProxySuper.WPF/Properties/AssemblyInfo.cs | 55 +++++++ .../Properties/Resources.Designer.cs | 70 +++++++++ ProxySuper.WPF/Properties/Resources.resx | 117 +++++++++++++++ .../Properties/Settings.Designer.cs | 29 ++++ ProxySuper.WPF/Properties/Settings.settings | 7 + ProxySuper.WPF/ProxySuper.WPF.csproj | 141 ++++++++++++++++++ ProxySuper.WPF/Views/MainView.xaml | 13 ++ ProxySuper.WPF/Views/MainView.xaml.cs | 28 ++++ ProxySuper.WPF/Views/SecondView.xaml | 12 ++ ProxySuper.WPF/Views/SecondView.xaml.cs | 28 ++++ ProxySuper.WPF/packages.config | 9 ++ 25 files changed, 952 insertions(+), 1 deletion(-) create mode 100644 ProxySuper.Core/App.cs create mode 100644 ProxySuper.Core/Properties/AssemblyInfo.cs create mode 100644 ProxySuper.Core/ProxySuper.Core.csproj create mode 100644 ProxySuper.Core/ViewModels/MainViewModel.cs create mode 100644 ProxySuper.Core/ViewModels/SecondViewModel.cs create mode 100644 ProxySuper.Core/packages.config create mode 100644 ProxySuper.WPF/App.config create mode 100644 ProxySuper.WPF/App.xaml create mode 100644 ProxySuper.WPF/App.xaml.cs create mode 100644 ProxySuper.WPF/MainWindow.xaml create mode 100644 ProxySuper.WPF/MainWindow.xaml.cs create mode 100644 ProxySuper.WPF/MvxMetroWindow .cs create mode 100644 ProxySuper.WPF/Properties/AssemblyInfo.cs create mode 100644 ProxySuper.WPF/Properties/Resources.Designer.cs create mode 100644 ProxySuper.WPF/Properties/Resources.resx create mode 100644 ProxySuper.WPF/Properties/Settings.Designer.cs create mode 100644 ProxySuper.WPF/Properties/Settings.settings create mode 100644 ProxySuper.WPF/ProxySuper.WPF.csproj create mode 100644 ProxySuper.WPF/Views/MainView.xaml create mode 100644 ProxySuper.WPF/Views/MainView.xaml.cs create mode 100644 ProxySuper.WPF/Views/SecondView.xaml create mode 100644 ProxySuper.WPF/Views/SecondView.xaml.cs create mode 100644 ProxySuper.WPF/packages.config diff --git a/ProxySU.sln b/ProxySU.sln index 6f38af8..b6c6063 100644 --- a/ProxySU.sln +++ b/ProxySU.sln @@ -12,6 +12,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libs", "Libs", "{CE908112-DB46-4B91-8236-9139A19D66E9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxySuper.WPF", "ProxySuper.WPF\ProxySuper.WPF.csproj", "{B083EBFD-2925-46C9-8B00-E2C1300CEBA1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxySuper.Core", "ProxySuper.Core\ProxySuper.Core.csproj", "{15779EE6-D8CA-44BF-BFE2-941E155EEF3F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -26,10 +32,22 @@ Global {B066015C-D347-4493-92F1-6556D3863996}.Debug|Any CPU.Build.0 = Debug|Any CPU {B066015C-D347-4493-92F1-6556D3863996}.Release|Any CPU.ActiveCfg = Release|Any CPU {B066015C-D347-4493-92F1-6556D3863996}.Release|Any CPU.Build.0 = Release|Any CPU + {B083EBFD-2925-46C9-8B00-E2C1300CEBA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B083EBFD-2925-46C9-8B00-E2C1300CEBA1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B083EBFD-2925-46C9-8B00-E2C1300CEBA1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B083EBFD-2925-46C9-8B00-E2C1300CEBA1}.Release|Any CPU.Build.0 = Release|Any CPU + {15779EE6-D8CA-44BF-BFE2-941E155EEF3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {15779EE6-D8CA-44BF-BFE2-941E155EEF3F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {15779EE6-D8CA-44BF-BFE2-941E155EEF3F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {15779EE6-D8CA-44BF-BFE2-941E155EEF3F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {B083EBFD-2925-46C9-8B00-E2C1300CEBA1} = {CE908112-DB46-4B91-8236-9139A19D66E9} + {15779EE6-D8CA-44BF-BFE2-941E155EEF3F} = {CE908112-DB46-4B91-8236-9139A19D66E9} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A3F3B8D6-7FED-42D9-9994-E913BD32E025} EndGlobalSection diff --git a/ProxySU_Core/Views/MainWindow.xaml b/ProxySU_Core/Views/MainWindow.xaml index 8df99fb..a047a62 100644 --- a/ProxySU_Core/Views/MainWindow.xaml +++ b/ProxySU_Core/Views/MainWindow.xaml @@ -45,7 +45,6 @@ (); + } + } +} diff --git a/ProxySuper.Core/Properties/AssemblyInfo.cs b/ProxySuper.Core/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6a26f9f --- /dev/null +++ b/ProxySuper.Core/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("ProxySuper.Core")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ProxySuper.Core")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("15779ee6-d8ca-44bf-bfe2-941e155eef3f")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ProxySuper.Core/ProxySuper.Core.csproj b/ProxySuper.Core/ProxySuper.Core.csproj new file mode 100644 index 0000000..b68f50e --- /dev/null +++ b/ProxySuper.Core/ProxySuper.Core.csproj @@ -0,0 +1,59 @@ + + + + + Debug + AnyCPU + {15779EE6-D8CA-44BF-BFE2-941E155EEF3F} + Library + Properties + ProxySuper.Core + ProxySuper.Core + v4.6.1 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\MvvmCross.7.1.2\lib\net461\MvvmCross.dll + + + + ..\packages\System.Console.4.3.1\lib\net46\System.Console.dll + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ProxySuper.Core/ViewModels/MainViewModel.cs b/ProxySuper.Core/ViewModels/MainViewModel.cs new file mode 100644 index 0000000..728263d --- /dev/null +++ b/ProxySuper.Core/ViewModels/MainViewModel.cs @@ -0,0 +1,47 @@ +using MvvmCross.Commands; +using MvvmCross.Navigation; +using MvvmCross.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProxySuper.Core.ViewModels +{ + public class MainViewModel : MvxViewModel + { + private readonly IMvxNavigationService _navigationService; + + public MainViewModel(IMvxNavigationService navigationService) + { + _navigationService = navigationService; + } + + private int _count = 1; + + public int Count + { + get + { + return _count; + } + set + { + SetProperty(ref _count, value); + } + } + + public IMvxCommand PlusCommand => new MvxCommand(Plus); + + public void Plus() + { + this.Count++; + + if (this.Count >= 2) + { + _navigationService.Navigate(); + } + } + } +} diff --git a/ProxySuper.Core/ViewModels/SecondViewModel.cs b/ProxySuper.Core/ViewModels/SecondViewModel.cs new file mode 100644 index 0000000..d77dcf0 --- /dev/null +++ b/ProxySuper.Core/ViewModels/SecondViewModel.cs @@ -0,0 +1,30 @@ +using MvvmCross.Commands; +using MvvmCross.Navigation; +using MvvmCross.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ProxySuper.Core.ViewModels +{ + public class SecondViewModel : MvxViewModel + { + private readonly IMvxNavigationService _navigationService; + + public SecondViewModel(IMvxNavigationService navigationService) + { + _navigationService = navigationService; + } + + public string Message { get; set; } = "Hello world!"; + + public IMvxCommand BackCommand => new MvxCommand(Back); + + public void Back() + { + _navigationService.Close(this); + } + } +} diff --git a/ProxySuper.Core/packages.config b/ProxySuper.Core/packages.config new file mode 100644 index 0000000..90d5258 --- /dev/null +++ b/ProxySuper.Core/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/ProxySuper.WPF/App.config b/ProxySuper.WPF/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/ProxySuper.WPF/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ProxySuper.WPF/App.xaml b/ProxySuper.WPF/App.xaml new file mode 100644 index 0000000..7a0206e --- /dev/null +++ b/ProxySuper.WPF/App.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + diff --git a/ProxySuper.WPF/App.xaml.cs b/ProxySuper.WPF/App.xaml.cs new file mode 100644 index 0000000..7e3b001 --- /dev/null +++ b/ProxySuper.WPF/App.xaml.cs @@ -0,0 +1,24 @@ +using MvvmCross.Platforms.Wpf.Views; +using MvvmCross.Platforms.Wpf.Core; +using MvvmCross.Core; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace ProxySuper.WPF +{ + /// + /// App.xaml 的交互逻辑 + /// + public partial class App : MvxApplication + { + protected override void RegisterSetup() + { + this.RegisterSetupType>(); + } + } +} diff --git a/ProxySuper.WPF/MainWindow.xaml b/ProxySuper.WPF/MainWindow.xaml new file mode 100644 index 0000000..6a6bc9e --- /dev/null +++ b/ProxySuper.WPF/MainWindow.xaml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/ProxySuper.WPF/MainWindow.xaml.cs b/ProxySuper.WPF/MainWindow.xaml.cs new file mode 100644 index 0000000..f96e441 --- /dev/null +++ b/ProxySuper.WPF/MainWindow.xaml.cs @@ -0,0 +1,29 @@ +using MvvmCross.Platforms.Wpf.Views; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace ProxySuper.WPF +{ + /// + /// MainWindow.xaml 的交互逻辑 + /// + public partial class MainWindow : MvxMetroWindow + { + public MainWindow() + { + InitializeComponent(); + } + } +} diff --git a/ProxySuper.WPF/MvxMetroWindow .cs b/ProxySuper.WPF/MvxMetroWindow .cs new file mode 100644 index 0000000..d36c5e2 --- /dev/null +++ b/ProxySuper.WPF/MvxMetroWindow .cs @@ -0,0 +1,119 @@ +using System; +using System.Windows; +using MahApps.Metro.Controls; +using MvvmCross; +using MvvmCross.Binding.BindingContext; +using MvvmCross.Platforms.Wpf.Views; +using MvvmCross.ViewModels; + +namespace ProxySuper.WPF +{ + public class MvxMetroWindow : MetroWindow, IMvxWindow, IMvxWpfView, IDisposable + { + private IMvxViewModel _viewModel; + private IMvxBindingContext _bindingContext; + private bool _unloaded = false; + + public IMvxViewModel ViewModel + { + get => _viewModel; + set + { + _viewModel = value; + DataContext = value; + BindingContext.DataContext = value; + } + } + + public string Identifier { get; set; } + + public IMvxBindingContext BindingContext + { + get + { + if (_bindingContext != null) + return _bindingContext; + + if (Mvx.IoCProvider != null) + this.CreateBindingContext(); + + return _bindingContext; + } + set => _bindingContext = value; + } + + public MvxMetroWindow() + { + Closed += MvxWindow_Closed; + Unloaded += MvxWindow_Unloaded; + Loaded += MvxWindow_Loaded; + Initialized += MvxWindow_Initialized; + } + + private void MvxWindow_Initialized(object sender, EventArgs e) + { + if (this == Application.Current.MainWindow) + { + (Application.Current as MvvmCross.Platforms.Wpf.Views.MvxApplication).ApplicationInitialized(); + } + } + + private void MvxWindow_Closed(object sender, EventArgs e) => Unload(); + + private void MvxWindow_Unloaded(object sender, RoutedEventArgs e) => Unload(); + + private void MvxWindow_Loaded(object sender, RoutedEventArgs e) + { + ViewModel?.ViewAppearing(); + ViewModel?.ViewAppeared(); + } + + private void Unload() + { + if (!_unloaded) + { + ViewModel?.ViewDisappearing(); + ViewModel?.ViewDisappeared(); + ViewModel?.ViewDestroy(); + _unloaded = true; + } + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + ~MvxMetroWindow() + { + Dispose(false); + } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + Unloaded -= MvxWindow_Unloaded; + Loaded -= MvxWindow_Loaded; + Closed -= MvxWindow_Closed; + } + } + } + + public class MvxWindow : MvxWindow, IMvxWpfView + where TViewModel : class, IMvxViewModel + { + public new TViewModel ViewModel + { + get { return (TViewModel)base.ViewModel; } + set { base.ViewModel = value; } + } + + public MvxFluentBindingDescriptionSet, TViewModel> CreateBindingSet() + { + return this.CreateBindingSet, TViewModel>(); + } + } +} + diff --git a/ProxySuper.WPF/Properties/AssemblyInfo.cs b/ProxySuper.WPF/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1894aa9 --- /dev/null +++ b/ProxySuper.WPF/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("ProxySuper.WPF")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ProxySuper.WPF")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +//若要开始生成可本地化的应用程序,请设置 +//.csproj 文件中的 CultureYouAreCodingWith +//例如,如果您在源文件中使用的是美国英语, +//使用的是美国英语,请将 设置为 en-US。 然后取消 +//对以下 NeutralResourceLanguage 特性的注释。 更新 +//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //主题特定资源词典所处位置 + //(未在页面中找到资源时使用, + //或应用程序资源字典中找到时使用) + ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 + //(未在页面中找到资源时使用, + //、应用程序或任何主题专用资源字典中找到时使用) +)] + + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 +//通过使用 "*",如下所示: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ProxySuper.WPF/Properties/Resources.Designer.cs b/ProxySuper.WPF/Properties/Resources.Designer.cs new file mode 100644 index 0000000..8dede1c --- /dev/null +++ b/ProxySuper.WPF/Properties/Resources.Designer.cs @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本: 4.0.30319.42000 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + + +namespace ProxySuper.WPF.Properties +{ + /// + /// 强类型资源类,用于查找本地化字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// 返回此类使用的缓存 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ProxySuper.WPF.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 重写当前线程的 CurrentUICulture 属性,对 + /// 使用此强类型资源类的所有资源查找执行重写。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/ProxySuper.WPF/Properties/Resources.resx b/ProxySuper.WPF/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/ProxySuper.WPF/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ProxySuper.WPF/Properties/Settings.Designer.cs b/ProxySuper.WPF/Properties/Settings.Designer.cs new file mode 100644 index 0000000..df66621 --- /dev/null +++ b/ProxySuper.WPF/Properties/Settings.Designer.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + +namespace ProxySuper.WPF.Properties +{ + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/ProxySuper.WPF/Properties/Settings.settings b/ProxySuper.WPF/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/ProxySuper.WPF/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/ProxySuper.WPF/ProxySuper.WPF.csproj b/ProxySuper.WPF/ProxySuper.WPF.csproj new file mode 100644 index 0000000..24ba0cf --- /dev/null +++ b/ProxySuper.WPF/ProxySuper.WPF.csproj @@ -0,0 +1,141 @@ + + + + + Debug + AnyCPU + {B083EBFD-2925-46C9-8B00-E2C1300CEBA1} + WinExe + ProxySuper.WPF + ProxySuper.WPF + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\ControlzEx.4.4.0\lib\net45\ControlzEx.dll + + + ..\packages\MahApps.Metro.2.4.5\lib\net46\MahApps.Metro.dll + + + ..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.19\lib\net45\Microsoft.Xaml.Behaviors.dll + + + ..\packages\MvvmCross.7.1.2\lib\net461\MvvmCross.dll + + + ..\packages\MvvmCross.Platforms.Wpf.7.1.2\lib\net461\MvvmCross.Platforms.Wpf.dll + + + + + + ..\packages\System.Console.4.3.1\lib\net46\System.Console.dll + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + + MainView.xaml + + + SecondView.xaml + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + {15779ee6-d8ca-44bf-bfe2-941e155eef3f} + ProxySuper.Core + + + + \ No newline at end of file diff --git a/ProxySuper.WPF/Views/MainView.xaml b/ProxySuper.WPF/Views/MainView.xaml new file mode 100644 index 0000000..f7e0e0d --- /dev/null +++ b/ProxySuper.WPF/Views/MainView.xaml @@ -0,0 +1,13 @@ + + + + + + diff --git a/ProxySuper.WPF/Views/MainView.xaml.cs b/ProxySuper.WPF/Views/MainView.xaml.cs new file mode 100644 index 0000000..3269c09 --- /dev/null +++ b/ProxySuper.WPF/Views/MainView.xaml.cs @@ -0,0 +1,28 @@ +using MvvmCross.Platforms.Wpf.Views; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace ProxySuper.WPF.Views +{ + /// + /// MainView.xaml 的交互逻辑 + /// + public partial class MainView : MvxWpfView + { + public MainView() + { + InitializeComponent(); + } + } +} diff --git a/ProxySuper.WPF/Views/SecondView.xaml b/ProxySuper.WPF/Views/SecondView.xaml new file mode 100644 index 0000000..cb503bd --- /dev/null +++ b/ProxySuper.WPF/Views/SecondView.xaml @@ -0,0 +1,12 @@ + + + + + + diff --git a/ProxySuper.WPF/Views/SecondView.xaml.cs b/ProxySuper.WPF/Views/SecondView.xaml.cs new file mode 100644 index 0000000..abfca03 --- /dev/null +++ b/ProxySuper.WPF/Views/SecondView.xaml.cs @@ -0,0 +1,28 @@ +using MvvmCross.Platforms.Wpf.Views; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace ProxySuper.WPF.Views +{ + /// + /// SecondView.xaml 的交互逻辑 + /// + public partial class SecondView : MvxMetroWindow + { + public SecondView() + { + InitializeComponent(); + } + } +} diff --git a/ProxySuper.WPF/packages.config b/ProxySuper.WPF/packages.config new file mode 100644 index 0000000..cbb419c --- /dev/null +++ b/ProxySuper.WPF/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file