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
- XmlConvert.cs
- EditorPartChrome.cs
- TransformDescriptor.cs
- DragDropManager.cs
- CodeStatement.cs
- SafeLibraryHandle.cs
- XpsS0ValidatingLoader.cs
- listitem.cs
- CollectionChange.cs
- TreeNodeCollection.cs
- OdbcDataReader.cs
- Trace.cs
- HighlightVisual.cs
- AgileSafeNativeMemoryHandle.cs
- Contracts.cs
- Descriptor.cs
- StrongNamePublicKeyBlob.cs
- WhiteSpaceTrimStringConverter.cs
- complextypematerializer.cs
- MetadataFile.cs
- AllMembershipCondition.cs
- GroupLabel.cs
- HttpInputStream.cs
- PresentationTraceSources.cs
- QuadraticBezierSegment.cs
- CodeIndexerExpression.cs
- TextCollapsingProperties.cs
- TemplateNameScope.cs
- WebPartConnectionsConfigureVerb.cs
- BamlRecordWriter.cs
- ProxyGenerationError.cs
- GenericIdentity.cs
- ObjectDataSourceEventArgs.cs
- Convert.cs
- TraceData.cs
- LinkGrep.cs
- PasswordBox.cs
- SafeFileHandle.cs
- SQLDecimalStorage.cs
- VariantWrapper.cs
- HtmlHistory.cs
- CustomError.cs
- DesignerDataConnection.cs
- MissingMethodException.cs
- x509utils.cs
- SeparatorAutomationPeer.cs
- TrackingProfile.cs
- IDictionary.cs
- AsymmetricSignatureFormatter.cs
- HorizontalAlignConverter.cs
- WindowsGraphicsWrapper.cs
- SymmetricKey.cs
- XmlDocumentFieldSchema.cs
- DataGridViewTopRowAccessibleObject.cs
- ReflectionHelper.cs
- Storyboard.cs
- ExtensionSimplifierMarkupObject.cs
- CodeConditionStatement.cs
- BadImageFormatException.cs
- WindowsNonControl.cs
- RegexGroup.cs
- CapabilitiesState.cs
- WebExceptionStatus.cs
- VectorCollectionConverter.cs
- WebPermission.cs
- OrElse.cs
- DataBinder.cs
- DataControlButton.cs
- HiddenFieldPageStatePersister.cs
- ManifestResourceInfo.cs
- DataSourceHelper.cs
- RuleInfoComparer.cs
- File.cs
- SoapCommonClasses.cs
- WebDisplayNameAttribute.cs
- ImageCodecInfo.cs
- BindingGroup.cs
- SqlFormatter.cs
- CodeThrowExceptionStatement.cs
- ClientSponsor.cs
- VisualBrush.cs
- Win32.cs
- WindowsFont.cs
- PerformanceCounterManager.cs
- UnionCqlBlock.cs
- QueryOutputWriter.cs
- ReadWriteControlDesigner.cs
- ConsoleEntryPoint.cs
- RectAnimationClockResource.cs
- Constants.cs
- WebPartConnectionsCancelEventArgs.cs
- ListCollectionView.cs
- HybridDictionary.cs
- ParsedAttributeCollection.cs
- PropertiesTab.cs
- HttpClientCertificate.cs
- AnnouncementInnerClient11.cs
- CfgParser.cs
- RuntimeIdentifierPropertyAttribute.cs
- DataGrid.cs