Пример #1
0
        /// <summary>
        /// Property Changed Callback method of the ValueType Dependency Property.
        /// </summary>
        /// <param name="sender">The instance of the class that had the ValueType property changed.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void OnValueTypeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            SettingBase subject  = (SettingBase)sender;
            Type        newValue = (Type)e.NewValue;
            Type        oldValue = (Type)e.OldValue;

            if (subject.Owner != null)
            {
                subject.Owner.SettingsFile.AddValueType(newValue);
            }
        }
Пример #2
0
        /// <summary>
        /// Property Changed Callback method of the Owner Dependency Property.
        /// </summary>
        /// <param name="sender">The instance of the class that had the Owner property changed.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void OnOwnerChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            SettingBase       subject  = (SettingBase)sender;
            SettingCollection newValue = (SettingCollection)e.NewValue;
            SettingCollection oldValue = (SettingCollection)e.OldValue;

            if (newValue != null && subject.ValueType != null)
            {
                newValue.SettingsFile.AddValueType(subject.ValueType);
            }
        }