| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Shapes;
-
- namespace WpfApplication19
- {
- /// <summary>
- /// Interaction logic for EditMIDWindow.xaml
- /// </summary>
- public partial class EditMIDWindow : Window
- {
- public EditMIDWindow()
- {
- InitializeComponent();
- var w = (MainWindow)Application.Current.MainWindow;
- grainSizeInput.Text = w.midGS;
- }
-
- private void saveBtn_Click(object sender, RoutedEventArgs e)
- {
- var w = (MainWindow)Application.Current.MainWindow;
- w.midGS = grainSizeInput.Text;
- this.Close();
- }
-
- private void grainSizeInput_PreviewKeyDown(object sender, KeyEventArgs e)
- {
- if( (e.Key >= Key.D0 && e.Key <= Key.D9) || e.Key == Key.Next || e.Key == Key.Back || e.Key == Key.Delete || e.Key == Key.Left || e.Key == Key.Right)
- e.Handled = false;
- else e.Handled = true;
- }
-
-
-
- }
- }
|