Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / TemplateBindingExtension.cs / 1 / TemplateBindingExtension.cs
/****************************************************************************\ * * File: TemplateBindingExtension.cs * * Class for Xaml markup extension for TemplateBinds that * can be set on the nodes of the Template VisualTree. * * Copyright (C) 2005 by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System; using System.ComponentModel; using System.Windows; using System.Windows.Data; using System.Windows.Markup; namespace System.Windows { ////// Class for Xaml markup extension for TemplateBindings that /// can be set on the nodes of the Template VisualTree. /// [TypeConverter(typeof(TemplateBindingExtensionConverter))] public class TemplateBindingExtension : MarkupExtension { ////// Constructor that takes no parameters /// public TemplateBindingExtension() { } ////// Constructor that takes the resource key that this is a static reference to. /// public TemplateBindingExtension( DependencyProperty property) { if (property != null) { _property = property; } else { throw new ArgumentNullException("property"); } } ////// Return an object that should be set on the targetObject's targetProperty /// for this markup extension. For TemplateBindingExtension, this is the object found in /// a resource dictionary in the current parent chain that is keyed by ResourceKey /// /// ServiceProvider that can be queried for services. ////// The object to set on this property. /// public override object ProvideValue(IServiceProvider serviceProvider) { if (Property == null) { throw new InvalidOperationException(SR.Get(SRID.MarkupExtensionProperty)); } return new TemplateBindingExpression(this); } ////// Property we are binding to /// [ConstructorArgument("property")] public DependencyProperty Property { get { return _property; } set { if (value == null) { throw new ArgumentNullException("value"); } _property = value; } } ////// ValueConverter to interpose between the source and target properties /// [DefaultValue(null)] public IValueConverter Converter { get { return _converter; } set { if (value == null) { throw new ArgumentNullException("value"); } _converter = value; } } ////// ConverterParameter we are binding to /// [DefaultValue(null)] public object ConverterParameter { get { return _parameter; } set { _parameter = value; } } private DependencyProperty _property; private IValueConverter _converter; private object _parameter; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OleServicesContext.cs
- TreeNode.cs
- XmlDataImplementation.cs
- CallbackValidator.cs
- EncodedStreamFactory.cs
- DataGridViewImageColumn.cs
- DesignerLinkAdapter.cs
- MasterPageBuildProvider.cs
- EndPoint.cs
- GridViewUpdatedEventArgs.cs
- CollectionChangeEventArgs.cs
- Italic.cs
- SystemWebCachingSectionGroup.cs
- ConfigurationStrings.cs
- PauseStoryboard.cs
- TreeNode.cs
- FileLevelControlBuilderAttribute.cs
- HashRepartitionStream.cs
- TypeUnloadedException.cs
- OdbcConnectionPoolProviderInfo.cs
- ToolboxService.cs
- PersonalizableAttribute.cs
- HideDisabledControlAdapter.cs
- AnalyzedTree.cs
- EnumerableValidator.cs
- BinaryFormatter.cs
- HiddenField.cs
- WebPartMenu.cs
- FrameworkElementAutomationPeer.cs
- FrameworkElementFactoryMarkupObject.cs
- WizardForm.cs
- ThreadExceptionEvent.cs
- IteratorDescriptor.cs
- DefaultClaimSet.cs
- ChannelBase.cs
- GPStream.cs
- HtmlTableCellCollection.cs
- Panel.cs
- OdbcUtils.cs
- SpeechAudioFormatInfo.cs
- CodeTypeDelegate.cs
- WebResourceAttribute.cs
- ContractListAdapter.cs
- InputManager.cs
- CallbackHandler.cs
- XamlParser.cs
- PiiTraceSource.cs
- SHA1Cng.cs
- WebSysDisplayNameAttribute.cs
- ProtocolImporter.cs
- unsafenativemethodsother.cs
- WorkflowElementDialog.cs
- ApplicationBuildProvider.cs
- DesignerToolboxInfo.cs
- TemplateInstanceAttribute.cs
- RouteUrlExpressionBuilder.cs
- RegexBoyerMoore.cs
- BindingContext.cs
- DeploymentSection.cs
- HyperLinkColumn.cs
- ItemsControlAutomationPeer.cs
- UserControl.cs
- RequestQueue.cs
- ProjectedWrapper.cs
- ChangeDirector.cs
- XmlLanguage.cs
- Metafile.cs
- PropertyOverridesTypeEditor.cs
- Unit.cs
- SortQuery.cs
- XmlTextReader.cs
- objectresult_tresulttype.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- Int64Converter.cs
- WindowsFormsLinkLabel.cs
- GeometryConverter.cs
- recordstate.cs
- VariableAction.cs
- XmlQueryTypeFactory.cs
- ComboBoxRenderer.cs
- ellipse.cs
- InkCanvas.cs
- EmbossBitmapEffect.cs
- TaskCanceledException.cs
- COM2EnumConverter.cs
- X509Utils.cs
- PropertyGridDesigner.cs
- AuthenticationConfig.cs
- ConfigurationSectionGroup.cs
- ApplicationException.cs
- InputMethodStateChangeEventArgs.cs
- ConnectionStringSettings.cs
- DataGridViewCellFormattingEventArgs.cs
- SqlClientFactory.cs
- Int64Storage.cs
- PageParserFilter.cs
- XmlSchemaNotation.cs
- EventData.cs
- DefaultTextStore.cs
- Rotation3DAnimationUsingKeyFrames.cs