Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / TemplateBindingExpressionConverter.cs / 1305600 / TemplateBindingExpressionConverter.cs
/****************************************************************************\ * * File: TemplateBindingExpressionConverter.cs * * Class for serializing a TemplateBindingExpression. * * 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 { ////// Converts a template binding expression into a MarkupExtension. This is used /// during serialization (the serializer native knows how to serialize an ME). /// public class TemplateBindingExpressionConverter: TypeConverter { ////// Returns true for MarkupExtension /// public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(MarkupExtension)) { return true; } return base.CanConvertTo(context, destinationType); } ////// Converts to a MarkupExtension /// public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(MarkupExtension)) { TemplateBindingExpression templateBindingExpression = value as TemplateBindingExpression; if (templateBindingExpression == null) throw new ArgumentException(SR.Get(SRID.MustBeOfType, "value", "TemplateBindingExpression")); return templateBindingExpression.TemplateBindingExtension; } return base.ConvertTo(context, culture, value, destinationType); } } } // 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
- FaultCode.cs
- ActivationServices.cs
- GroupDescription.cs
- Guid.cs
- NetworkAddressChange.cs
- ValidationError.cs
- EmptyQuery.cs
- _HeaderInfoTable.cs
- ToolBarPanel.cs
- XslUrlEditor.cs
- ConfigXmlCDataSection.cs
- WeakReferenceList.cs
- Canvas.cs
- AmbientEnvironment.cs
- XslCompiledTransform.cs
- WebPartMenuStyle.cs
- EventLogPermissionEntry.cs
- HashMembershipCondition.cs
- ConfigXmlElement.cs
- TransformedBitmap.cs
- ButtonBase.cs
- HashCodeCombiner.cs
- SubMenuStyle.cs
- HandlerFactoryWrapper.cs
- Msec.cs
- CryptographicAttribute.cs
- ToolStripTemplateNode.cs
- LinkArea.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- ObjectViewFactory.cs
- ImmutableCollection.cs
- ProfileService.cs
- CodeSubDirectoriesCollection.cs
- TextRange.cs
- BulletedListEventArgs.cs
- DataGridView.cs
- AccessibleObject.cs
- ConfigurationManagerInternalFactory.cs
- VisualTarget.cs
- SamlSecurityTokenAuthenticator.cs
- xmlformatgeneratorstatics.cs
- FileSystemInfo.cs
- UIElement3D.cs
- CipherData.cs
- DrawListViewSubItemEventArgs.cs
- SettingsContext.cs
- RelationshipConstraintValidator.cs
- MarshalDirectiveException.cs
- ItemList.cs
- StorageModelBuildProvider.cs
- PartitionedStream.cs
- EventKeyword.cs
- SqlClientWrapperSmiStreamChars.cs
- PointValueSerializer.cs
- FixedDocumentPaginator.cs
- WindowPattern.cs
- IApplicationTrustManager.cs
- TextTreeRootTextBlock.cs
- WrappingXamlSchemaContext.cs
- MetadataArtifactLoaderResource.cs
- listviewsubitemcollectioneditor.cs
- SqlXml.cs
- HttpApplicationStateWrapper.cs
- TripleDES.cs
- SetterBase.cs
- IgnoreSection.cs
- XPathItem.cs
- DTCTransactionManager.cs
- XamlClipboardData.cs
- TextRangeEditTables.cs
- VectorValueSerializer.cs
- DrawingGroupDrawingContext.cs
- SmiEventStream.cs
- _ConnectOverlappedAsyncResult.cs
- DynamicDocumentPaginator.cs
- PixelShader.cs
- WebBrowsableAttribute.cs
- TrackingAnnotationCollection.cs
- ImageBrush.cs
- RoleManagerSection.cs
- BindingGroup.cs
- WSSecurityPolicy11.cs
- validation.cs
- SqlGenericUtil.cs
- TreeChangeInfo.cs
- SQLSingle.cs
- BindingSource.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- VarRefManager.cs
- LayoutDump.cs
- ContextProperty.cs
- TemplatingOptionsDialog.cs
- FontWeightConverter.cs
- CacheMemory.cs
- DataTableReader.cs
- PowerStatus.cs
- SmtpFailedRecipientException.cs
- LicenseContext.cs
- Context.cs
- __FastResourceComparer.cs