Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.CardElement Class Reference

A content-sized presentation card with a fixed header/footer and a scrolling body. More...

Inheritance diagram for GWG.WindowFramework.CardElement:
Collaboration diagram for GWG.WindowFramework.CardElement:

Public Member Functions

 CardElement ()
 Creates the internal card structure, with header visible and footer hidden.
void RequestDismiss ()
 Requests user dismissal; required cards reject the request.

Properties

bool AllowDismiss = true [get, set]
 Allows user dismissal requests. Does not prevent application-authorized removal.
bool AllowOutsideDismiss = true [get, set]
 Allows the modal backdrop to request dismissal; AllowDismiss must also permit it.
VisualElement Body [get]
 Container for application-owned form content and UXML children.
Button CloseButton [get]
 User-dismissal button. Visibility and dismissal permission are independent.
override VisualElement contentContainer [get]
 Routes Add() and UXML child creation into Body, not the internal card structure.
VisualElement Footer [get]
 Non-scrolling application action area, hidden by default without discarding children.
VisualElement Header [get]
 Non-scrolling header containing the title and close affordance.
ScrollView ScrollView [get]
 Vertical scrolling body viewport; header/footer remain outside this scroll view.
bool ShowCloseButton [get, set]
 Controls close-button visibility only; hiding it does not disable outside dismissal.
bool ShowFooter [get, set]
 Shows/hides the footer while retaining application controls. Default is false.
bool ShowHeader [get, set]
 Shows/hides the header while retaining its title and button contents.
string Title [get, set]
 Displayed plain-text title; does not identify the card in persistence or telemetry.
Label TitleLabel [get]
 Plain-text title label; rich-text interpretation is disabled.

Events

Action< CardElement > DismissRequested
 Requests removal of this exact card; the modal owner performs timed cleanup.

Detailed Description

A content-sized presentation card with a fixed header/footer and a scrolling body.

A card is deliberately not a WindowFrame: it has no controller registration, layout-memory identity, dragger, resizer or independent fullscreen state. WindowModal owns its queue slot, presentation, focus policy and fade/removal sequence. The application owns the form controls and any business operation performed by them; closing a card does not grant a reward or submit data. Set card width/max-width in developer USS (pixels or percentages); the modal constrains the card to the available viewport. UXML children and Add() target Body so header/footer never scroll. Framework presentation uses the wfw-modal-* theme roles. Required forms should set AllowDismiss false and hide the close button. There is no automatic Escape binding: applications own input.

Constructor & Destructor Documentation

◆ CardElement()

GWG.WindowFramework.CardElement.CardElement ( )
inline

Creates the internal card structure, with header visible and footer hidden.

Construct detached, populate Body/Footer, then pass the card to the existing controller's ShowModal(CardElement) or an owned WindowModal.AddCard. No asset loading or window registration is performed here. Panel attachment telemetry is observation only.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ RequestDismiss()

void GWG.WindowFramework.CardElement.RequestDismiss ( )
inline

Requests user dismissal; required cards reject the request.

Returns immediately. When AllowDismiss is true, invokes DismissRequested with this instance if a subscriber exists. With no owner/subscriber the request does not remove anything. When false, no event is raised. Subscriber exceptions propagate; this method performs neither validation nor resource disposal. WindowModal normally subscribes and schedules removal.

var card = new CardElement { Title = "Confirm", ShowFooter = true, AllowDismiss = false,
card.Body.Add(new Label("Review the operation before proceeding."));
// Populate Footer with application-owned validated actions before presentation.
// After successful application validation, remove this exact card through its modal owner.
bool ShowFooter
Shows/hides the footer while retaining application controls. Default is false.
Definition CardElement.cs:44
string Title
Displayed plain-text title; does not identify the card in persistence or telemetry.
Definition CardElement.cs:40
bool AllowOutsideDismiss
Allows the modal backdrop to request dismissal; AllowDismiss must also permit it.
Definition CardElement.cs:52
bool ShowCloseButton
Controls close-button visibility only; hiding it does not disable outside dismissal.
Definition CardElement.cs:50
bool AllowDismiss
Allows user dismissal requests. Does not prevent application-authorized removal.
Definition CardElement.cs:48
CardElement()
Creates the internal card structure, with header visible and footer hidden.
Definition CardElement.cs:58
The WindowFrameController is the central management component for the Window Framework system....
Definition WindowFrameController.cs:77
void ShowModal(WindowFrame window, VisualElement initialFocus=null, bool dismissOnBackdrop=false)
Presents a detached WindowFrame modally in the controller-linked UIDocument.
Definition WindowFrameController.cs:328
static WindowFrameController Instance
Gets the singleton instance of the WindowFrameController.
Definition WindowFrameController.cs:299
Here is the call graph for this function:
Here is the caller graph for this function:

Property Documentation

◆ AllowDismiss

bool GWG.WindowFramework.CardElement.AllowDismiss = true
getset

Allows user dismissal requests. Does not prevent application-authorized removal.

Set false for must-answer forms; the application still decides when a valid answer permits removal. This is behavior configuration, never a portable theme field.

◆ AllowOutsideDismiss

bool GWG.WindowFramework.CardElement.AllowOutsideDismiss = true
getset

Allows the modal backdrop to request dismissal; AllowDismiss must also permit it.

◆ Body

VisualElement GWG.WindowFramework.CardElement.Body
get

Container for application-owned form content and UXML children.

◆ CloseButton

Button GWG.WindowFramework.CardElement.CloseButton
get

User-dismissal button. Visibility and dismissal permission are independent.

◆ contentContainer

override VisualElement GWG.WindowFramework.CardElement.contentContainer
get

Routes Add() and UXML child creation into Body, not the internal card structure.

◆ Footer

VisualElement GWG.WindowFramework.CardElement.Footer
get

Non-scrolling application action area, hidden by default without discarding children.

◆ Header

VisualElement GWG.WindowFramework.CardElement.Header
get

Non-scrolling header containing the title and close affordance.

◆ ScrollView

ScrollView GWG.WindowFramework.CardElement.ScrollView
get

Vertical scrolling body viewport; header/footer remain outside this scroll view.

◆ ShowCloseButton

bool GWG.WindowFramework.CardElement.ShowCloseButton
getset

Controls close-button visibility only; hiding it does not disable outside dismissal.

◆ ShowFooter

bool GWG.WindowFramework.CardElement.ShowFooter
getset

Shows/hides the footer while retaining application controls. Default is false.

◆ ShowHeader

bool GWG.WindowFramework.CardElement.ShowHeader
getset

Shows/hides the header while retaining its title and button contents.

◆ Title

string GWG.WindowFramework.CardElement.Title
getset

Displayed plain-text title; does not identify the card in persistence or telemetry.

◆ TitleLabel

Label GWG.WindowFramework.CardElement.TitleLabel
get

Plain-text title label; rich-text interpretation is disabled.

Event Documentation

◆ DismissRequested

Action<CardElement> GWG.WindowFramework.CardElement.DismissRequested

Requests removal of this exact card; the modal owner performs timed cleanup.

A request is not synchronous removal. Do not independently detach the card from this callback: WindowModal must retain the slot until opacity fades, then slide the queue upward. Application-authorized completion uses WindowModal.RemoveCard instead of user dismissal.