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
- SchemaImporter.cs
- DockingAttribute.cs
- ElementsClipboardData.cs
- CursorInteropHelper.cs
- NamespaceMapping.cs
- SequentialUshortCollection.cs
- InkSerializer.cs
- TableNameAttribute.cs
- StringCollection.cs
- codemethodreferenceexpression.cs
- SuspendDesigner.cs
- MessageHeaderDescriptionCollection.cs
- RegistryKey.cs
- CompleteWizardStep.cs
- PropertyGridView.cs
- ParseHttpDate.cs
- AudioSignalProblemOccurredEventArgs.cs
- OleDbEnumerator.cs
- SafeNativeMethods.cs
- AssociationSetEnd.cs
- CharStorage.cs
- RegexRunner.cs
- DockingAttribute.cs
- DrawingVisualDrawingContext.cs
- ConnectionStringsExpressionBuilder.cs
- DeleteHelper.cs
- ProtocolsConfigurationHandler.cs
- LabelAutomationPeer.cs
- WsiProfilesElement.cs
- ScriptHandlerFactory.cs
- ImageBrush.cs
- XamlSerializerUtil.cs
- CollectionChangedEventManager.cs
- NativeMethods.cs
- XNameTypeConverter.cs
- Trigger.cs
- IntPtr.cs
- FontResourceCache.cs
- XmlWriter.cs
- PathParser.cs
- WeakRefEnumerator.cs
- SemaphoreFullException.cs
- ErasingStroke.cs
- FloaterBaseParaClient.cs
- ModuleElement.cs
- TemplateBamlRecordReader.cs
- PreservationFileWriter.cs
- TableCell.cs
- webbrowsersite.cs
- XsdValidatingReader.cs
- WindowCollection.cs
- XmlMtomReader.cs
- DataControlButton.cs
- DecodeHelper.cs
- ConnectionStringSettings.cs
- XsltSettings.cs
- Hyperlink.cs
- HttpHeaderCollection.cs
- HttpFileCollection.cs
- UnsafeNativeMethods.cs
- QuaternionAnimationUsingKeyFrames.cs
- ValidationRule.cs
- EndpointFilterProvider.cs
- RangeValuePatternIdentifiers.cs
- InvalidDataContractException.cs
- TextChangedEventArgs.cs
- IdentifierCollection.cs
- StateDesignerConnector.cs
- ConnectionString.cs
- RenderData.cs
- BuilderPropertyEntry.cs
- XmlCharacterData.cs
- CompiledIdentityConstraint.cs
- ContentHostHelper.cs
- SamlSecurityToken.cs
- MessageSecurityOverHttpElement.cs
- ElementFactory.cs
- ThemeConfigurationDialog.cs
- AnnouncementSendsAsyncResult.cs
- HttpPostProtocolImporter.cs
- RegexNode.cs
- InvalidCommandTreeException.cs
- X509ThumbprintKeyIdentifierClause.cs
- ClientFormsAuthenticationCredentials.cs
- BuildResultCache.cs
- ImageAnimator.cs
- Math.cs
- Menu.cs
- ProcessManager.cs
- DirectoryLocalQuery.cs
- CheckBoxRenderer.cs
- TextSchema.cs
- RealizationContext.cs
- SelectedDatesCollection.cs
- XmlSchemaAttribute.cs
- BuildManager.cs
- PolicyUnit.cs
- ConfigXmlDocument.cs
- PageRequestManager.cs
- WmlMobileTextWriter.cs