Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / View / ExtensionWindow.cs / 1305376 / ExtensionWindow.cs
//----------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------
namespace System.Activities.Presentation.View
{
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Media;
using System.Runtime;
using System.Globalization;
using System.Diagnostics.CodeAnalysis;
delegate void ExtensionWindowCloseEventHandler(object sender, RoutedEventArgs e);
delegate void ExtensionWindowClosingEventHandler(object sender, ExtensionWindowClosingRoutedEventArgs e);
//This class provides PopupWindow like expirience while editing data on designer surface. It
//behaves like ordinary popup, with additional functionality - allows resizing, moving, and
//easier styling.
[TemplatePart(Name = "PART_Content"),
TemplatePart(Name = "PART_ShapeBorder")]
class ExtensionWindow : ContentControl
{
public static readonly DependencyProperty DataProperty = DependencyProperty.Register(
"Data",
typeof(object),
typeof(ExtensionWindow),
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.AffectsRender, new PropertyChangedCallback(OnDataChanged)));
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(
"Title",
typeof(string),
typeof(ExtensionWindow),
new UIPropertyMetadata(string.Empty));
public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
"Icon",
typeof(DrawingBrush),
typeof(ExtensionWindow),
new UIPropertyMetadata(null));
public static readonly DependencyProperty ShowWindowHeaderProperty = DependencyProperty.Register(
"ShowWindowHeader",
typeof(bool),
typeof(ExtensionWindow),
new UIPropertyMetadata(true));
public static readonly DependencyProperty ShowResizeGripProperty = DependencyProperty.Register(
"ShowResizeGrip",
typeof(bool),
typeof(ExtensionWindow),
new UIPropertyMetadata(true));
public static readonly DependencyProperty MenuItemsProperty = DependencyProperty.Register(
"MenuItems",
typeof(ObservableCollection