Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DateTimeFormatInfo.cs
- XmlName.cs
- DbConnectionStringCommon.cs
- TextBox.cs
- _Connection.cs
- JsonMessageEncoderFactory.cs
- HttpResponseInternalWrapper.cs
- CodeMemberEvent.cs
- WorkflowDispatchContext.cs
- UpDownBase.cs
- MailWebEventProvider.cs
- TextDecorationCollection.cs
- CryptoHandle.cs
- SpeechEvent.cs
- StrongNameUtility.cs
- CodeTypeMemberCollection.cs
- QilInvokeEarlyBound.cs
- CssClassPropertyAttribute.cs
- MatrixTransform.cs
- CompositeActivityValidator.cs
- SmtpDigestAuthenticationModule.cs
- SiteMapNodeItem.cs
- DataGridViewColumn.cs
- DelegateHelpers.cs
- CatalogPartCollection.cs
- IImplicitResourceProvider.cs
- EventPrivateKey.cs
- EncryptedKey.cs
- NativeMethods.cs
- FixedSOMTableRow.cs
- ADMembershipUser.cs
- SchemaTableOptionalColumn.cs
- SBCSCodePageEncoding.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- VectorAnimation.cs
- SecuritySessionFilter.cs
- Pair.cs
- ConfigXmlComment.cs
- BuildResultCache.cs
- XmlKeywords.cs
- ColumnResizeAdorner.cs
- TagPrefixCollection.cs
- SystemIcmpV6Statistics.cs
- InternalControlCollection.cs
- CompressedStack.cs
- ImageMapEventArgs.cs
- TextEditorCharacters.cs
- TrackingValidationObjectDictionary.cs
- HtmlShimManager.cs
- Invariant.cs
- DataPointer.cs
- FixedSOMFixedBlock.cs
- HandleValueEditor.cs
- DataGridViewTopRowAccessibleObject.cs
- TextServicesDisplayAttribute.cs
- TrackingStringDictionary.cs
- XmlSchemaSimpleTypeList.cs
- Aggregates.cs
- EnvelopedPkcs7.cs
- ASCIIEncoding.cs
- TransactionState.cs
- Keywords.cs
- SHA256.cs
- SecureUICommand.cs
- EncoderBestFitFallback.cs
- MarkedHighlightComponent.cs
- FileDialog_Vista.cs
- SqlClientWrapperSmiStream.cs
- FormsAuthenticationConfiguration.cs
- SqlXml.cs
- MethodImplAttribute.cs
- ProcessInputEventArgs.cs
- NameGenerator.cs
- InvalidOperationException.cs
- arc.cs
- UserControl.cs
- TransferMode.cs
- DataGridViewSelectedRowCollection.cs
- PackagingUtilities.cs
- BookmarkEventArgs.cs
- Switch.cs
- NumericExpr.cs
- RadioButton.cs
- OperatorExpressions.cs
- DbConnectionOptions.cs
- AnimationClock.cs
- RuleConditionDialog.cs
- Oid.cs
- CheckBoxStandardAdapter.cs
- SerializationEventsCache.cs
- ClientUtils.cs
- StorageScalarPropertyMapping.cs
- FileSystemWatcher.cs
- ToolStripHighContrastRenderer.cs
- BitmapVisualManager.cs
- ParameterInfo.cs
- XmlElement.cs
- SHA1Cng.cs
- UpDownBaseDesigner.cs
- PickBranchDesigner.xaml.cs