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
- BuildResult.cs
- BitArray.cs
- BasicCellRelation.cs
- Size3DConverter.cs
- NativeMethods.cs
- unitconverter.cs
- DataGridTable.cs
- CookieProtection.cs
- LexicalChunk.cs
- Maps.cs
- SQLDouble.cs
- TemplatedMailWebEventProvider.cs
- SqlProviderManifest.cs
- XhtmlTextWriter.cs
- Page.cs
- EncoderExceptionFallback.cs
- RoleService.cs
- PatternMatcher.cs
- FilteredDataSetHelper.cs
- GradientBrush.cs
- MultilineStringConverter.cs
- HtmlElementErrorEventArgs.cs
- EUCJPEncoding.cs
- HwndSubclass.cs
- DBBindings.cs
- FileLoadException.cs
- SafeSystemMetrics.cs
- DataGridViewRowPostPaintEventArgs.cs
- NotificationContext.cs
- RuntimeWrappedException.cs
- StoragePropertyMapping.cs
- XmlDataSource.cs
- XmlSchemaSimpleTypeList.cs
- UpDownEvent.cs
- _HelperAsyncResults.cs
- ReflectionHelper.cs
- DataMember.cs
- OracleCommandSet.cs
- TraceProvider.cs
- PathGeometry.cs
- URLMembershipCondition.cs
- XDRSchema.cs
- Range.cs
- ProxyAttribute.cs
- HtmlTextBoxAdapter.cs
- PropertyTab.cs
- _StreamFramer.cs
- Peer.cs
- TypeBuilder.cs
- DelegateCompletionCallbackWrapper.cs
- FileNameEditor.cs
- XmlMtomReader.cs
- Visitors.cs
- RoutedEventHandlerInfo.cs
- ExpressionBindingCollection.cs
- KeyedHashAlgorithm.cs
- SessionStateModule.cs
- CodeDefaultValueExpression.cs
- ParentQuery.cs
- DataRecord.cs
- PropertyExpression.cs
- FixedSOMTableCell.cs
- Array.cs
- SrgsElementFactory.cs
- HtmlInputCheckBox.cs
- SQLDecimalStorage.cs
- OledbConnectionStringbuilder.cs
- DataGridParentRows.cs
- MarginCollapsingState.cs
- HandlerMappingMemo.cs
- FontStyles.cs
- MultiAsyncResult.cs
- BaseValidator.cs
- StartUpEventArgs.cs
- QueryRewriter.cs
- RegexCompilationInfo.cs
- StylusCollection.cs
- BooleanFacetDescriptionElement.cs
- MemberProjectedSlot.cs
- SafeFileMappingHandle.cs
- Parameter.cs
- TemplateBindingExpressionConverter.cs
- CaseInsensitiveComparer.cs
- QueryGeneratorBase.cs
- ComEventsInfo.cs
- OdbcHandle.cs
- ImageAnimator.cs
- SubclassTypeValidatorAttribute.cs
- WmpBitmapDecoder.cs
- WsatTransactionInfo.cs
- CharacterMetrics.cs
- TimeoutValidationAttribute.cs
- WebPartEditVerb.cs
- RadioButton.cs
- SqlConnection.cs
- SecurityHelper.cs
- ServiceDescription.cs
- FacetDescription.cs
- ModifierKeysValueSerializer.cs
- Control.cs