2021-05-14 14:07:19 +03:00
|
|
|
|
using MvvmCross;
|
|
|
|
|
using MvvmCross.Navigation;
|
|
|
|
|
using MvvmCross.Platforms.Wpf.Views;
|
|
|
|
|
using ProxySuper.Core.Models;
|
|
|
|
|
using ProxySuper.Core.ViewModels;
|
2021-05-16 11:29:37 +03:00
|
|
|
|
using System;
|
2021-05-14 14:07:19 +03:00
|
|
|
|
using System.Windows;
|
|
|
|
|
|
|
|
|
|
namespace ProxySuper.WPF.Views
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// HomeView.xaml 的交互逻辑
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class HomeView : MvxWpfView
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public HomeView()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-16 11:29:37 +03:00
|
|
|
|
private IMvxNavigationService _navigationService;
|
|
|
|
|
|
|
|
|
|
public IMvxNavigationService NavigationService
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (_navigationService == null)
|
|
|
|
|
{
|
|
|
|
|
_navigationService = Mvx.IoCProvider.Resolve<IMvxNavigationService>();
|
|
|
|
|
}
|
|
|
|
|
return _navigationService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-20 13:32:17 +03:00
|
|
|
|
public new HomeViewModel ViewModel
|
2021-05-16 11:29:37 +03:00
|
|
|
|
{
|
2021-05-20 13:32:17 +03:00
|
|
|
|
get { return (HomeViewModel)base.ViewModel; }
|
2021-05-16 11:29:37 +03:00
|
|
|
|
}
|
|
|
|
|
|
2021-05-14 14:07:19 +03:00
|
|
|
|
private void LaunchGitHubSite(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
System.Diagnostics.Process.Start("explorer.exe", "https://github.com/proxysu/ProxySU");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void NavToEditor(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2021-05-20 13:32:17 +03:00
|
|
|
|
NavigationService.Navigate<XrayEditorViewModel, Record, Record>(ViewModel.Records[0]);
|
2021-05-16 11:29:37 +03:00
|
|
|
|
}
|
2021-05-14 14:07:19 +03:00
|
|
|
|
|
2021-05-16 11:29:37 +03:00
|
|
|
|
protected override void Dispose(bool disposing)
|
|
|
|
|
{
|
2021-05-20 13:32:17 +03:00
|
|
|
|
ViewModel.SaveRecords();
|
2021-05-16 11:29:37 +03:00
|
|
|
|
base.Dispose(disposing);
|
2021-05-14 14:07:19 +03:00
|
|
|
|
}
|
2021-05-16 11:29:37 +03:00
|
|
|
|
|
2021-05-14 14:07:19 +03:00
|
|
|
|
}
|
|
|
|
|
}
|