public MainWindow(LiftClass lift) { InitializeComponent(); this.lift = lift; imgDorsOpend.Source = new BitmapImage(new Uri("../Images/dors_opend.jpg", UriKind.RelativeOrAbsolute)); imgDorsClosed.Source = new BitmapImage(new Uri("../Images/dors_closed.jpg", UriKind.RelativeOrAbsolute)); AddFloors(lift.maxFloor); AddButtons(lift.maxFloor); var d = lift.maxFloor - 1; Canvas.SetTop(imLift, 10 + (d * Properties.Settings.Default.FloorHeight + 5 * d)); }
private void btnOk_Click(object sender, RoutedEventArgs e) { byte floorsCount; double speedOneFloor; double dorsTime; Byte.TryParse(InputFloors.Text, out floorsCount); Double.TryParse(InputTimeFloor.Text.Replace(".", ","), out speedOneFloor); Double.TryParse(InputTimeDors.Text.Replace(".", ","), out dorsTime); var lift = new LiftClass("ottis", 600, 1, floorsCount, speedOneFloor, dorsTime); MainWindow main = new MainWindow(lift); main.Show(); this.Close(); }