Files
MesenCE/UI/Windows/NetplayStartServerWindow.axaml.cs
SourMesen 40335ce735 UI: Update to Avalonia 12, .NET 10 and replace ReactiveUI with MVVM community toolkit (#142)
Also fixes DX11.0 support (for Win7 PCs that aren't fully updated), which stopped working after the recent variable refresh rate changes
2026-07-03 16:04:42 +09:00

40 lines
775 B
C#

using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Mesen.Config;
using Mesen.Interop;
using Mesen.ViewModels;
using System.Collections.Generic;
namespace Mesen.Windows
{
public class NetplayStartServerWindow : MesenWindow
{
public NetplayStartServerWindow()
{
InitializeComponent();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
private void Ok_OnClick(object sender, RoutedEventArgs e)
{
NetplayConfig cfg = (NetplayConfig)DataContext!;
ConfigManager.Config.Netplay = cfg.Clone();
Close(true);
NetplayApi.StartServer(cfg.ServerPort, cfg.ServerPassword);
}
private void Cancel_OnClick(object sender, RoutedEventArgs e)
{
Close(false);
}
}
}