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
- AlphabeticalEnumConverter.cs
- StaticResourceExtension.cs
- Int32.cs
- SimpleTextLine.cs
- ExtensionQuery.cs
- Monitor.cs
- PathGradientBrush.cs
- CompositeCollectionView.cs
- InstanceKeyView.cs
- DataServiceKeyAttribute.cs
- TextServicesCompartment.cs
- PaperSource.cs
- Dynamic.cs
- Profiler.cs
- XamlTemplateSerializer.cs
- ColorMatrix.cs
- XmlComment.cs
- SafeFileMappingHandle.cs
- sitestring.cs
- ResourceWriter.cs
- XpsImage.cs
- ApplicationServiceManager.cs
- JoinSymbol.cs
- BindingGraph.cs
- ComplexType.cs
- _ListenerResponseStream.cs
- ImmutableCollection.cs
- LicenseProviderAttribute.cs
- XmlNode.cs
- CngAlgorithmGroup.cs
- _OSSOCK.cs
- PagesChangedEventArgs.cs
- CharacterMetrics.cs
- RouteItem.cs
- HttpCacheParams.cs
- GridViewDeleteEventArgs.cs
- RIPEMD160Managed.cs
- CompoundFileDeflateTransform.cs
- TdsEnums.cs
- MessageEnumerator.cs
- ConnectionPoint.cs
- HandlerWithFactory.cs
- ByteStreamMessageUtility.cs
- DesignerRegionMouseEventArgs.cs
- DifferencingCollection.cs
- PrivilegedConfigurationManager.cs
- ObjectDataSourceStatusEventArgs.cs
- _Semaphore.cs
- MemberPath.cs
- Enlistment.cs
- InitiatorServiceModelSecurityTokenRequirement.cs
- HtmlForm.cs
- DataReaderContainer.cs
- Icon.cs
- PerSessionInstanceContextProvider.cs
- FileAuthorizationModule.cs
- Column.cs
- StrokeCollectionConverter.cs
- NetNamedPipeBindingElement.cs
- TcpConnectionPool.cs
- NumberFormatInfo.cs
- WebPartConnectionsCancelEventArgs.cs
- ImageUrlEditor.cs
- XmlQueryType.cs
- ThaiBuddhistCalendar.cs
- TextEditorContextMenu.cs
- _SslSessionsCache.cs
- DesignerEventService.cs
- UnsafePeerToPeerMethods.cs
- WindowsEditBox.cs
- ParserContext.cs
- XsdValidatingReader.cs
- XmlTextReaderImplHelpers.cs
- Pair.cs
- RequestResizeEvent.cs
- RelationshipWrapper.cs
- DragEvent.cs
- XPathNodeInfoAtom.cs
- ButtonBaseAutomationPeer.cs
- SecurityTokenAuthenticator.cs
- GradientSpreadMethodValidation.cs
- CounterCreationDataConverter.cs
- Baml2006ReaderSettings.cs
- AppSettingsReader.cs
- DictionaryEntry.cs
- GlyphRunDrawing.cs
- DataBinding.cs
- CellNormalizer.cs
- WizardSideBarListControlItem.cs
- CalendarDataBindingHandler.cs
- DocComment.cs
- TemplatedAdorner.cs
- XsltException.cs
- Rijndael.cs
- FormViewUpdatedEventArgs.cs
- InputLangChangeRequestEvent.cs
- MemberJoinTreeNode.cs
- TraceSection.cs
- SEHException.cs
- RayHitTestParameters.cs