Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / Converters / ModelToObjectValueConverter.cs / 1305376 / ModelToObjectValueConverter.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.Converters { using System.Windows.Data; using System.Globalization; using System.Activities.Presentation.Model; // This class is used to convert a ModelItem to the innerobject, when binding to whole objectin xaml. // reverse conversion is not required beacuse ModelProperty.SetValue accepts object as is. public class ModelToObjectValueConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { object convertedValue = null; if (value != null) { if (value is ModelItem) { convertedValue = ((ModelItem)value).GetCurrentValue(); } else { convertedValue = value; } } return convertedValue; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return value; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.Converters { using System.Windows.Data; using System.Globalization; using System.Activities.Presentation.Model; // This class is used to convert a ModelItem to the innerobject, when binding to whole objectin xaml. // reverse conversion is not required beacuse ModelProperty.SetValue accepts object as is. public class ModelToObjectValueConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { object convertedValue = null; if (value != null) { if (value is ModelItem) { convertedValue = ((ModelItem)value).GetCurrentValue(); } else { convertedValue = value; } } return convertedValue; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return value; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- assemblycache.cs
- XmlDataProvider.cs
- SiteMapDataSourceView.cs
- LogSwitch.cs
- CompletionBookmark.cs
- HttpCacheParams.cs
- RequiredAttributeAttribute.cs
- CapabilitiesSection.cs
- SspiHelper.cs
- Comparer.cs
- RemoteAsymmetricSignatureFormatter.cs
- FlagsAttribute.cs
- DataRowExtensions.cs
- TransformerTypeCollection.cs
- Int64.cs
- PtsHost.cs
- Atom10FormatterFactory.cs
- ScrollContentPresenter.cs
- ReadContentAsBinaryHelper.cs
- SafeReversePInvokeHandle.cs
- sitestring.cs
- EmptyCollection.cs
- EditCommandColumn.cs
- ImageMapEventArgs.cs
- AttachedAnnotation.cs
- WebMessageBodyStyleHelper.cs
- ISFClipboardData.cs
- ProfileManager.cs
- XamlSerializationHelper.cs
- TextSearch.cs
- StaticResourceExtension.cs
- Deflater.cs
- BinaryNode.cs
- ProgressBarRenderer.cs
- Byte.cs
- HttpCacheVaryByContentEncodings.cs
- SHA1Managed.cs
- UpDownEvent.cs
- KeyConstraint.cs
- Conditional.cs
- ViewLoader.cs
- JumpList.cs
- DesignBindingValueUIHandler.cs
- ConfigXmlComment.cs
- LessThan.cs
- TargetConverter.cs
- StickyNoteAnnotations.cs
- UInt16Converter.cs
- HtmlButton.cs
- RangeBaseAutomationPeer.cs
- RequestCacheValidator.cs
- XmlQueryRuntime.cs
- PartitionResolver.cs
- ListMarkerLine.cs
- GeneralTransform3DGroup.cs
- HtmlImage.cs
- RectangleF.cs
- InputProviderSite.cs
- LambdaSerializationException.cs
- DelegateOutArgument.cs
- XmlNamespaceManager.cs
- KeyInfo.cs
- NameTable.cs
- HashAlgorithm.cs
- OwnerDrawPropertyBag.cs
- DSGeneratorProblem.cs
- ParentUndoUnit.cs
- GregorianCalendarHelper.cs
- TagPrefixInfo.cs
- WebPartManager.cs
- ResourcePart.cs
- Point3D.cs
- SHA1CryptoServiceProvider.cs
- SemanticKeyElement.cs
- Vector3DAnimationUsingKeyFrames.cs
- TextBlock.cs
- BookmarkScope.cs
- CollectionExtensions.cs
- SpinLock.cs
- PropVariant.cs
- ChangePassword.cs
- AttributeProviderAttribute.cs
- WebPartAuthorizationEventArgs.cs
- SetterBaseCollection.cs
- XmlDataDocument.cs
- GPRECTF.cs
- DecoderExceptionFallback.cs
- FileDialogCustomPlacesCollection.cs
- DependencyObject.cs
- CompiledELinqQueryState.cs
- EntityExpressionVisitor.cs
- ZipFileInfo.cs
- CodeIterationStatement.cs
- SqlNode.cs
- MenuEventArgs.cs
- ISAPIRuntime.cs
- SafeEventLogReadHandle.cs
- SBCSCodePageEncoding.cs
- DefaultValueAttribute.cs
- _ProxyChain.cs