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
- Properties.cs
- Event.cs
- TrackBarRenderer.cs
- TextServicesManager.cs
- ContainerUIElement3D.cs
- SqlDependencyListener.cs
- XappLauncher.cs
- IdentityNotMappedException.cs
- Itemizer.cs
- XmlBaseWriter.cs
- Condition.cs
- SrgsRulesCollection.cs
- InkCanvasAutomationPeer.cs
- NavigatorOutput.cs
- DocumentPageHost.cs
- X509Certificate2Collection.cs
- X500Name.cs
- WinEventTracker.cs
- AssociatedControlConverter.cs
- ErrorRuntimeConfig.cs
- basenumberconverter.cs
- ProfileInfo.cs
- WhitespaceRuleLookup.cs
- WrapPanel.cs
- UniqueConstraint.cs
- InstanceCreationEditor.cs
- TextBlock.cs
- TypedLocationWrapper.cs
- MouseWheelEventArgs.cs
- ToolStripCustomTypeDescriptor.cs
- MatrixAnimationBase.cs
- UInt32Converter.cs
- CodeMemberProperty.cs
- InputMethod.cs
- InheritanceContextChangedEventManager.cs
- EmptyStringExpandableObjectConverter.cs
- DbXmlEnabledProviderManifest.cs
- MsmqBindingElementBase.cs
- StatusBar.cs
- TextEditorDragDrop.cs
- ObjectContext.cs
- PersonalizationProvider.cs
- FileEnumerator.cs
- CompressionTransform.cs
- Parameter.cs
- ValueType.cs
- ISAPIApplicationHost.cs
- SAPIEngineTypes.cs
- CommonGetThemePartSize.cs
- BamlRecordHelper.cs
- VisemeEventArgs.cs
- TableLayout.cs
- CompilerParameters.cs
- XmlSchemaSimpleContent.cs
- AudioException.cs
- ClientSponsor.cs
- Utils.cs
- FuncCompletionCallbackWrapper.cs
- HtmlInputCheckBox.cs
- NativeMethods.cs
- SqlNodeAnnotation.cs
- KeyManager.cs
- ToolboxItemFilterAttribute.cs
- ObjectListCommandCollection.cs
- DispatchWrapper.cs
- PropVariant.cs
- NavigatingCancelEventArgs.cs
- OleDbStruct.cs
- webproxy.cs
- TreeNodeEventArgs.cs
- CqlParserHelpers.cs
- EntityExpressionVisitor.cs
- Timeline.cs
- SyndicationDeserializer.cs
- HuffModule.cs
- CommandConverter.cs
- FixedSOMContainer.cs
- ApplicationException.cs
- VectorAnimation.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- InvalidDataException.cs
- ObjectKeyFrameCollection.cs
- ResourcePool.cs
- Speller.cs
- VersionedStream.cs
- userdatakeys.cs
- ExitEventArgs.cs
- ZipFileInfoCollection.cs
- SupportingTokenSpecification.cs
- OrderedDictionary.cs
- PermissionListSet.cs
- ExpressionEvaluator.cs
- TableItemPattern.cs
- Command.cs
- HttpCookie.cs
- XmlDataSourceView.cs
- ScrollPattern.cs
- FaultHandlingFilter.cs
- WindowsListViewScroll.cs
- ByteStreamMessageEncodingElement.cs