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
- RectangleConverter.cs
- GridViewEditEventArgs.cs
- SafeRightsManagementEnvironmentHandle.cs
- RelAssertionDirectKeyIdentifierClause.cs
- BamlBinaryWriter.cs
- ProtocolsConfigurationEntry.cs
- HandlerElementCollection.cs
- EditBehavior.cs
- Cursor.cs
- DbLambda.cs
- SchemaSetCompiler.cs
- DataServiceRequest.cs
- ConfigurationStrings.cs
- XPathNode.cs
- DataPagerFieldItem.cs
- ExtendedPropertiesHandler.cs
- SyntaxCheck.cs
- _PooledStream.cs
- DWriteFactory.cs
- TemplateControlBuildProvider.cs
- BooleanFacetDescriptionElement.cs
- Int64.cs
- CDSCollectionETWBCLProvider.cs
- X509Utils.cs
- TraceContextEventArgs.cs
- ChildTable.cs
- SqlClientFactory.cs
- CompletedAsyncResult.cs
- TemplateContentLoader.cs
- ValidationRuleCollection.cs
- ColumnCollection.cs
- JulianCalendar.cs
- ClientUtils.cs
- WebPartChrome.cs
- formatter.cs
- TemplateParser.cs
- TextCharacters.cs
- PermissionSetTriple.cs
- StringAnimationBase.cs
- ResourceDescriptionAttribute.cs
- BufferedGraphics.cs
- LinkLabel.cs
- InternalRelationshipCollection.cs
- ImmutableCollection.cs
- BindingExpression.cs
- SortKey.cs
- GatewayDefinition.cs
- WaitHandle.cs
- BoolExpressionVisitors.cs
- WebServiceMethodData.cs
- TypeSystemProvider.cs
- PerfCounters.cs
- DecoderReplacementFallback.cs
- SrgsElement.cs
- Debug.cs
- ProviderBase.cs
- UpdatableGenericsFeature.cs
- LineProperties.cs
- OperationAbortedException.cs
- SystemTcpConnection.cs
- SessionParameter.cs
- StyleTypedPropertyAttribute.cs
- Expressions.cs
- XmlAnyAttributeAttribute.cs
- TabControlEvent.cs
- selecteditemcollection.cs
- DataGridViewLinkColumn.cs
- TextTreeExtractElementUndoUnit.cs
- SqlGenerator.cs
- EntitySetDataBindingList.cs
- Int16.cs
- XmlSchemaSequence.cs
- ConvertersCollection.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- DependencyObjectType.cs
- DynamicPropertyReader.cs
- InfoCardCryptoHelper.cs
- WorkflowMarkupSerializer.cs
- __FastResourceComparer.cs
- ProxyManager.cs
- UIAgentCrashedException.cs
- DecimalSumAggregationOperator.cs
- HttpServerUtilityWrapper.cs
- TextSearch.cs
- DataGridViewIntLinkedList.cs
- XmlUtil.cs
- DirectionalLight.cs
- ByteStreamMessageEncoderFactory.cs
- ZoneButton.cs
- TemplateNodeContextMenu.cs
- PagesChangedEventArgs.cs
- Token.cs
- BitmapEffectDrawing.cs
- XmlSchemaElement.cs
- CodeCompiler.cs
- TrackingCondition.cs
- EmbeddedMailObjectsCollection.cs
- HighContrastHelper.cs
- RSAPKCS1SignatureDeformatter.cs
- StrongNameMembershipCondition.cs