C# 클래스 Catel.Windows.DataWindow

Window class that implements the InfoBarMessageControl and the default buttons, according to the DataWindowMode.
상속: System.Windows.Controls.ChildWindow, IDataWindow:System.Windows.Window, IDataWindow
파일 보기 프로젝트 열기: Catel/Catel

Private Properties

프로퍼티 타입 설명
ApplyChanges Task
DiscardChanges Task
ExecuteApply void
ExecuteCancel void
ExecuteOk void
HandleDefaultButton void
OnApplyExcute void
OnApplyExcuteAsync Task
OnButtonReceivedFocus void
OnCancelExecute void
OnDataWindowClosing void
OnOkExecute void
OnViewModelClosed void
OnViewModelPropertyChanged void
RaiseViewModelChanged void
SetDialogResultAndMakeSureWindowGetsClosed bool

공개 메소드들

메소드 설명
DataWindow ( ) : System

Initializes a new instance of the T:System.Windows.FrameworkElement class.

This method is required for design time support.

DataWindow ( DataWindowMode mode, IEnumerable additionalButtons = null, DataWindowDefaultButton defaultButton = DataWindowDefaultButton.OK, bool setOwnerAndFocus = true, InfoBarMessageControlGenerationMode infoBarMessageControlGenerationMode = InfoBarMessageControlGenerationMode.Inline ) : System

Initializes a new instance of this class with custom commands.

DataWindow ( IViewModel viewModel ) : System

Initializes a new instance of the DataWindow class.

Explicit constructor with view model injection, required for Activator.CreateInstance(System.Type) which does not seem to support default parameter values.

DataWindow ( IViewModel viewModel, DataWindowMode mode, IEnumerable additionalButtons = null, DataWindowDefaultButton defaultButton = DataWindowDefaultButton.OK, bool setOwnerAndFocus = true, InfoBarMessageControlGenerationMode infoBarMessageControlGenerationMode = InfoBarMessageControlGenerationMode.Inline ) : System

Initializes a new instance of the DataWindow class.

OnApplyTemplate ( ) : void

Builds the visual tree for the T:System.Windows.Controls.ChildWindow control when a new template is applied.

보호된 메소드들

메소드 설명
AddCustomButton ( DataWindowButton dataWindowButton ) : void

Adds a custom button to the list of buttons.

ApplyChangesAsync ( ) : Task

Applies all changes made by this window.

CenterInScreen ( ) : void

Centers the Silverlight ChildWindow in screen.

DiscardChangesAsync ( ) : Task

Discards all changes made by this window.

ExecuteApplyAsync ( ) : System.Threading.Tasks.Task

Executes the Apply command.

ExecuteCancelAsync ( ) : System.Threading.Tasks.Task

Executes the Cancel command.

ExecuteClose ( ) : void

Executes the Close command.

ExecuteOkAsync ( ) : System.Threading.Tasks.Task

Executes the OK command.

Initialize ( ) : void

Initializes the window.

OnApplyCanExecute ( ) : bool

Determines whether the user can execute the Apply command.

OnApplyExecuteAsync ( ) : Task

Handled when the user invokes the Apply command.

OnCancelCanExecute ( ) : bool

Determines whether the user can execute the Cancel command.

OnCancelExecuteAsync ( ) : Task

Handled when the user invokes the Cancel command.

OnCloseCanExecute ( ) : bool

Determines whether the user can execute the Close command.

OnCloseExecute ( ) : void

Handled when the user invokes the Close command.

OnContentChanged ( object oldContent, object newContent ) : void

Invoked when the content of this control has been changed. This method will add the dynamic controls automatically.

OnInternalGridChanged ( ) : void

Called when the internal grid has changed.

This method is only invoked when the grid is set, not when the grid is cleared (which is something that should never happen).

OnKeyDown ( KeyEventArgs e ) : void

Invoked when an unhandled Keyboard.KeyDownEvent attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

OnKeyUp ( KeyEventArgs e ) : void

Invoked when an unhandled KeyUp attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

OnLoaded ( EventArgs e ) : void

Called when the DataWindow is loaded.

OnOkCanExecute ( ) : bool

Determines whether the user can execute the OK command.

OnOkExecuteAsync ( ) : Task

Handled when the user invokes the OK command.

OnPropertyChanged ( PropertyChangedEventArgs e ) : void

Called when a dependency property on this control has changed.

OnUnloaded ( EventArgs e ) : void

Called when the DataWindow is unloaded.

OnViewModelChanged ( ) : void

Called when the ViewModel has changed.

This method does not implement any logic and saves a developer from subscribing/unsubscribing to the ViewModelChanged event inside the same user control.

