Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Controls / DataGridColumnDropSeparator.cs / 1305600 / DataGridColumnDropSeparator.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Windows; using System.Windows.Controls.Primitives; using MS.Internal; namespace System.Windows.Controls { ////// The separator used to indicate drop location during column header drag-drop /// internal class DataGridColumnDropSeparator : Separator { #region Constructors static DataGridColumnDropSeparator() { DefaultStyleKeyProperty.OverrideMetadata( typeof(DataGridColumnDropSeparator), new FrameworkPropertyMetadata(DataGridColumnHeader.ColumnHeaderDropSeparatorStyleKey)); WidthProperty.OverrideMetadata( typeof(DataGridColumnDropSeparator), new FrameworkPropertyMetadata(null, new CoerceValueCallback(OnCoerceWidth))); HeightProperty.OverrideMetadata( typeof(DataGridColumnDropSeparator), new FrameworkPropertyMetadata(null, new CoerceValueCallback(OnCoerceHeight))); } #endregion #region Static Methods private static object OnCoerceWidth(DependencyObject d, object baseValue) { double width = (double)baseValue; if (DoubleUtil.IsNaN(width)) { return 2.0; } return baseValue; } private static object OnCoerceHeight(DependencyObject d, object baseValue) { double height = (double)baseValue; DataGridColumnDropSeparator separator = (DataGridColumnDropSeparator)d; if (separator._referenceHeader != null && DoubleUtil.IsNaN(height)) { return separator._referenceHeader.ActualHeight; } return baseValue; } #endregion #region Properties internal DataGridColumnHeader ReferenceHeader { get { return _referenceHeader; } set { _referenceHeader = value; } } #endregion #region Data private DataGridColumnHeader _referenceHeader; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Windows; using System.Windows.Controls.Primitives; using MS.Internal; namespace System.Windows.Controls { ////// The separator used to indicate drop location during column header drag-drop /// internal class DataGridColumnDropSeparator : Separator { #region Constructors static DataGridColumnDropSeparator() { DefaultStyleKeyProperty.OverrideMetadata( typeof(DataGridColumnDropSeparator), new FrameworkPropertyMetadata(DataGridColumnHeader.ColumnHeaderDropSeparatorStyleKey)); WidthProperty.OverrideMetadata( typeof(DataGridColumnDropSeparator), new FrameworkPropertyMetadata(null, new CoerceValueCallback(OnCoerceWidth))); HeightProperty.OverrideMetadata( typeof(DataGridColumnDropSeparator), new FrameworkPropertyMetadata(null, new CoerceValueCallback(OnCoerceHeight))); } #endregion #region Static Methods private static object OnCoerceWidth(DependencyObject d, object baseValue) { double width = (double)baseValue; if (DoubleUtil.IsNaN(width)) { return 2.0; } return baseValue; } private static object OnCoerceHeight(DependencyObject d, object baseValue) { double height = (double)baseValue; DataGridColumnDropSeparator separator = (DataGridColumnDropSeparator)d; if (separator._referenceHeader != null && DoubleUtil.IsNaN(height)) { return separator._referenceHeader.ActualHeight; } return baseValue; } #endregion #region Properties internal DataGridColumnHeader ReferenceHeader { get { return _referenceHeader; } set { _referenceHeader = value; } } #endregion #region Data private DataGridColumnHeader _referenceHeader; #endregion } } // 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
- RadioButtonList.cs
- TypeToken.cs
- ToolStripDesigner.cs
- ComPersistableTypeElement.cs
- XhtmlBasicFormAdapter.cs
- DataRowCollection.cs
- FontFamily.cs
- Control.cs
- AppDomainProtocolHandler.cs
- SupportingTokenAuthenticatorSpecification.cs
- CellPartitioner.cs
- XamlTreeBuilderBamlRecordWriter.cs
- EntityContainerEntitySet.cs
- SystemIPInterfaceProperties.cs
- AppSettingsReader.cs
- Composition.cs
- SmtpSection.cs
- StaticDataManager.cs
- BindingContext.cs
- PartialTrustVisibleAssemblyCollection.cs
- TextProperties.cs
- ArraySubsetEnumerator.cs
- RubberbandSelector.cs
- EntityParameterCollection.cs
- ExceptionUtil.cs
- ErrorTableItemStyle.cs
- ProgressBar.cs
- Utility.cs
- CookieProtection.cs
- XmlILStorageConverter.cs
- TimeZoneNotFoundException.cs
- TextInfo.cs
- TextEncodedRawTextWriter.cs
- DbProviderSpecificTypePropertyAttribute.cs
- Byte.cs
- BamlTreeUpdater.cs
- FontFamily.cs
- SignedPkcs7.cs
- WebPartCloseVerb.cs
- DataStreamFromComStream.cs
- SessionEndedEventArgs.cs
- GeometryGroup.cs
- PropertyChangingEventArgs.cs
- TextTreePropertyUndoUnit.cs
- Parameter.cs
- ReflectionHelper.cs
- CategoryNameCollection.cs
- _PooledStream.cs
- SmiEventSink_DeferedProcessing.cs
- PolicyFactory.cs
- SurrogateSelector.cs
- Pkcs9Attribute.cs
- Authorization.cs
- TableAdapterManagerHelper.cs
- peernodestatemanager.cs
- StringFreezingAttribute.cs
- DurationConverter.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- XmlWellformedWriter.cs
- SqlLiftWhereClauses.cs
- MarkupCompilePass1.cs
- LocatorPart.cs
- _WebProxyDataBuilder.cs
- ThreadWorkerController.cs
- SevenBitStream.cs
- DataGridAutoFormatDialog.cs
- StickyNoteHelper.cs
- NameTable.cs
- OletxDependentTransaction.cs
- BoundsDrawingContextWalker.cs
- ValueOfAction.cs
- XmlObjectSerializer.cs
- TemplateGroupCollection.cs
- printdlgexmarshaler.cs
- ClickablePoint.cs
- ListSourceHelper.cs
- CheckBox.cs
- SqlLiftIndependentRowExpressions.cs
- AppDomainAttributes.cs
- PathTooLongException.cs
- WaitHandleCannotBeOpenedException.cs
- DataRelationPropertyDescriptor.cs
- CodeValidator.cs
- CompiledXpathExpr.cs
- Win32PrintDialog.cs
- Html32TextWriter.cs
- MailSettingsSection.cs
- _ProxyRegBlob.cs
- IndexerNameAttribute.cs
- BindableTemplateBuilder.cs
- ClientData.cs
- TypeValidationEventArgs.cs
- BookmarkEventArgs.cs
- PerspectiveCamera.cs
- OdbcInfoMessageEvent.cs
- IgnoreSection.cs
- EdmConstants.cs
- PageAsyncTask.cs
- cookieexception.cs
- TdsParserSafeHandles.cs