Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- Identifier.cs
- PreApplicationStartMethodAttribute.cs
- SystemIPGlobalStatistics.cs
- ColumnClickEvent.cs
- MatrixTransform.cs
- VersionedStreamOwner.cs
- XmlC14NWriter.cs
- AxHostDesigner.cs
- CatalogPart.cs
- BasicCellRelation.cs
- StylusPointProperties.cs
- CodeGenerator.cs
- autovalidator.cs
- SqlDependency.cs
- Parameter.cs
- EntitySetRetriever.cs
- ErrorStyle.cs
- TextEditor.cs
- _AutoWebProxyScriptEngine.cs
- PhonemeConverter.cs
- GACMembershipCondition.cs
- ByteStreamGeometryContext.cs
- QuaternionRotation3D.cs
- WrappingXamlSchemaContext.cs
- RawAppCommandInputReport.cs
- AttachedAnnotationChangedEventArgs.cs
- RouteCollection.cs
- CapabilitiesSection.cs
- ImportDesigner.xaml.cs
- ObjectSet.cs
- SectionInput.cs
- TextDecorations.cs
- DbMetaDataFactory.cs
- DecimalAnimation.cs
- WebPartMinimizeVerb.cs
- UriParserTemplates.cs
- LayoutManager.cs
- XmlSchemaIdentityConstraint.cs
- KeyInfo.cs
- DataGridRowsPresenter.cs
- ButtonRenderer.cs
- TextEmbeddedObject.cs
- XmlSchemaValidator.cs
- WindowsIdentity.cs
- GridViewRowCollection.cs
- DeflateStream.cs
- HtmlTextArea.cs
- StoryFragments.cs
- StylusPointDescription.cs
- ParserContext.cs
- AsymmetricKeyExchangeDeformatter.cs
- HasCopySemanticsAttribute.cs
- CombinedGeometry.cs
- HtmlContainerControl.cs
- FragmentNavigationEventArgs.cs
- ZipIOExtraFieldPaddingElement.cs
- DataGridCell.cs
- SafeEventLogReadHandle.cs
- NewArrayExpression.cs
- HttpCapabilitiesEvaluator.cs
- SoapIncludeAttribute.cs
- RouteData.cs
- Accessible.cs
- CodeNamespaceCollection.cs
- TemplateBindingExpressionConverter.cs
- ReferencedAssemblyResolver.cs
- DataColumnPropertyDescriptor.cs
- DefaultPrintController.cs
- IItemContainerGenerator.cs
- UIElement.cs
- ComplexTypeEmitter.cs
- HttpDateParse.cs
- StatusBarItem.cs
- ConfigXmlCDataSection.cs
- DesignerSerializerAttribute.cs
- GraphicsContainer.cs
- DesignerView.Commands.cs
- AuthorizationRule.cs
- SecurityState.cs
- StructuredProperty.cs
- XpsResourcePolicy.cs
- RelatedView.cs
- MappingMetadataHelper.cs
- CmsInterop.cs
- NTAccount.cs
- HierarchicalDataBoundControl.cs
- SignHashRequest.cs
- ResolveMatches11.cs
- MenuBase.cs
- EditorPart.cs
- PolygonHotSpot.cs
- odbcmetadatacolumnnames.cs
- DateTimeOffset.cs
- XmlLinkedNode.cs
- TimeSpanFormat.cs
- PackageDigitalSignatureManager.cs
- EntityWrapper.cs
- AppDomainFactory.cs
- StatusBar.cs
- WmlFormAdapter.cs