OnViewModelClosedAsync ( object sender, ViewModelClosedEventArgs e ) : Task

Called when the ViewModel has been closed.

OnViewModelPropertyChanged ( PropertyChangedEventArgs e ) : void

Called when a property on the current ViewModel has changed.

RaiseCanExecuteChangedForAllCommands ( ) : void

Raises the can ICommand.CanExecuteChanged for all commands.

ValidateData ( ) : bool

Validates the data.

비공개 메소드들

메소드 설명
ApplyChanges ( ) : Task
DiscardChanges ( ) : Task
ExecuteApply ( ) : void
ExecuteCancel ( ) : void
ExecuteOk ( ) : void
HandleDefaultButton ( ) : void

Handles the default button, which can be done via a key event (enter).

OnApplyExcute ( ) : void
OnApplyExcuteAsync ( ) : Task
OnButtonReceivedFocus ( object sender, EventArgs e ) : void

Called when a button has received the focus.

OnCancelExecute ( ) : void
OnDataWindowClosing ( object sender, CancelEventArgs args ) : void

Handles the Closing event of the DataWindow control.

OnOkExecute ( ) : void
OnViewModelClosed ( object sender, ViewModelClosedEventArgs e ) : void
OnViewModelPropertyChanged ( object sender, PropertyChangedEventArgs e ) : void

Called when a property on the current view model has changed.

RaiseViewModelChanged ( ) : void
SetDialogResultAndMakeSureWindowGetsClosed ( bool result ) : bool

Sets the DialogResult, but keeps track of whether the DialogResult can actually be set. For example, dialogs which are not called with ShowDialog can not set the DialogResult.

메소드 상세

AddCustomButton() 보호된 메소드

Adds a custom button to the list of buttons.
The is added when the window is already loaded.
protected AddCustomButton ( DataWindowButton dataWindowButton ) : void
dataWindowButton DataWindowButton The data window button.
리턴 void

ApplyChangesAsync() 보호된 메소드

Applies all changes made by this window.
protected ApplyChangesAsync ( ) : Task
리턴 Task

CenterInScreen() 보호된 메소드

Centers the Silverlight ChildWindow in screen.
protected CenterInScreen ( ) : void
리턴 void

DataWindow() 공개 메소드

Initializes a new instance of the T:System.Windows.FrameworkElement class.
This method is required for design time support.
public DataWindow ( ) : System
리턴 System

DataWindow() 공개 메소드

Initializes a new instance of this class with custom commands.
public DataWindow ( DataWindowMode mode, IEnumerable additionalButtons = null, DataWindowDefaultButton defaultButton = DataWindowDefaultButton.OK, bool setOwnerAndFocus = true, InfoBarMessageControlGenerationMode infoBarMessageControlGenerationMode = InfoBarMessageControlGenerationMode.Inline ) : System
mode DataWindowMode .
additionalButtons IEnumerable The additional buttons.
defaultButton DataWindowDefaultButton The default button.
setOwnerAndFocus bool if set to true, set the main window as owner window and focus the window.
infoBarMessageControlGenerationMode InfoBarMessageControlGenerationMode The info bar message control generation mode.
리턴 System

DataWindow() 공개 메소드

Initializes a new instance of the DataWindow class.
Explicit constructor with view model injection, required for Activator.CreateInstance(System.Type) which does not seem to support default parameter values.
public DataWindow ( IViewModel viewModel ) : System
viewModel IViewModel The view model.
리턴 System

DataWindow() 공개 메소드

Initializes a new instance of the DataWindow class.
public DataWindow ( IViewModel viewModel, DataWindowMode mode, IEnumerable additionalButtons = null, DataWindowDefaultButton defaultButton = DataWindowDefaultButton.OK, bool setOwnerAndFocus = true, InfoBarMessageControlGenerationMode infoBarMessageControlGenerationMode = InfoBarMessageControlGenerationMode.Inline ) : System
viewModel IViewModel The view model.
mode DataWindowMode .
additionalButtons IEnumerable The additional buttons.
defaultButton DataWindowDefaultButton The default button.
setOwnerAndFocus bool if set to true, set the main window as owner window and focus the window.
infoBarMessageControlGenerationMode InfoBarMessageControlGenerationMode The info bar message control generation mode.
리턴 System

DiscardChangesAsync() 보호된 메소드

Discards all changes made by this window.
protected DiscardChangesAsync ( ) : Task
리턴 Task

ExecuteApplyAsync() 보호된 메소드

Executes the Apply command.
protected ExecuteApplyAsync ( ) : System.Threading.Tasks.Task
리턴 System.Threading.Tasks.Task

ExecuteCancelAsync() 보호된 메소드

