Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DesignBindingConverter.cs
- TraceFilter.cs
- ChangePasswordDesigner.cs
- TemplateParser.cs
- validation.cs
- CodeRemoveEventStatement.cs
- XmlNodeComparer.cs
- DataGridAddNewRow.cs
- ClientScriptItemCollection.cs
- AsymmetricSignatureDeformatter.cs
- BooleanAnimationUsingKeyFrames.cs
- WebControlParameterProxy.cs
- ValidationSummary.cs
- ProfileInfo.cs
- TextEmbeddedObject.cs
- CodeBlockBuilder.cs
- shaperfactory.cs
- DeflateStream.cs
- HostingEnvironmentSection.cs
- MachineKey.cs
- SerializableAttribute.cs
- StreamWithDictionary.cs
- AsyncStreamReader.cs
- VectorCollection.cs
- Activity.cs
- PasswordTextContainer.cs
- StatusCommandUI.cs
- ProfileParameter.cs
- ParserHooks.cs
- MemberDescriptor.cs
- Geometry3D.cs
- InitializingNewItemEventArgs.cs
- _StreamFramer.cs
- Int32Converter.cs
- ContentPlaceHolder.cs
- XmlImplementation.cs
- DecimalAnimationUsingKeyFrames.cs
- CompilationUnit.cs
- OleDbCommand.cs
- ManagementEventWatcher.cs
- SafeRightsManagementSessionHandle.cs
- RawStylusActions.cs
- PeerTransportElement.cs
- SqlVisitor.cs
- TypeConverterHelper.cs
- Transform3DGroup.cs
- FixedSOMTableCell.cs
- AuthenticationModulesSection.cs
- CodeBinaryOperatorExpression.cs
- XmlAttributeAttribute.cs
- ClrProviderManifest.cs
- SqlCommandSet.cs
- httpapplicationstate.cs
- TemplateApplicationHelper.cs
- control.ime.cs
- arc.cs
- MobileListItem.cs
- PageSetupDialog.cs
- SmtpSection.cs
- BidOverLoads.cs
- CachedTypeface.cs
- TreeViewAutomationPeer.cs
- WebPartZoneBase.cs
- ServiceOperationViewControl.cs
- XmlSchemaObject.cs
- FlowLayout.cs
- InputLanguageManager.cs
- ListViewCommandEventArgs.cs
- IconBitmapDecoder.cs
- XmlSchemaValidationException.cs
- HandlerBase.cs
- ExclusiveCanonicalizationTransform.cs
- QilInvokeLateBound.cs
- ColorConverter.cs
- ThreadExceptionEvent.cs
- DEREncoding.cs
- ScriptResourceInfo.cs
- MethodCallExpression.cs
- BinHexEncoder.cs
- SoapDocumentMethodAttribute.cs
- GridViewColumnCollection.cs
- EntityDataReader.cs
- MasterPageParser.cs
- CodeMethodReturnStatement.cs
- Overlapped.cs
- LocationUpdates.cs
- TextElementEnumerator.cs
- DeclaredTypeValidatorAttribute.cs
- XmlnsPrefixAttribute.cs
- DynamicDocumentPaginator.cs
- DummyDataSource.cs
- DependentList.cs
- PropertyGridEditorPart.cs
- StringStorage.cs
- Transform3DCollection.cs
- Substitution.cs
- SqlErrorCollection.cs
- TraceHandlerErrorFormatter.cs
- QfeChecker.cs
- ObservableDictionary.cs