Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / TemplateBindingExtension.cs / 1305600 / 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))] [MarkupExtensionReturnType(typeof(Object))] 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. /****************************************************************************\ * * 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))] [MarkupExtensionReturnType(typeof(Object))] 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
- SessionStateContainer.cs
- ImageList.cs
- HostExecutionContextManager.cs
- ReadOnlyCollection.cs
- XmlNamespaceMapping.cs
- TypeFieldSchema.cs
- DateTimeFormat.cs
- DataGridTable.cs
- ObsoleteAttribute.cs
- TextOutput.cs
- GPRECTF.cs
- XmlTextWriter.cs
- XmlSerializer.cs
- TemplatePropertyEntry.cs
- ConfigPathUtility.cs
- CodeSnippetExpression.cs
- DataStorage.cs
- PointCollectionConverter.cs
- DataGridViewRowStateChangedEventArgs.cs
- PagerSettings.cs
- MissingFieldException.cs
- BoundingRectTracker.cs
- DataGridViewDataErrorEventArgs.cs
- SqlDesignerDataSourceView.cs
- WindowsTitleBar.cs
- DependencyProperty.cs
- HtmlTitle.cs
- PublisherMembershipCondition.cs
- TimeoutValidationAttribute.cs
- NewExpression.cs
- ValidatorCollection.cs
- ObfuscationAttribute.cs
- CodeSubDirectory.cs
- HitTestDrawingContextWalker.cs
- ZoneLinkButton.cs
- TextEndOfLine.cs
- WebConfigManager.cs
- DesignTimeHTMLTextWriter.cs
- FormsAuthenticationUserCollection.cs
- ServicePointManager.cs
- CodeMethodReturnStatement.cs
- OdbcInfoMessageEvent.cs
- ConstructorExpr.cs
- SizeAnimationUsingKeyFrames.cs
- CommandSet.cs
- ProgressBarBrushConverter.cs
- ButtonField.cs
- XmlAttribute.cs
- EventSinkActivityDesigner.cs
- AppDomain.cs
- BevelBitmapEffect.cs
- CatalogPartCollection.cs
- FrameworkElement.cs
- BrowserDefinitionCollection.cs
- SecurityKeyIdentifierClause.cs
- IERequestCache.cs
- BitmapEffectRenderDataResource.cs
- XmlConvert.cs
- SqlNode.cs
- PersonalizablePropertyEntry.cs
- RegexBoyerMoore.cs
- MeshGeometry3D.cs
- ObjectParameter.cs
- Compilation.cs
- FormViewPagerRow.cs
- SqlCacheDependencySection.cs
- LinqDataSourceInsertEventArgs.cs
- sqlpipe.cs
- JoinSymbol.cs
- XamlToRtfWriter.cs
- QuaternionAnimation.cs
- FileDataSourceCache.cs
- RemotingConfiguration.cs
- ChannelFactoryRefCache.cs
- WindowsIPAddress.cs
- InputMethod.cs
- EncryptedReference.cs
- SourceSwitch.cs
- WebPartCloseVerb.cs
- FontNamesConverter.cs
- COM2PropertyBuilderUITypeEditor.cs
- DecoratedNameAttribute.cs
- PointConverter.cs
- WeakKeyDictionary.cs
- DataGridViewTextBoxColumn.cs
- SmtpException.cs
- CreateSequence.cs
- GeneralTransform3DTo2DTo3D.cs
- DataAdapter.cs
- BooleanStorage.cs
- ToolStripSeparatorRenderEventArgs.cs
- ToolStripItemRenderEventArgs.cs
- SmiXetterAccessMap.cs
- ConfigViewGenerator.cs
- VirtualDirectoryMapping.cs
- OleDbPropertySetGuid.cs
- CompilationSection.cs
- ScrollProviderWrapper.cs
- ComponentManagerBroker.cs
- DbMetaDataCollectionNames.cs