[]
        
(Showing Draft Content)

C1.WPF.C1Window

C1Window Class

Shows content in a window.

Namespace: C1.WPF
Assembly: C1.WPF.4.6.2.dll
Syntax
[TemplatePart(Name = "Drag", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "Root", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "Close", Type = typeof(Button))]
[TemplatePart(Name = "Resize", Type = typeof(Border))]
[TemplatePart(Name = "Content", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "Maximize", Type = typeof(Button))]
[TemplatePart(Name = "Minimize", Type = typeof(Button))]
[TemplateVisualState(Name = "Active", GroupName = "ActiveStates")]
[TemplateVisualState(Name = "Inactive", GroupName = "ActiveStates")]
[TemplateVisualState(Name = "Floating", GroupName = "WindowStateStates")]
[TemplateVisualState(Name = "Maximized", GroupName = "WindowStateStates")]
[TemplateVisualState(Name = "Minimized", GroupName = "WindowStateStates")]
[TemplateVisualState(Name = "Dragged", GroupName = "DragStates")]
[TemplateVisualState(Name = "Still", GroupName = "DragStates")]
[TemplateVisualState(Name = "Open", GroupName = "OpenStates")]
[TemplateVisualState(Name = "Closed", GroupName = "OpenStates")]
public class C1Window : C1HeaderedContentControl, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild
Remarks

This control should not be added as the child of another control. It can either be opened as a Popup by calling the Show() method or displayed inside a Canvas by using the Canvas property.

Constructors

Name Description
C1Window()

Initializes a new instance of a C1Window.

Fields

Name Description
ButtonBackgroundProperty

Identifies the ButtonBackground dependency property.

ButtonForegroundProperty

Identifies the ButtonForeground dependency property.

DialogResultProperty

Identifies the DialogResult dependency property.

IsActiveProperty

Identifies the IsActive dependency property.

IsDraggableProperty

Identifies the IsDraggable dependency property.

IsResizableProperty

Identifies the IsResizable dependency property.

LeftProperty

Identifies the Left dependency property.

ModalBackgroundProperty

Identifies the ModalBackground dependency property.

MouseOverBrushProperty

Identifies the MouseOverBrush dependency property.

PressedBrushProperty

Identifies the PressedBrush dependency property.

ShowCloseButtonProperty

Identifies the ShowCloseButton dependency property.

ShowMaximizeButtonProperty

Identifies the ShowMaximizeButton dependency property.

ShowMinimizeButtonProperty

Identifies the ShowMinimizeButton dependency property.

TopProperty

Identifies the Top dependency property.

WindowStateProperty

Identifies the WindowState dependency property.

Properties

Name Description
ButtonBackground

Gets or sets the Brush that will be assigned to the Background of the buttons inside the control.

ButtonForeground

Gets or sets the Brush that will be assigned to the Foreground of the buttons inside the control.

Canvas

Gets or sets the Canvas used to display the window.

DialogResult

Gets or sets the dialog result for the window.

IsActive

Gets or sets whether the window is the active window.

IsDraggable

Gets or set whether the window can be dragged.

IsResizable

Gets or sets whether the window can be resized and maximized.

Left

Gets or sets the distance from the left side of the window to the left side of its container.

ModalBackground

Gets or sets the brushed used on the background when showing a modal window.

MouseOverBrush

Gets or sets the Brush used to highlight the control when it has the mouse over.

PressedBrush

Gets or sets the Brush used to paint a button when it is pressed.

ShowCloseButton

Gets or sets whether the close button of this window is shown.

ShowMaximizeButton

Gets or sets whether the maximize button of this window is shown.

ShowMinimizeButton

Gets or sets whether the minimize button of this window is shown.

ThemeResources

ResourceDictionary that is applied to the C1Window. Typically used with a copy of a C1Theme used somewhere in the app because in Silverlight, themes are not propagated automatically through un-parented Popup .

Top

Gets or sets the distance from the top side of the window to the top side of its container.

WindowState

Gets or sets a value that indicates whether a window is restored, minimized, or maximized.

Methods

Name Description
AddDefaultPopupToVisualTree(Panel)

Call this method if you have problems with showing C1Window in your application.

BringToFront()

Puts the window in front of all windows.

CenterOnScreen()

Centers the window in its container.

ChangeVisualStateActive(bool)

Updates the current visual state of the Active visual state group to match the object's properties.

ChangeVisualStateDrag(bool)

Updates the current visual state of the Drag visual state group to match the object's properties.

ChangeVisualStateWindowState(bool)

Updates the current visual state of the WindowState visual state group to match the object's properties.

Close()

Closes the window.

Hide()

Hides the window without closing it.

OnApplyTemplate()

Builds the visual tree for the C1Window control when a new template is applied.

OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)
Show()

Opens the window.

ShowModal()

Opens the window as modal.

Events

Name Description
Closed

Event fired when the window is closed by the user or the Close() method.

Closing

Event fired when the window is about to close, allows the handler to stop the window from being closed.

IsActiveChanged

Event raised when the IsActive property has changed.

PositionChanged

Fires when the window position changes.

WindowStateChanged

Event raised when the WindowState property has changed.

Extension Methods