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
- CodeExpressionStatement.cs
- Dynamic.cs
- _NetworkingPerfCounters.cs
- XmlNamespaceDeclarationsAttribute.cs
- DataGridParentRows.cs
- XPathSelfQuery.cs
- FixedSOMSemanticBox.cs
- CatalogZone.cs
- XpsTokenContext.cs
- SudsCommon.cs
- BoundPropertyEntry.cs
- TextEndOfSegment.cs
- WebPartConnectionsDisconnectVerb.cs
- FamilyTypefaceCollection.cs
- AbstractSvcMapFileLoader.cs
- ActiveXHost.cs
- _LocalDataStore.cs
- PreviewPrintController.cs
- ObjectRef.cs
- SQLStringStorage.cs
- DesignerVerbCollection.cs
- altserialization.cs
- ExceptionValidationRule.cs
- Selection.cs
- ClientCredentials.cs
- RegexMatch.cs
- QilList.cs
- base64Transforms.cs
- DispatcherEventArgs.cs
- RedistVersionInfo.cs
- BuilderPropertyEntry.cs
- RSAOAEPKeyExchangeDeformatter.cs
- CopyAttributesAction.cs
- ImportedNamespaceContextItem.cs
- Encoder.cs
- LinqDataSourceDisposeEventArgs.cs
- DataGridViewCellEventArgs.cs
- DataGridViewCellCollection.cs
- AmbiguousMatchException.cs
- _ChunkParse.cs
- X509UI.cs
- CloudCollection.cs
- Ppl.cs
- ErrorWebPart.cs
- ParentQuery.cs
- GridItemProviderWrapper.cs
- TraceContextEventArgs.cs
- OuterGlowBitmapEffect.cs
- SubMenuStyle.cs
- AtlasWeb.Designer.cs
- SqlUserDefinedTypeAttribute.cs
- ConsoleEntryPoint.cs
- Debug.cs
- Evidence.cs
- ModelFunctionTypeElement.cs
- HMACSHA512.cs
- ToolboxItemFilterAttribute.cs
- StringValidator.cs
- _AutoWebProxyScriptEngine.cs
- SecurityTokenException.cs
- Form.cs
- Literal.cs
- ResourceExpressionBuilder.cs
- BaseCollection.cs
- ObjectSet.cs
- ContractHandle.cs
- Events.cs
- cookiecontainer.cs
- OdbcException.cs
- DataGridToolTip.cs
- IpcManager.cs
- Positioning.cs
- Expressions.cs
- FileVersion.cs
- CachedRequestParams.cs
- CodeObjectCreateExpression.cs
- SystemIPv6InterfaceProperties.cs
- RegistryConfigurationProvider.cs
- RawKeyboardInputReport.cs
- XpsFixedDocumentSequenceReaderWriter.cs
- WebControlParameterProxy.cs
- MediaContextNotificationWindow.cs
- KeyInfo.cs
- CodeArrayCreateExpression.cs
- ItemChangedEventArgs.cs
- WindowsGraphicsCacheManager.cs
- BoundPropertyEntry.cs
- NamespaceCollection.cs
- Hash.cs
- PackageDigitalSignature.cs
- GridSplitter.cs
- ConstrainedGroup.cs
- ViewManager.cs
- VisemeEventArgs.cs
- CreateUserWizard.cs
- BindingValueChangedEventArgs.cs
- XPathAxisIterator.cs
- DataMisalignedException.cs
- UnknownBitmapEncoder.cs
- JsonDeserializer.cs