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
- TypeNameConverter.cs
- SubMenuStyleCollection.cs
- ContentValidator.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- ObjectDataSourceStatusEventArgs.cs
- LoadWorkflowByInstanceKeyCommand.cs
- SignatureHelper.cs
- MembershipUser.cs
- RoleManagerModule.cs
- SamlAssertionKeyIdentifierClause.cs
- ADRoleFactory.cs
- ClockController.cs
- PrincipalPermission.cs
- ReferencedType.cs
- RuleSetReference.cs
- Property.cs
- OleDbInfoMessageEvent.cs
- Pair.cs
- StorageAssociationTypeMapping.cs
- DependencyObjectProvider.cs
- JournalNavigationScope.cs
- ControlPaint.cs
- QilSortKey.cs
- Marshal.cs
- SQLBytes.cs
- FullTextLine.cs
- MemberRelationshipService.cs
- UpDownBase.cs
- SwitchLevelAttribute.cs
- RepeaterCommandEventArgs.cs
- Trace.cs
- SafeArrayTypeMismatchException.cs
- RegexCaptureCollection.cs
- DelegateOutArgument.cs
- ConfigurationProperty.cs
- SelectedDatesCollection.cs
- SafeNativeMethods.cs
- EntityContainerRelationshipSetEnd.cs
- NonParentingControl.cs
- CheckableControlBaseAdapter.cs
- RootBrowserWindowProxy.cs
- RectangleHotSpot.cs
- PixelShader.cs
- Graphics.cs
- ChangePasswordDesigner.cs
- XslTransform.cs
- Mappings.cs
- CachedPathData.cs
- PhysicalFontFamily.cs
- ViewValidator.cs
- WindowAutomationPeer.cs
- ResourceReferenceExpressionConverter.cs
- LiteralSubsegment.cs
- BaseTreeIterator.cs
- ProfileSettingsCollection.cs
- DBDataPermission.cs
- HttpHandlersSection.cs
- AssemblyBuilder.cs
- ObjectDataSourceWizardForm.cs
- RawStylusSystemGestureInputReport.cs
- SemanticResolver.cs
- RequestResizeEvent.cs
- InstanceHandleReference.cs
- SQLBinary.cs
- ZoneButton.cs
- TextTrailingCharacterEllipsis.cs
- LinkAreaEditor.cs
- ObjectCache.cs
- PrePrepareMethodAttribute.cs
- DataRow.cs
- indexingfiltermarshaler.cs
- RuleSettingsCollection.cs
- MissingFieldException.cs
- Viewport2DVisual3D.cs
- XmlSerializerSection.cs
- ObjectStateManager.cs
- VectorConverter.cs
- VisualStates.cs
- UnsafeNativeMethods.cs
- BindToObject.cs
- TrustManager.cs
- CompositeKey.cs
- EditableRegion.cs
- XamlTypeMapperSchemaContext.cs
- DocumentDesigner.cs
- MimeTypeAttribute.cs
- Visual.cs
- StylusTip.cs
- ParserHooks.cs
- ConnectionPoint.cs
- Wildcard.cs
- DeadCharTextComposition.cs
- XsdDuration.cs
- DictionaryChange.cs
- ModelChangedEventArgsImpl.cs
- DependencyObjectCodeDomSerializer.cs
- NopReturnReader.cs
- StandardToolWindows.cs
- SqlFormatter.cs
- ManualResetEventSlim.cs