Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / 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. /****************************************************************************\ * * 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
- ClientSettingsProvider.cs
- MultiByteCodec.cs
- Filter.cs
- ItemContainerGenerator.cs
- TransactionManager.cs
- SqlBuilder.cs
- PropertyPathWorker.cs
- ResizingMessageFilter.cs
- CollectionEditorDialog.cs
- TypeBuilder.cs
- DPCustomTypeDescriptor.cs
- ControlPropertyNameConverter.cs
- OdbcConnectionPoolProviderInfo.cs
- Deflater.cs
- AsymmetricKeyExchangeDeformatter.cs
- WebBrowserProgressChangedEventHandler.cs
- SharedHttpsTransportManager.cs
- DrawingContextWalker.cs
- NativeMethods.cs
- DataGridViewTopLeftHeaderCell.cs
- ToolStripSeparatorRenderEventArgs.cs
- Persist.cs
- WhiteSpaceTrimStringConverter.cs
- ConfigXmlSignificantWhitespace.cs
- CompiledRegexRunnerFactory.cs
- SHA256Managed.cs
- SAPICategories.cs
- SmtpAuthenticationManager.cs
- ListenDesigner.cs
- StringOutput.cs
- HttpCapabilitiesEvaluator.cs
- PropertyContainer.cs
- IdleTimeoutMonitor.cs
- AggregatePushdown.cs
- File.cs
- ConfigurationPropertyAttribute.cs
- COM2PropertyPageUITypeConverter.cs
- Pair.cs
- RectKeyFrameCollection.cs
- Matrix.cs
- COAUTHINFO.cs
- BindingListCollectionView.cs
- WindowsFormsSectionHandler.cs
- StatusBar.cs
- BamlWriter.cs
- TextTreeText.cs
- PersistenceTypeAttribute.cs
- EventProviderWriter.cs
- handlecollector.cs
- AttributeData.cs
- XmlName.cs
- BooleanExpr.cs
- FileEnumerator.cs
- ManagedFilter.cs
- ChannelManager.cs
- UnicastIPAddressInformationCollection.cs
- OdbcConnection.cs
- TrustSection.cs
- DataTableMappingCollection.cs
- ProjectionCamera.cs
- DaylightTime.cs
- PersistencePipeline.cs
- SecurityKeyIdentifierClause.cs
- DataStreamFromComStream.cs
- TagPrefixCollection.cs
- DesignerProperties.cs
- DataGridViewHitTestInfo.cs
- ToolStripItem.cs
- DisplayMemberTemplateSelector.cs
- Triangle.cs
- DataFormats.cs
- ErrorHandlingAcceptor.cs
- FilterQueryOptionExpression.cs
- DynamicUpdateCommand.cs
- StrongNameSignatureInformation.cs
- SqlNodeTypeOperators.cs
- RoutedEventArgs.cs
- CharacterMetrics.cs
- ApplicationServicesHostFactory.cs
- X509SecurityToken.cs
- NameObjectCollectionBase.cs
- CultureMapper.cs
- HostProtectionException.cs
- ContractCodeDomInfo.cs
- RequestSecurityTokenResponse.cs
- StringSource.cs
- RelationalExpressions.cs
- DelegatingConfigHost.cs
- WebPartEditorCancelVerb.cs
- GiveFeedbackEvent.cs
- WindowsAuthenticationEventArgs.cs
- WmlMobileTextWriter.cs
- HopperCache.cs
- WebRequestModuleElement.cs
- OdbcParameter.cs
- ResourceDescriptionAttribute.cs
- StoreContentChangedEventArgs.cs
- InternalPermissions.cs
- Evaluator.cs
- DataReaderContainer.cs