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
- NavigationProperty.cs
- Frame.cs
- Collection.cs
- SqlDataSourceEnumerator.cs
- XhtmlBasicPageAdapter.cs
- WithStatement.cs
- UntypedNullExpression.cs
- AxisAngleRotation3D.cs
- FrameDimension.cs
- XmlSchemaDatatype.cs
- HMACSHA1.cs
- WebBrowsableAttribute.cs
- _Connection.cs
- JpegBitmapDecoder.cs
- XamlFrame.cs
- Preprocessor.cs
- QueryOperator.cs
- Char.cs
- HttpCacheVary.cs
- WebServiceData.cs
- ChildChangedEventArgs.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- PasswordRecovery.cs
- Size.cs
- XamlStackWriter.cs
- SqlNodeAnnotations.cs
- PasswordDeriveBytes.cs
- DataExpression.cs
- CodeCatchClauseCollection.cs
- PasswordDeriveBytes.cs
- SafeNativeMethods.cs
- WsdlInspector.cs
- CodeTypeOfExpression.cs
- AggregationMinMaxHelpers.cs
- SqlDataSourceCache.cs
- CancelEventArgs.cs
- ListenUriMode.cs
- _HeaderInfo.cs
- PageParserFilter.cs
- EventProvider.cs
- DataListAutoFormat.cs
- LogicalExpr.cs
- DataBindingValueUIHandler.cs
- FieldCollectionEditor.cs
- DelegateTypeInfo.cs
- ObjectManager.cs
- XPathDocumentBuilder.cs
- MessageQueue.cs
- PtsHost.cs
- HttpCachePolicyElement.cs
- Int16.cs
- LocatorPart.cs
- ContentPresenter.cs
- WmfPlaceableFileHeader.cs
- dataobject.cs
- CodeDelegateCreateExpression.cs
- SpellerStatusTable.cs
- SerializerDescriptor.cs
- TickBar.cs
- AuthorizationContext.cs
- StdValidatorsAndConverters.cs
- XsdDuration.cs
- CodeTypeDeclaration.cs
- XmlException.cs
- SortFieldComparer.cs
- FamilyCollection.cs
- FrameworkElementFactoryMarkupObject.cs
- EventHandlerList.cs
- AcceleratedTokenProviderState.cs
- TypeExtensionConverter.cs
- PageParserFilter.cs
- TextBoxAutomationPeer.cs
- ChannelBinding.cs
- EntityViewContainer.cs
- DataGridAddNewRow.cs
- ContainerControl.cs
- SourceItem.cs
- SqlOuterApplyReducer.cs
- BehaviorService.cs
- TextMetrics.cs
- HandledMouseEvent.cs
- SyntaxCheck.cs
- WorkflowInlining.cs
- InteropAutomationProvider.cs
- DiagnosticsConfiguration.cs
- AutomationPatternInfo.cs
- SelfSignedCertificate.cs
- WeakReferenceEnumerator.cs
- SpecularMaterial.cs
- AliasExpr.cs
- PropertyReferenceExtension.cs
- ColumnMapTranslator.cs
- CodeTypeOfExpression.cs
- SqlProfileProvider.cs
- Context.cs
- SchemaTypeEmitter.cs
- SamlConstants.cs
- ProfessionalColorTable.cs
- Msec.cs
- ValidatorUtils.cs