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
- RecordManager.cs
- DbParameterCollection.cs
- PackageRelationshipSelector.cs
- RegexCode.cs
- StylusEditingBehavior.cs
- FormsIdentity.cs
- DocumentPage.cs
- ToolStripContainer.cs
- ToolboxSnapDragDropEventArgs.cs
- EntryPointNotFoundException.cs
- TrustSection.cs
- RenderingEventArgs.cs
- SubMenuStyleCollectionEditor.cs
- _AutoWebProxyScriptEngine.cs
- CommandHelper.cs
- Polygon.cs
- WebPartUtil.cs
- RuntimeVariablesExpression.cs
- EventLogPermissionHolder.cs
- DeflateStream.cs
- XPathParser.cs
- XmlSchemaSimpleContent.cs
- SingletonConnectionReader.cs
- TerminatorSinks.cs
- Stylesheet.cs
- HttpModuleCollection.cs
- X500Name.cs
- DelegatedStream.cs
- SparseMemoryStream.cs
- ErrorWebPart.cs
- RectKeyFrameCollection.cs
- Rectangle.cs
- PeerEndPoint.cs
- SchemaNames.cs
- CustomTokenProvider.cs
- CodeNamespaceImport.cs
- ThreadStaticAttribute.cs
- ProxyGenerationError.cs
- ExpressionBindingCollection.cs
- OleDbParameterCollection.cs
- HostingEnvironment.cs
- ActivityStateQuery.cs
- Point3DCollection.cs
- SchemaSetCompiler.cs
- SuppressedPackageProperties.cs
- Hex.cs
- XhtmlConformanceSection.cs
- PackagePartCollection.cs
- LinqDataSourceUpdateEventArgs.cs
- HandlerFactoryCache.cs
- PropertyPath.cs
- Transform3DGroup.cs
- GZipDecoder.cs
- FilteredSchemaElementLookUpTable.cs
- ActiveDocumentEvent.cs
- ResourceDescriptionAttribute.cs
- MethodRental.cs
- XsdBuilder.cs
- HexParser.cs
- PasswordRecovery.cs
- WorkflowViewStateService.cs
- Attributes.cs
- webbrowsersite.cs
- SystemIcmpV6Statistics.cs
- OleDbRowUpdatedEvent.cs
- DefaultExpression.cs
- Quaternion.cs
- PaginationProgressEventArgs.cs
- PropertyOverridesDialog.cs
- RuleSetCollection.cs
- Operator.cs
- XDRSchema.cs
- ClientFormsIdentity.cs
- SelectorAutomationPeer.cs
- ServiceHostingEnvironment.cs
- TerminateDesigner.cs
- AnalyzedTree.cs
- ResourceDescriptionAttribute.cs
- EventPropertyMap.cs
- TextEditorDragDrop.cs
- Comparer.cs
- ApplicationCommands.cs
- SizeAnimationUsingKeyFrames.cs
- StorageEntitySetMapping.cs
- MouseButton.cs
- StackSpiller.Bindings.cs
- CodeDelegateInvokeExpression.cs
- TypeConverterBase.cs
- Point3DCollection.cs
- TableCellAutomationPeer.cs
- CloudCollection.cs
- BasePattern.cs
- PermissionSetEnumerator.cs
- DesignerActionList.cs
- StatusBarItem.cs
- DmlSqlGenerator.cs
- UIElementIsland.cs
- Variant.cs
- HandlerWithFactory.cs
- HMACSHA384.cs