Executes the Cancel command.
protected ExecuteCancelAsync ( ) : System.Threading.Tasks.Task
리턴 System.Threading.Tasks.Task

ExecuteClose() 보호된 메소드

Executes the Close command.
protected ExecuteClose ( ) : void
리턴 void

ExecuteOkAsync() 보호된 메소드

Executes the OK command.
protected ExecuteOkAsync ( ) : System.Threading.Tasks.Task
리턴 System.Threading.Tasks.Task

Initialize() 보호된 메소드

Initializes the window.
protected Initialize ( ) : void
리턴 void

OnApplyCanExecute() 보호된 메소드

Determines whether the user can execute the Apply command.
protected OnApplyCanExecute ( ) : bool
리턴 bool

OnApplyExecuteAsync() 보호된 메소드

Handled when the user invokes the Apply command.
protected OnApplyExecuteAsync ( ) : Task
리턴 Task

OnApplyTemplate() 공개 메소드

Builds the visual tree for the T:System.Windows.Controls.ChildWindow control when a new template is applied.
public OnApplyTemplate ( ) : void
리턴 void

OnCancelCanExecute() 보호된 메소드

Determines whether the user can execute the Cancel command.
protected OnCancelCanExecute ( ) : bool
리턴 bool

OnCancelExecuteAsync() 보호된 메소드

Handled when the user invokes the Cancel command.
protected OnCancelExecuteAsync ( ) : Task
리턴 Task

OnCloseCanExecute() 보호된 메소드

Determines whether the user can execute the Close command.
protected OnCloseCanExecute ( ) : bool
리턴 bool

OnCloseExecute() 보호된 메소드

Handled when the user invokes the Close command.
protected OnCloseExecute ( ) : void
리턴 void

OnContentChanged() 보호된 메소드

Invoked when the content of this control has been changed. This method will add the dynamic controls automatically.
protected OnContentChanged ( object oldContent, object newContent ) : void
oldContent object Old content.
newContent object New content.
리턴 void

OnInternalGridChanged() 보호된 메소드

Called when the internal grid has changed.
This method is only invoked when the grid is set, not when the grid is cleared (which is something that should never happen).
protected OnInternalGridChanged ( ) : void
리턴 void

OnKeyDown() 보호된 메소드

Invoked when an unhandled Keyboard.KeyDownEvent attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected OnKeyDown ( KeyEventArgs e ) : void
e KeyEventArgs The that contains the event data.
리턴 void

OnKeyUp() 보호된 메소드

Invoked when an unhandled KeyUp attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
protected OnKeyUp ( KeyEventArgs e ) : void
e KeyEventArgs The that contains the event data.
리턴 void

OnLoaded() 보호된 메소드

Called when the DataWindow is loaded.
protected OnLoaded ( EventArgs e ) : void
e EventArgs The instance containing the event data.
리턴 void

OnOkCanExecute() 보호된 메소드

Determines whether the user can execute the OK command.
protected OnOkCanExecute ( ) : bool
리턴 bool

OnOkExecuteAsync() 보호된 메소드

Handled when the user invokes the OK command.
protected OnOkExecuteAsync ( ) : Task
리턴 Task

OnPropertyChanged() 보호된 메소드

Called when a dependency property on this control has changed.
protected OnPropertyChanged ( PropertyChangedEventArgs e ) : void
e PropertyChangedEventArgs The instance containing the event data.
리턴 void

OnUnloaded() 보호된 메소드

Called when the DataWindow is unloaded.
protected OnUnloaded ( EventArgs e ) : void
e EventArgs The instance containing the event data.
리턴 void

OnViewModelChanged() 보호된 메소드

Called when the ViewModel has changed.
This method does not implement any logic and saves a developer from subscribing/unsubscribing to the ViewModelChanged event inside the same user control.
protected OnViewModelChanged ( ) : void
리턴 void

OnViewModelClosedAsync() 보호된 메소드

Called when the ViewModel has been closed.
protected OnViewModelClosedAsync ( object sender, ViewModelClosedEventArgs e ) : Task
sender object The sender.
e ViewModelClosedEventArgs The instance containing the event data.
리턴 Task

OnViewModelPropertyChanged() 보호된 메소드

Called when a property on the current ViewModel has changed.
protected OnViewModelPropertyChanged ( PropertyChangedEventArgs e ) : void
e PropertyChangedEventArgs The instance containing the event data.
리턴 void

RaiseCanExecuteChangedForAllCommands() 보호된 메소드

Raises the can ICommand.CanExecuteChanged for all commands.
protected RaiseCanExecuteChangedForAllCommands ( ) : void
리턴 void

ValidateData() 보호된 메소드

Validates the data.
protected ValidateData ( ) : bool
리턴 bool