-
Notifications
You must be signed in to change notification settings - Fork 263
WPF Behaviors in ATF
Gary edited this page Mar 2, 2015
·
1 revision
Behaviors encapsulate capabilities into reusable modules, which can be attached to an element to give it additional capabilities.
ATF comes with a variety of behaviors you can use in your ATF applications. For an example of how one of these works in an application, see ContextMenuBehavior Class Operation. ContextMenuBehavior
is used in the ATF Simple DOM Editor WPF Sample and is discussed in Behaviors.
ATF offers behaviors classes for a variety of application needs in the Sce.Atf.Wpf.Behaviors
namespace. Here are some, many of which are used with ATF's WPF controls.
-
ActivateContextBehavior
: Catch mouse down events and set ATF context registry active context to the current data context of the element. -
AdaptableBehavior
: Base adaptable behavior class. On attached, attempts to getIAdaptableControl
interface onAssociatedObject
and register itself.AssociatedObject
is the object to which this behavior is attached. -
AtfTreeViewBehavior
: Behavior forTreeView
that works alongside theTreeViewModel
class to support multi-selection and "bring into view" abilities. -
ButtonPopupBehavior
: Displays the associated context menu on a button click. -
CommandBehavior
: Attached command behavior to hook routed events toICommand
s in the view model. -
ContextMenuBehavior
: Behavior to provide hook for ATF context menu service. Right-clicking on the associated element queries all context menu providers for commands using the element's data context as the query target. If commands exist, a context menu is displayed. For details, see ContextMenuBehavior Class Operation. -
ContextSensitiveToolBarBehavior
: Toolbar behavior to display context sensitive information based on the current selection. -
DialogButtonWorkaround
: Attached property replacement for the standardButton.IsDefault
to work around a bug in WPF. -
DragAutoScrollBehavior
: Behavior to auto scroll when dragging near edge of the element, such as aListView
. Can be attached to any framework element, but element must contain a scroll viewer in its visual tree for this behavior to function. -
DragSourceBehavior<T>
: Base drag source behavior. -
DropTargetBehavior
: Base drop target behavior. -
EditableTextBlockAdorner
: Adorner class that showsTextBox
over the text block when edit mode is on. -
EditableTextBlockBehavior
: Editable text block behavior. -
GridViewSortBehavior
:GridView
sort behavior. -
InsertionAdorner
: Adorner class for object being dragged over. -
InstancingDropTargetBehavior
: Drag and drop target that creates a new instance of the object on drop. -
ItemsControlContextMenuBehavior
: Behavior forItemsControl
that context menu is associated with. Used withContextMenuBehavior
. -
ItemsControlDoubleClickBehavior
:Selector
double-click behavior that calls a bound ViewModel command when the user double clicks theSelector
. -
ItemsControlDragSourceBehavior
: Items control drag source behavior that only deals with the single item under the mouse, not selection or multi-selection. -
ItemsControlDropTargetBehavior
: Drop target behavior for items control to accept drag and drop operations. -
ItemsControlIndexedDropTargetBehavior
: Items control indexed drop target behavior. -
ItemsControlInsertionAdornerBehavior
: Behavior to draw insertion adorners on items controls. For list based controls, this draws an insertion line while dragging items over the control. ForTreeView
s, it highlights the drop targetTreeView
item and optionally adds insertion lines. -
LastHitAwareBehavior
: Behavior for last item hit. -
ListBoxScrollToEndBehavior
: Behavior to auto scroll newly added list box items into view. -
SelectionBehaviorBase
: Base class for Selection behaviors. Can be used onSelector
s orTreeView
s. -
SelectionContextDragSourceBehavior
: Drag source behavior for elements with a selection context, as their data context drag and drop is initiated using current selection of items from the context. -
SelectorLastHitAwareBehavior
: Behavior for last item hit inSelector
. -
SelectorSelectFirstBehavior
: Behavior for items such as ComboBoxes, which do not select the first item in the list when theItemsSource
changes and the control has previously been disabled. -
SelectorSelectionBehavior
: Behavior for selection in aSelector
. -
StyleBehaviors
: Allow settingSystem.Windows.Interactivity.Behaviors
with style setters. -
TextBoxNumericBehavior
: Behaviors for numeric entry in aTextBox
, including minimum and maximum value, and whether to allow integer or decimal numbers. -
TextBoxSelectAllBehavior
: Select all text in aTextBox
when it receives focus. -
ThemeStyleBehavior
: Attached property which allows a style that usesBasedOn=""
to be re-based when the application theme is dynamically changed. Normally, if theBasedOn
property of a style is set, once the application is loaded, changing the target style has no effect—the derived style remains based on the original style. This behavior works around this by cloning the style when a theme change occurs. -
ToSourceSelectionBehavior
: Bind the selection of items in aSelector
to anISelectionContext
. Note that binding is only one way, that is, selection in theSelector
is mirrored into theISelectionContext
, but not the other way. -
TreeViewDragHoverExpandBehavior
: Behavior to auto expandTreeView
items when the mouse is hovered over them during a drag and drop operation. -
TreeViewItemLabelEditBehavior
: More complex version of standard double-click to edit label behavior. This behavior requires a single click on a focused item, but waits for a set time to check that no double-click occurs. -
TwoWaySelectionBehavior
: Add two way selection binding support between anISelectionContext
and a selector or multi-selector.
- ATF and WPF Overview: Overview of what ATF offers for WPF.
- WPF Application: Discuss how WPF applications differ from WinForms ones in basic application structure.
- Parallels in WPF and WinForms Support: Discusses features WPF offers that are similar to WinForms.
- WPF Application Support: Discussion of classes generally supporting applications.
- WPF Dialogs in ATF: WPF dialogs you can use.
- WPF Behaviors in ATF: ATF support for WPF behaviors.
- WPF Markup Extensions in ATF: ATF support for WPF Markup extensions.
- WPF ViewModels in ATF: Discuss WPF ViewModel support in ATF.
- Converting from WinForms to WPF: Tells how to convert a WinForms ATF-based application to WPF.
- Home
- Getting Started
- Features & Benefits
- Requirements & Dependencies
- Gallery
- Technology & Samples
- Adoption
- News
- Release Notes
- ATF Community
- Searching Documentation
- Using Documentation
- Videos
- Tutorials
- How To
- Programmer's Guide
- Reference
- Code Samples
- Documentation Files
© 2014-2015, Sony Computer Entertainment America LLC