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
- CryptoStream.cs
- PassportIdentity.cs
- EntityCommandCompilationException.cs
- DataBindingExpressionBuilder.cs
- TextRangeEditLists.cs
- WSSecurityJan2004.cs
- TextParentUndoUnit.cs
- OraclePermission.cs
- ColorIndependentAnimationStorage.cs
- GridViewAutomationPeer.cs
- SqlRowUpdatingEvent.cs
- JournalNavigationScope.cs
- Pair.cs
- BCryptHashAlgorithm.cs
- SelectionEditor.cs
- ExpressionBuilder.cs
- CreatingCookieEventArgs.cs
- LinearKeyFrames.cs
- StopRoutingHandler.cs
- ParserHooks.cs
- ConstNode.cs
- ReadOnlyHierarchicalDataSourceView.cs
- SoapSchemaMember.cs
- ToolStripItemClickedEventArgs.cs
- AssemblyFilter.cs
- SafeThreadHandle.cs
- TextCompositionManager.cs
- ObjectDataSource.cs
- CodeCastExpression.cs
- FixedBufferAttribute.cs
- EdmType.cs
- DeploymentExceptionMapper.cs
- XamlStyleSerializer.cs
- DockAndAnchorLayout.cs
- FunctionOverloadResolver.cs
- RegexFCD.cs
- FunctionDetailsReader.cs
- PreservationFileReader.cs
- Grant.cs
- CatalogPartChrome.cs
- GC.cs
- CodeConditionStatement.cs
- UInt32.cs
- DynamicExpression.cs
- Base64Encoder.cs
- TextAutomationPeer.cs
- DataObjectSettingDataEventArgs.cs
- SQlBooleanStorage.cs
- NodeInfo.cs
- MessageDispatch.cs
- BufferBuilder.cs
- TemplateControlBuildProvider.cs
- XPathBuilder.cs
- ContentIterators.cs
- HMACSHA256.cs
- SoapWriter.cs
- PrimitiveOperationFormatter.cs
- DefaultPropertyAttribute.cs
- ContentWrapperAttribute.cs
- HtmlElement.cs
- AspNetSynchronizationContext.cs
- DetailsViewRow.cs
- DataGridCommandEventArgs.cs
- ServicePointManager.cs
- DesignerTransaction.cs
- InvokeMethodActivity.cs
- AnonymousIdentificationSection.cs
- SplashScreen.cs
- PostBackOptions.cs
- AssemblyNameProxy.cs
- GridViewRowPresenterBase.cs
- DateTimeEditor.cs
- SelectionPattern.cs
- DbDataSourceEnumerator.cs
- XPathSingletonIterator.cs
- Filter.cs
- DefaultWorkflowTransactionService.cs
- documentsequencetextcontainer.cs
- WindowsSpinner.cs
- ImpersonateTokenRef.cs
- SafeHandle.cs
- ColorContext.cs
- TypeUsageBuilder.cs
- VirtualizedContainerService.cs
- WebPartPersonalization.cs
- RootDesignerSerializerAttribute.cs
- Pair.cs
- ScriptingSectionGroup.cs
- IItemContainerGenerator.cs
- CapabilitiesState.cs
- DesigntimeLicenseContextSerializer.cs
- CompilerGlobalScopeAttribute.cs
- UpdateExpressionVisitor.cs
- TouchPoint.cs
- ScriptControl.cs
- MouseGesture.cs
- PlatformNotSupportedException.cs
- OleDbCommand.cs
- NativeMethods.cs
- wgx_commands.cs