mirror of
https://github.com/libretro/MesenCE.git
synced 2026-11-10 03:02:05 -10:00
Also fixes DX11.0 support (for Win7 PCs that aren't fully updated), which stopped working after the recent variable refresh rate changes
57 lines
1.1 KiB
C#
57 lines
1.1 KiB
C#
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Markup.Xaml;
|
|
using Mesen.Config;
|
|
using Mesen.ViewModels;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.IO;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Mesen.Windows
|
|
{
|
|
public class SelectStorageFolderWindow : MesenWindow
|
|
{
|
|
private SelectStorageFolderViewModel _model;
|
|
|
|
public SelectStorageFolderWindow()
|
|
{
|
|
_model = new SelectStorageFolderViewModel() { StoreInUserProfile = ConfigManager.HomeFolder != ConfigManager.DefaultPortableFolder };
|
|
DataContext = _model;
|
|
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
protected override void OnClosing(WindowClosingEventArgs e)
|
|
{
|
|
if(_model.IsCopying) {
|
|
e.Cancel = true;
|
|
}
|
|
base.OnClosing(e);
|
|
}
|
|
|
|
private async void StartProcess()
|
|
{
|
|
if(await _model.MigrateData()) {
|
|
Close(true);
|
|
}
|
|
}
|
|
|
|
private void Ok_OnClick(object sender, RoutedEventArgs e)
|
|
{
|
|
StartProcess();
|
|
}
|
|
|
|
private void Cancel_OnClick(object sender, RoutedEventArgs e)
|
|
{
|
|
Close(false);
|
|
}
|
|
}
|
|
}
|