lucianb

ControlWindow

Jan 8th, 2023
960
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. public partial class ControlWindow : Window
  2.     {
  3.         private double testValue = 12;
  4.  
  5.         public ControlWindow()
  6.         {
  7.             InitializeComponent();
  8.  
  9.             var testBox = new LabeledNumberInputBox("Время", 0, 24, (double newValue) => {
  10.                 this.testValue = newValue;
  11.                 this.Title = newValue.ToString();
  12.             }, testValue);
  13.  
  14.             Grid.SetColumn(testBox, 0);
  15.             controlPanel.Children.Add(testBox);
  16.         }
  17.  
  18.         public void UpdateButtonClickHandler(object sender, RoutedEventArgs e)
  19.         {
  20.             // Debug.WriteLine("Update requested");
  21.  
  22.             var mainWindow = new MainWindow();
  23.             mainWindow.DataHandler(this.testValue);
  24.         }
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment