Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / TemplateBindingExpressionConverter.cs / 1 / 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
- SymbolTable.cs
- UnsafeNativeMethodsPenimc.cs
- InstanceKeyView.cs
- COM2ColorConverter.cs
- BitSet.cs
- Type.cs
- AtomContentProperty.cs
- CodeDelegateCreateExpression.cs
- EventLog.cs
- LicenseContext.cs
- MobileTextWriter.cs
- XmlElement.cs
- DesignerImageAdapter.cs
- InputBuffer.cs
- WebBrowserNavigatedEventHandler.cs
- Stack.cs
- XmlAttribute.cs
- WorkflowTransactionOptions.cs
- ControlParameter.cs
- WebPartTracker.cs
- RawAppCommandInputReport.cs
- SymDocumentType.cs
- XmlElementAttributes.cs
- safesecurityhelperavalon.cs
- SystemEvents.cs
- VisualTreeUtils.cs
- NonSerializedAttribute.cs
- LogLogRecordEnumerator.cs
- BindingObserver.cs
- Floater.cs
- TableItemStyle.cs
- RegexCaptureCollection.cs
- UniqueIdentifierService.cs
- MbpInfo.cs
- TextMetrics.cs
- ObjectStateEntry.cs
- BooleanProjectedSlot.cs
- VectorAnimationBase.cs
- AuthenticationServiceManager.cs
- WpfKnownMember.cs
- PasswordDeriveBytes.cs
- COM2ComponentEditor.cs
- IriParsingElement.cs
- DesignerPerfEventProvider.cs
- SkipQueryOptionExpression.cs
- DesignerDataView.cs
- __Filters.cs
- IISMapPath.cs
- WriteableBitmap.cs
- FullTrustAssemblyCollection.cs
- TextBoxBase.cs
- RequestResponse.cs
- DocumentGrid.cs
- SqlDataReaderSmi.cs
- SponsorHelper.cs
- Int32Converter.cs
- MatrixStack.cs
- CatalogPart.cs
- ClickablePoint.cs
- Vertex.cs
- Stack.cs
- InvalidFilterCriteriaException.cs
- RequiredAttributeAttribute.cs
- ShapingEngine.cs
- AliasedSlot.cs
- RepeatBehavior.cs
- ImportDesigner.xaml.cs
- SqlDataSourceCache.cs
- SessionIDManager.cs
- RangeContentEnumerator.cs
- CodeComment.cs
- UriScheme.cs
- ThreadExceptionEvent.cs
- SystemMulticastIPAddressInformation.cs
- SecurityPermission.cs
- CharEnumerator.cs
- RelationshipWrapper.cs
- BaseCollection.cs
- Utils.cs
- TranslateTransform.cs
- SrgsElement.cs
- EmitterCache.cs
- TextHintingModeValidation.cs
- Switch.cs
- Int64.cs
- ReferentialConstraint.cs
- ImageConverter.cs
- EpmSyndicationContentSerializer.cs
- DateTimeUtil.cs
- ScalarConstant.cs
- TypeConverterHelper.cs
- IOThreadTimer.cs
- Documentation.cs
- XamlInt32CollectionSerializer.cs
- CellRelation.cs
- ReadOnlyDataSourceView.cs
- Application.cs
- TabRenderer.cs
- RawKeyboardInputReport.cs
- JournalEntry.cs