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
- CmsUtils.cs
- PropertyEmitter.cs
- HttpApplicationFactory.cs
- Compiler.cs
- PropVariant.cs
- _ProxyRegBlob.cs
- ThreadStaticAttribute.cs
- EntityFunctions.cs
- HtmlTernaryTree.cs
- SettingsSection.cs
- DoubleAnimationClockResource.cs
- Not.cs
- AddingNewEventArgs.cs
- AncillaryOps.cs
- PropertyEntry.cs
- SchemaEntity.cs
- CodeExporter.cs
- EdmToObjectNamespaceMap.cs
- EventWaitHandle.cs
- HtmlInputRadioButton.cs
- RemoteWebConfigurationHost.cs
- ConnectionPoint.cs
- ChangeInterceptorAttribute.cs
- PerfCounters.cs
- EncoderParameter.cs
- JsonReaderDelegator.cs
- GridViewCancelEditEventArgs.cs
- RemoteWebConfigurationHostServer.cs
- PasswordBoxAutomationPeer.cs
- DataRecordInfo.cs
- WsatTransactionInfo.cs
- NetworkInformationPermission.cs
- RenderingBiasValidation.cs
- Image.cs
- SimpleWebHandlerParser.cs
- AgileSafeNativeMemoryHandle.cs
- _UriTypeConverter.cs
- ValuePatternIdentifiers.cs
- RangeEnumerable.cs
- NotSupportedException.cs
- Point.cs
- MimeWriter.cs
- WindowsNonControl.cs
- ArraySet.cs
- TypeConverter.cs
- ClientApiGenerator.cs
- FixedBufferAttribute.cs
- UserNamePasswordClientCredential.cs
- CodeTypeParameter.cs
- ConfigurationValidatorAttribute.cs
- _NegoStream.cs
- PDBReader.cs
- Helpers.cs
- DataGridViewComboBoxCell.cs
- TypeConverterBase.cs
- RSAOAEPKeyExchangeDeformatter.cs
- WorkItem.cs
- WindowsBrush.cs
- NativeMethods.cs
- XmlParserContext.cs
- ExpressionPrinter.cs
- IdentityModelStringsVersion1.cs
- TextSegment.cs
- XmlBinaryReaderSession.cs
- ParallelQuery.cs
- SkewTransform.cs
- LogFlushAsyncResult.cs
- SynchronizationLockException.cs
- QueryLifecycle.cs
- SQLDecimalStorage.cs
- FormViewUpdatedEventArgs.cs
- HttpContextBase.cs
- SessionEndedEventArgs.cs
- TextTreeNode.cs
- FileDetails.cs
- ErrorTolerantObjectWriter.cs
- XmlWhitespace.cs
- DynamicQueryableWrapper.cs
- GradientSpreadMethodValidation.cs
- SiteMap.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- ListViewHitTestInfo.cs
- FormsAuthentication.cs
- Command.cs
- TextSelectionProcessor.cs
- ErrorProvider.cs
- ThreadStateException.cs
- ShutDownListener.cs
- NavigateEvent.cs
- SyntaxCheck.cs
- DateTimeParse.cs
- SQLDateTimeStorage.cs
- HttpInputStream.cs
- WebDisplayNameAttribute.cs
- SettingsPropertyIsReadOnlyException.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- ExtensibleClassFactory.cs
- LiteralControl.cs
- AutomationTextAttribute.cs
- _Semaphore.cs