mirror of
https://github.com/hawkeye-stan/msfs-popout-panel-manager.git
synced 2024-11-22 05:40:11 +00:00
43caff1ca9
commit 2bbda3c4e4969fdf05566908fde01f1c9e4e23f7 Author: Stanley <hawkeyesk@outlook.com> Date: Mon Sep 5 23:54:39 2022 -0400 Added in-game panel support commit ec29b0ec2612b10e45ab9a73c10b88a98fcf6eaf Author: Stanley <hawkeyesk@outlook.com> Date: Sun Sep 4 21:21:37 2022 -0400 Added in-game panel support commit 97edc184f349e1fde74a15a643fb90fb9bd90395 Author: Stanley <hawkeyesk@outlook.com> Date: Thu Sep 1 18:08:44 2022 -0400 Update touch panel commit da48ca0a272290466952c5c1bd1ca035d56f930c Author: Stanley <hawkeyesk@outlook.com> Date: Mon Aug 29 22:19:38 2022 -0400 Added pop out panel temporary display commit 701346193804f93616b0e6e2222d9d55223f516f Author: Stanley <hawkeyesk@outlook.com> Date: Wed Aug 24 10:33:59 2022 -0400 Added auto resize window display mode commit 98cbcd949f1555b44db22267ce5c54858bef47cd Author: Stanley <hawkeyesk@outlook.com> Date: Wed Aug 24 09:39:38 2022 -0400 Added auto resize window display mode
75 lines
2.5 KiB
C#
75 lines
2.5 KiB
C#
using MSFSPopoutPanelManager.UserDataAgent;
|
|
using System.Collections.Generic;
|
|
using System.Windows;
|
|
|
|
namespace MSFSPopoutPanelManager.WpfApp.ViewModel
|
|
{
|
|
internal class DialogHelper
|
|
{
|
|
public static bool ConfirmDialog(string title, string message)
|
|
{
|
|
var dialog = new ConfirmationDialog(title, message);
|
|
dialog.Owner = Application.Current.MainWindow;
|
|
dialog.Topmost = true;
|
|
dialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
|
|
|
return (bool)dialog.ShowDialog();
|
|
}
|
|
|
|
public static bool ConfirmDialog(string title, string message, Window owner)
|
|
{
|
|
var dialog = new ConfirmationDialog(title, message);
|
|
dialog.Owner = owner;
|
|
dialog.Topmost = true;
|
|
dialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
|
|
|
return (bool)dialog.ShowDialog();
|
|
}
|
|
|
|
public static AddProfileDialogResult AddProfileDialog(List<Profile> profiles)
|
|
{
|
|
var dialog = new AddProfileDialog(profiles);
|
|
dialog.Owner = Application.Current.MainWindow;
|
|
dialog.Topmost = true;
|
|
dialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
|
|
|
if ((bool)dialog.ShowDialog())
|
|
{
|
|
return new AddProfileDialogResult(dialog.ProfileName, dialog.SelectedCopyProfileId);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public static void PreferencesDialog(PreferencesViewModel preferencesViewModel)
|
|
{
|
|
var dialog = new PreferencesDialog(preferencesViewModel);
|
|
dialog.Owner = Application.Current.MainWindow;
|
|
dialog.Topmost = true;
|
|
dialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
|
dialog.ShowDialog();
|
|
}
|
|
|
|
public static void PanelConfigurationInstructionDialog()
|
|
{
|
|
var dialog = new PanelConfigurationInstructionDialog();
|
|
dialog.Owner = Application.Current.MainWindow;
|
|
dialog.Topmost = true;
|
|
dialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
|
dialog.ShowDialog();
|
|
}
|
|
}
|
|
|
|
internal class AddProfileDialogResult
|
|
{
|
|
public AddProfileDialogResult(string profileName, int copyPofileId)
|
|
{
|
|
ProfileName = profileName;
|
|
CopyProfileId = copyPofileId;
|
|
}
|
|
|
|
public string ProfileName { get; set; }
|
|
|
|
public int CopyProfileId { get; set; }
|
|
}
|
|
}
|