Code:
/ 4.0 / 4.0 / 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. /****************************************************************************\ * * 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
- SystemException.cs
- ConsoleTraceListener.cs
- DataGridViewBand.cs
- UnauthorizedWebPart.cs
- PromptBuilder.cs
- RankException.cs
- WorkflowPageSetupDialog.cs
- HTMLTextWriter.cs
- WebPartDisplayModeCollection.cs
- PersonalizationProvider.cs
- EqualityComparer.cs
- Int32.cs
- ToggleButtonAutomationPeer.cs
- Span.cs
- CatalogPart.cs
- PageParser.cs
- InkCanvas.cs
- QilStrConcatenator.cs
- RowToFieldTransformer.cs
- XmlSchemaCompilationSettings.cs
- FileClassifier.cs
- SmiEventSink.cs
- Mapping.cs
- AssemblyCacheEntry.cs
- _DisconnectOverlappedAsyncResult.cs
- References.cs
- GridViewColumnCollectionChangedEventArgs.cs
- LayoutManager.cs
- ToolStripContentPanel.cs
- InstanceLockTracking.cs
- SuspendDesigner.cs
- ButtonBase.cs
- NetworkCredential.cs
- RequestCachePolicy.cs
- CroppedBitmap.cs
- AutoScrollHelper.cs
- ISO2022Encoding.cs
- BufferedWebEventProvider.cs
- CompositeScriptReferenceEventArgs.cs
- SafeRegistryHandle.cs
- JsonDeserializer.cs
- HwndKeyboardInputProvider.cs
- DeferredRunTextReference.cs
- XmlArrayItemAttributes.cs
- Internal.cs
- mactripleDES.cs
- NameSpaceEvent.cs
- TrackingParameters.cs
- XPathParser.cs
- EmptyElement.cs
- PathParser.cs
- Identifier.cs
- CompilerResults.cs
- GlyphsSerializer.cs
- BufferedOutputStream.cs
- KeyEventArgs.cs
- HandlerBase.cs
- FastPropertyAccessor.cs
- ClusterSafeNativeMethods.cs
- SmiEventStream.cs
- BitmapImage.cs
- AsymmetricKeyExchangeFormatter.cs
- AuthorizationSection.cs
- HostExecutionContextManager.cs
- Bitmap.cs
- ColumnReorderedEventArgs.cs
- ErrorLog.cs
- safesecurityhelperavalon.cs
- ProfessionalColors.cs
- OracleCommandBuilder.cs
- InputLanguageCollection.cs
- ServiceManager.cs
- PinnedBufferMemoryStream.cs
- ByteStorage.cs
- TypeResolver.cs
- SHA384Managed.cs
- RbTree.cs
- GifBitmapEncoder.cs
- BaseCodeDomTreeGenerator.cs
- ToolTipAutomationPeer.cs
- SafeNativeMethodsMilCoreApi.cs
- StringSource.cs
- AdornerDecorator.cs
- HandlerMappingMemo.cs
- Module.cs
- TabControl.cs
- HeaderedItemsControl.cs
- Types.cs
- StringDictionary.cs
- LinkConverter.cs
- UxThemeWrapper.cs
- XmlSchemaParticle.cs
- EntityDataSourceStatementEditor.cs
- LassoHelper.cs
- WindowsContainer.cs
- DataViewManagerListItemTypeDescriptor.cs
- followingquery.cs
- StringComparer.cs
- EventProvider.cs
- Number.cs