Example #1
0
        void Save()
        {
            NameField.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            CityField.GetBindingExpression(TextBox.TextProperty).UpdateSource();

            var publisherCollection = (Application.Current as App).LibraryData.Publishers;

            if (impactType == ImpactType.Save)
            {
                if (!publisherCollection.Contains <Publisher>(impact))
                {
                    (Application.Current as App).LibraryData.Publishers.Add(impact);
                }
                else
                {
                    MessageBox.Show("The publisher is already added", "Error",
                                    MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }