private void btnAddMeasure_Click(object sender, RoutedEventArgs e) { CategorysManager mc=new CategorysManager(); ProductMeasure m = new ProductMeasure { ProMeasureType = MeasureTxtBox.Text, ProMeasureUnit = DescriptionTxtBox.Text }; mc.AddMeasure(m); // CategorysManager.NewestMeasure = m; DialogResult = true; Close(); }