Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Core.Presentation / System / Activities / Core / Presentation / HintTextMaxWidthConverter.cs / 1305376 / HintTextMaxWidthConverter.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Core.Presentation { using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Windows; using System.Windows.Data; [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")] internal sealed class HintTextMaxWidthConverter : IValueConverter { public object Convert(object o, Type targetType, object parameter, CultureInfo culture) { // If o == null, this means the Activity inside Default/Cases is null. // We need to show SR.ClickToAdd instruction as a whole string without trim. // So we need to set the MaxWidth to double.PositiveInfinity. Otherwise, we // set it according to the parameter and TextBlock will do proper trimming. double maxWidth = double.Parse(parameter as string, CultureInfo.InvariantCulture.NumberFormat); return o != null ? maxWidth : DependencyProperty.UnsetValue; } public object ConvertBack(object o, Type targetType, object parameter, CultureInfo culture) { throw FxTrace.Exception.AsError(new NotImplementedException()); } } } // 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
- DocumentSequence.cs
- RichTextBoxAutomationPeer.cs
- FieldAccessException.cs
- QilTernary.cs
- OneOfElement.cs
- SqlRowUpdatingEvent.cs
- WebEventCodes.cs
- TriState.cs
- XamlRtfConverter.cs
- SafeRightsManagementQueryHandle.cs
- DbQueryCommandTree.cs
- TracedNativeMethods.cs
- ToolStripItemImageRenderEventArgs.cs
- LogPolicy.cs
- Mappings.cs
- BrowserDefinition.cs
- CodeExpressionStatement.cs
- LinkedResourceCollection.cs
- ServiceModelEnhancedConfigurationElementCollection.cs
- CodeGeneratorOptions.cs
- SQLSingleStorage.cs
- PageRouteHandler.cs
- SendSecurityHeaderElement.cs
- _DisconnectOverlappedAsyncResult.cs
- TypeSystem.cs
- GcHandle.cs
- ParamArrayAttribute.cs
- CodeConstructor.cs
- Empty.cs
- CacheMemory.cs
- RadioButtonPopupAdapter.cs
- UnSafeCharBuffer.cs
- GiveFeedbackEvent.cs
- InArgumentConverter.cs
- TextRangeSerialization.cs
- FontCollection.cs
- MarkupCompilePass1.cs
- DataRow.cs
- HttpCapabilitiesSectionHandler.cs
- ConfigurationStrings.cs
- LedgerEntryCollection.cs
- BridgeDataRecord.cs
- ArraySet.cs
- ObjRef.cs
- ApplicationTrust.cs
- NullableDoubleSumAggregationOperator.cs
- SpanIndex.cs
- RecognizerInfo.cs
- SharedDp.cs
- SignatureConfirmationElement.cs
- RuntimeArgumentHandle.cs
- Style.cs
- DefaultValueMapping.cs
- _LoggingObject.cs
- XmlWrappingReader.cs
- PrintPageEvent.cs
- ScriptingSectionGroup.cs
- InProcStateClientManager.cs
- X509SecurityTokenProvider.cs
- DataTableExtensions.cs
- SynchronousReceiveElement.cs
- backend.cs
- DBPropSet.cs
- SqlDataSourceCache.cs
- TableHeaderCell.cs
- DeviceContext.cs
- WeakEventTable.cs
- XmlDictionaryReader.cs
- DocumentViewer.cs
- ResourceReferenceExpression.cs
- MSAAWinEventWrap.cs
- Profiler.cs
- FlowLayoutPanel.cs
- _TLSstream.cs
- ParallelRangeManager.cs
- Icon.cs
- SByteStorage.cs
- FormViewInsertEventArgs.cs
- CodeComment.cs
- SupportedAddressingMode.cs
- MatrixTransform.cs
- InternalUserCancelledException.cs
- UIPermission.cs
- CreateBookmarkScope.cs
- SqlDataSourceRefreshSchemaForm.cs
- FlowLayout.cs
- PropertyInformation.cs
- AppDomainProtocolHandler.cs
- ReadOnlyCollectionBuilder.cs
- ExpressionConverter.cs
- PerformanceCounterLib.cs
- CompilerGlobalScopeAttribute.cs
- StopStoryboard.cs
- DashStyle.cs
- QueryResponse.cs
- QueryRewriter.cs
- PageFunction.cs
- BindingsSection.cs
- Graphics.cs
- BaseDataBoundControl.cs