|
// -- FILE ------------------------------------------------------------------
// name : DerivedSettingsWindow.cs
// created : Jani Giannoudis - 2008.04.30
// language : c#
// environment: .NET 3.0
// --------------------------------------------------------------------------
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using Itenso.Configuration;
namespace Itenso.Solutions.Community.ConfigurationWindowsDemo
{
// ------------------------------------------------------------------------
public partial class DerivedSettingsWindow : BaseWindow
{
// ----------------------------------------------------------------------
public DerivedSettingsWindow()
{
// save all window textbox values to the settings using the class property
WindowSettings.SettingCollectors.Add(
new PropertySettingCollector(
this, // owner
typeof( TextBox ), // element type
"Text" ) ); // element property
// save all window cehckbox values to the settings using the dependency property
WindowSettings.SettingCollectors.Add(
new DependencyPropertySettingCollector(
this, // owner
ToggleButton.IsCheckedProperty ) ); // dependency property
InitializeComponent();
} // DerivedSettingsWindow
// ----------------------------------------------------------------------
protected override void OnCollectingSetting( SettingCollectorCancelEventArgs e )
{
FrameworkElement frameworkElement = e.Element as FrameworkElement;
if ( frameworkElement == null )
{
return;
}
// exclusion rules
if ( Option3.Name.Equals( frameworkElement.Name ) || Edit3.Name.Equals( frameworkElement.Name ) )
{
e.Cancel = true;
}
} // OnCollectingSetting
} // class DerivedSettingsWindow
} // namespace Itenso.Solutions.Community.ConfigurationWindowsDemo
// -- EOF -------------------------------------------------------------------
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
👨 Senior .NET Software Engineer
🚀 My Open Source Projects
-
Time Period Library 👉
GitHub
-
Payroll Engine 👉
GitHub
Feedback and contributions are welcome.