Code:
/ 4.0 / 4.0 / 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.
//----------------------------------------------------------------
// 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
- DataControlCommands.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- StateItem.cs
- ReadOnlyDictionary.cs
- wgx_exports.cs
- ExecutionContext.cs
- XmlTextAttribute.cs
- AssemblyNameEqualityComparer.cs
- PerformanceCounterManager.cs
- PasswordTextNavigator.cs
- PageClientProxyGenerator.cs
- XmlElementAttributes.cs
- CustomAttribute.cs
- ColumnTypeConverter.cs
- StrokeSerializer.cs
- printdlgexmarshaler.cs
- ContainerControl.cs
- PickBranchDesigner.xaml.cs
- EpmTargetTree.cs
- TrackingExtract.cs
- XmlNodeWriter.cs
- InvalidCastException.cs
- CacheOutputQuery.cs
- XmlAttributeOverrides.cs
- MessageQueueEnumerator.cs
- BooleanAnimationBase.cs
- SubstitutionList.cs
- XhtmlBasicImageAdapter.cs
- StreamGeometryContext.cs
- ProtocolsConfigurationEntry.cs
- DATA_BLOB.cs
- PageAsyncTaskManager.cs
- BoundPropertyEntry.cs
- XmlElementAttributes.cs
- XPathPatternBuilder.cs
- CodeVariableDeclarationStatement.cs
- MenuAdapter.cs
- LinqDataSourceView.cs
- SamlAuthorizationDecisionClaimResource.cs
- NavigationProgressEventArgs.cs
- OracleDataAdapter.cs
- FontFamilyConverter.cs
- GlyphRunDrawing.cs
- GridViewUpdatedEventArgs.cs
- SocketException.cs
- LabelTarget.cs
- MetadataArtifactLoaderFile.cs
- Maps.cs
- InputLanguageSource.cs
- HtmlSelect.cs
- CursorConverter.cs
- RadioButton.cs
- CodeDirectiveCollection.cs
- BindingOperations.cs
- UTF7Encoding.cs
- PlanCompilerUtil.cs
- LocatorManager.cs
- XmlUTF8TextWriter.cs
- SystemUdpStatistics.cs
- ConstructorBuilder.cs
- Hash.cs
- TrackingServices.cs
- _UriTypeConverter.cs
- Mutex.cs
- BaseUriHelper.cs
- SEHException.cs
- PeerEndPoint.cs
- XmlDataImplementation.cs
- OLEDB_Enum.cs
- BrowserCapabilitiesCompiler.cs
- ListViewItemMouseHoverEvent.cs
- ThemeableAttribute.cs
- DataControlButton.cs
- XmlWhitespace.cs
- RowToFieldTransformer.cs
- Content.cs
- RightsManagementPermission.cs
- WebPartMenu.cs
- TextMessageEncodingBindingElement.cs
- SchemaImporterExtensionsSection.cs
- BaseInfoTable.cs
- DbConnectionInternal.cs
- ScopelessEnumAttribute.cs
- SchemaElementLookUpTableEnumerator.cs
- WebBrowserUriTypeConverter.cs
- ObjectDesignerDataSourceView.cs
- PageCatalogPart.cs
- UserInitiatedRoutedEventPermission.cs
- ExtensionSurface.cs
- XPathAxisIterator.cs
- ObjectConverter.cs
- XmlTypeAttribute.cs
- MimeTypeMapper.cs
- FrameworkReadOnlyPropertyMetadata.cs
- ToolStripDropDownItem.cs
- MessageDescription.cs
- DefaultObjectMappingItemCollection.cs
- ButtonChrome.cs
- LoginUtil.cs
- XPathScanner.cs