Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / View / PrimarySelectionAdorner.cs / 1305376 / PrimarySelectionAdorner.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.View { using System; using System.Collections.Generic; using System.Text; using System.Windows.Documents; using System.Windows; using System.Windows.Controls; using System.Windows.Media; using System.Runtime; [Fx.Tag.XamlVisible(false)] sealed class PrimarySelectionAdorner : Adorner { public PrimarySelectionAdorner(UIElement adornedElement) : base(adornedElement) { } protected override void OnInitialized(EventArgs e) { this.IsHitTestVisible = false; } protected override void OnRender(DrawingContext drawingContext) { ContentControl contentControl = this.AdornedElement as ContentControl; double height = contentControl.ActualHeight; double width = contentControl.ActualWidth; Rect adornedElementRect = new Rect(this.DesiredSize.Width / 2 - width / 2, 0, width, height);; Pen renderPen = new Pen(SystemColors.HighlightBrush, 3); drawingContext.DrawRoundedRectangle(null, renderPen, adornedElementRect, 5, 5); //Geometry geometry = new RectangleGeometry(new Rect(-1000, -1000, 2000, 2000)); //geometry = Geometry.Combine(geometry, new RectangleGeometry(adornedElementRect, 5, 5), GeometryCombineMode.Exclude,null); //drawingContext.PushClip(geometry); //SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(160, 120, 120, 120)); //drawingContext.DrawRectangle(brush, renderPen, new Rect(-1000, -1000, 2000, 2000)); } } } // 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
- HttpRequestMessageProperty.cs
- GridToolTip.cs
- XmlSubtreeReader.cs
- X509SubjectKeyIdentifierClause.cs
- ThreadExceptionEvent.cs
- BulletedListEventArgs.cs
- _LocalDataStoreMgr.cs
- DropShadowEffect.cs
- RequestQueue.cs
- PropertyDescriptorCollection.cs
- MailSettingsSection.cs
- SqlDataAdapter.cs
- ISAPIRuntime.cs
- SystemInformation.cs
- ImageClickEventArgs.cs
- FixedHighlight.cs
- WindowsEditBox.cs
- BooleanAnimationUsingKeyFrames.cs
- HttpListenerResponse.cs
- DeclarationUpdate.cs
- ReadOnlyAttribute.cs
- ZoneButton.cs
- FontStyles.cs
- invalidudtexception.cs
- TablePattern.cs
- DragCompletedEventArgs.cs
- FlowPosition.cs
- PolicyManager.cs
- TraceHandler.cs
- ConfigurationValues.cs
- UserNameSecurityToken.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- Error.cs
- Stroke2.cs
- httpapplicationstate.cs
- DataControlPagerLinkButton.cs
- MultiAsyncResult.cs
- Geometry3D.cs
- ProgressBarRenderer.cs
- GraphicsContext.cs
- XmlElement.cs
- _Events.cs
- PrimitiveType.cs
- HttpProfileGroupBase.cs
- RemotingAttributes.cs
- FontSizeConverter.cs
- ProvidersHelper.cs
- PeerTransportListenAddressConverter.cs
- Hash.cs
- SrgsElementFactory.cs
- StringFreezingAttribute.cs
- DataBoundControlParameterTarget.cs
- SynchronizedInputProviderWrapper.cs
- CompilerCollection.cs
- SafePointer.cs
- PointUtil.cs
- TransformerInfo.cs
- LongValidator.cs
- PermissionAttributes.cs
- LogEntryHeaderSerializer.cs
- RequestCacheEntry.cs
- BamlRecordHelper.cs
- LicFileLicenseProvider.cs
- QuaternionConverter.cs
- SessionEndingEventArgs.cs
- GridViewPageEventArgs.cs
- FixedTextSelectionProcessor.cs
- DataGridItemEventArgs.cs
- TrackingValidationObjectDictionary.cs
- ProxyWebPartConnectionCollection.cs
- OdbcParameterCollection.cs
- OleDbMetaDataFactory.cs
- NotCondition.cs
- UncommonField.cs
- AtomServiceDocumentSerializer.cs
- PlainXmlWriter.cs
- AsyncCompletedEventArgs.cs
- GeneralTransform2DTo3D.cs
- ReceiveContent.cs
- DbSource.cs
- PinnedBufferMemoryStream.cs
- ChannelManager.cs
- propertytag.cs
- UrlMappingsSection.cs
- XPathArrayIterator.cs
- InvokePatternIdentifiers.cs
- CatalogZoneBase.cs
- ServerType.cs
- OdbcReferenceCollection.cs
- IndexerNameAttribute.cs
- SettingsPropertyCollection.cs
- UniqueIdentifierService.cs
- InputBindingCollection.cs
- BinaryFormatterWriter.cs
- MobileTemplatedControlDesigner.cs
- RuntimeEnvironment.cs
- DataGridViewUtilities.cs
- StrongNameUtility.cs
- ValueSerializerAttribute.cs
- _ConnectOverlappedAsyncResult.cs