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
- HScrollProperties.cs
- ADMembershipUser.cs
- sqlcontext.cs
- TargetInvocationException.cs
- IgnoreDataMemberAttribute.cs
- NativeMethods.cs
- CompilerState.cs
- DoubleLinkListEnumerator.cs
- ItemsControl.cs
- MonitorWrapper.cs
- CollectionsUtil.cs
- GeometryGroup.cs
- ObjectItemAttributeAssemblyLoader.cs
- TypeSemantics.cs
- PathFigure.cs
- ConstantExpression.cs
- DataGridViewRowCollection.cs
- SerialPort.cs
- Application.cs
- StylusCollection.cs
- WebPartVerbCollection.cs
- PaintEvent.cs
- ResourceProviderFactory.cs
- ForEachAction.cs
- FormViewInsertedEventArgs.cs
- ReferenceConverter.cs
- CommandSet.cs
- Compiler.cs
- XmlTextReaderImpl.cs
- ConcurrentStack.cs
- XslException.cs
- Span.cs
- Configuration.cs
- SoapFault.cs
- SafeEventLogWriteHandle.cs
- UserInitiatedRoutedEventPermission.cs
- CellRelation.cs
- OrthographicCamera.cs
- AspNetHostingPermission.cs
- ProfileParameter.cs
- MenuItemAutomationPeer.cs
- PasswordRecovery.cs
- BlockExpression.cs
- Label.cs
- CompModSwitches.cs
- ComEventsMethod.cs
- FieldNameLookup.cs
- PageParserFilter.cs
- Axis.cs
- AddressHeader.cs
- XDeferredAxisSource.cs
- HeaderedContentControl.cs
- SmiRecordBuffer.cs
- CompositeDataBoundControl.cs
- WmiEventSink.cs
- CallbackValidator.cs
- ServiceBusyException.cs
- Site.cs
- LinkDescriptor.cs
- SourceInterpreter.cs
- LicFileLicenseProvider.cs
- XmlLoader.cs
- PrintingPermission.cs
- PrintDialog.cs
- MissingMethodException.cs
- UnsafeNativeMethodsMilCoreApi.cs
- ResourceSetExpression.cs
- SoundPlayer.cs
- ParseNumbers.cs
- SpellerHighlightLayer.cs
- InternalPermissions.cs
- SqlResolver.cs
- EventsTab.cs
- AccessDataSourceView.cs
- ClientBuildManagerCallback.cs
- PromptStyle.cs
- TransformDescriptor.cs
- TextWriterEngine.cs
- DataServiceQuery.cs
- DataGridViewColumnCollection.cs
- ObjectDataSourceDisposingEventArgs.cs
- AssemblyAttributes.cs
- _BaseOverlappedAsyncResult.cs
- _UncName.cs
- TableProvider.cs
- MethodBuilder.cs
- OleDbSchemaGuid.cs
- Scheduling.cs
- CryptoApi.cs
- UnsafeNetInfoNativeMethods.cs
- WebColorConverter.cs
- ToolstripProfessionalRenderer.cs
- CacheDependency.cs
- DataGridViewComboBoxEditingControl.cs
- SHA256Managed.cs
- DeferredRunTextReference.cs
- TextTreeRootTextBlock.cs
- altserialization.cs
- SafeCoTaskMem.cs
- SafeRightsManagementEnvironmentHandle.cs