diff --git a/src/AddIns/DisplayBindings/WpfDesign/StandaloneDesigner/Window1.xaml b/src/AddIns/DisplayBindings/WpfDesign/StandaloneDesigner/Window1.xaml index 61249c9042..3c40956587 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/StandaloneDesigner/Window1.xaml +++ b/src/AddIns/DisplayBindings/WpfDesign/StandaloneDesigner/Window1.xaml @@ -6,18 +6,20 @@ - - - - - - - - - - + + + + + + + + + + + ]]> diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/ContainerDragHandle.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/ContainerDragHandle.cs index 74d02bb727..fda4b92743 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/ContainerDragHandle.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/ContainerDragHandle.cs @@ -13,7 +13,6 @@ using System.Windows.Shapes; using System.Windows.Controls.Primitives; using ICSharpCode.WpfDesign.Adorners; using ICSharpCode.WpfDesign.Extensions; -using ICSharpCode.WpfDesign.Designer.Controls; namespace ICSharpCode.WpfDesign.Designer.Controls { diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/WindowClone.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/WindowClone.cs new file mode 100644 index 0000000000..5286d6a3dc --- /dev/null +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/WindowClone.cs @@ -0,0 +1,139 @@ +// +// +// +// +// $Revision$ +// + +using System; +using System.ComponentModel; +using System.Windows.Controls; +using System.Windows; +using System.Windows.Media; +using System.Windows.Shapes; +using System.Windows.Input; +using System.Windows.Controls.Primitives; +using ICSharpCode.WpfDesign.Adorners; +using ICSharpCode.WpfDesign.Extensions; +using System.Diagnostics; + +namespace ICSharpCode.WpfDesign.Designer.Controls +{ + /// + /// A custom control that imitates the properties of , but is not a top-level control. + /// + public class WindowClone : ContentControl + { + static WindowClone() + { + //This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class. + //This style is defined in themes\generic.xaml + DefaultStyleKeyProperty.OverrideMetadata(typeof(WindowClone), new FrameworkPropertyMetadata(typeof(WindowClone))); + + Control.IsTabStopProperty.OverrideMetadata(typeof(WindowClone), new FrameworkPropertyMetadata(false)); + KeyboardNavigation.DirectionalNavigationProperty.OverrideMetadata(typeof(WindowClone), new FrameworkPropertyMetadata(KeyboardNavigationMode.Cycle)); + KeyboardNavigation.TabNavigationProperty.OverrideMetadata(typeof(WindowClone), new FrameworkPropertyMetadata(KeyboardNavigationMode.Cycle)); + KeyboardNavigation.ControlTabNavigationProperty.OverrideMetadata(typeof(WindowClone), new FrameworkPropertyMetadata(KeyboardNavigationMode.Cycle)); + FocusManager.IsFocusScopeProperty.OverrideMetadata(typeof(WindowClone), new FrameworkPropertyMetadata(true)); + } + + /// + /// This property has no effect. (for compatibility with only). + /// + public bool AllowsTransparency { + get { return (bool)GetValue(Window.AllowsTransparencyProperty); } + set { SetValue(Window.AllowsTransparencyProperty, value); } + } + + /// + /// Specifies the icon to use. + /// + public ImageSource Icon { + get { return (ImageSource)GetValue(Window.IconProperty); } + set { SetValue(Window.IconProperty, value); } + } + + /// + /// This property has no effect. (for compatibility with only). + /// + [TypeConverter(typeof(LengthConverter))] + public double Left { + get { return (double)GetValue(Window.LeftProperty); } + set { SetValue(Window.LeftProperty, value); } + } + + /// + /// Gets or sets the resize mode. + /// + public ResizeMode ResizeMode { + get { return (ResizeMode)GetValue(Window.ResizeModeProperty); } + set { SetValue(Window.ResizeModeProperty, value); } + } + + /// + /// This property has no effect. (for compatibility with only). + /// + public bool ShowInTaskbar { + get { return (bool)GetValue(Window.ShowInTaskbarProperty); } + set { SetValue(Window.ShowInTaskbarProperty, value); } + } + + /// + /// Gets or sets a value that specifies whether a window will automatically size itself to fit the size of its content. + /// + public SizeToContent SizeToContent { + get { return (SizeToContent)GetValue(Window.SizeToContentProperty); } + set { SetValue(Window.SizeToContentProperty, value); } + } + + /// + /// The title to display in the Window's title bar. + /// + public string Title { + get { return (string)GetValue(Window.TitleProperty); } + set { SetValue(Window.TitleProperty, value); } + } + + /// + /// This property has no effect. (for compatibility with only). + /// + [TypeConverter(typeof(LengthConverter))] + public double Top { + get { return (double)GetValue(Window.TopProperty); } + set { SetValue(Window.TopProperty, value); } + } + + /// + /// This property has no effect. (for compatibility with only). + /// + public bool Topmost { + get { return (bool)GetValue(Window.TopmostProperty); } + set { SetValue(Window.TopmostProperty, value); } + } + + /// + /// This property has no effect. (for compatibility with only). + /// + public WindowStyle WindowStyle { + get { return (WindowStyle)GetValue(Window.WindowStyleProperty); } + set { SetValue(Window.WindowStyleProperty, value); } + } + } + + /// + /// A for . + /// + [ExtensionFor(typeof(Window))] + public class WindowCloneExtension : CustomInstanceFactory + { + /// + /// Used to create instances of . + /// + public override object CreateInstance(Type type, params object[] arguments) + { + Debug.Assert(arguments.Length == 0); + Debug.Assert(type == typeof(Window)); + return new WindowClone(); + } + } +} diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj index 9f2eb4b6f6..f472bc9a0b 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj @@ -60,6 +60,7 @@ + diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/themes/generic.xaml b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/themes/generic.xaml index 212137694b..25d54acea9 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/themes/generic.xaml +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/themes/generic.xaml @@ -1,15 +1,15 @@  - - + +