using System.Windows; using InABox.Core; using InABox.Wpf; namespace PRSDesktop { /// /// Interaction logic for RecordSelectionDialog.xaml /// public partial class RecordSelectionDialog : ThemableWindow { public RecordSelectionDialog() { Selection = Selection.None; InitializeComponent(); CenterWindowOnScreen(); } public Selection Selection { get; set; } private void CenterWindowOnScreen() { var screenleft = Application.Current.MainWindow.Left; var screentop = Application.Current.MainWindow.Top; var screenWidth = Application.Current.MainWindow.Width; var screenHeight = Application.Current.MainWindow.Height; var windowWidth = Width; var windowHeight = Height; Left = screenleft + screenWidth / 2 - windowWidth / 2; Top = screentop + screenHeight / 2 - windowHeight / 2; } public static Selection Execute() { var form = new RecordSelectionDialog(); if (form.ShowDialog() == true) return form.Selection; return Selection.None; } private void All_Click(object sender, RoutedEventArgs e) { Selection = Selection.All; DialogResult = true; Close(); } private void Sel_Click(object sender, RoutedEventArgs e) { Selection = Selection.Selected; DialogResult = true; Close(); } } }