1 namespace System.Activities.Presentation.PropertyEditing {
4 using System.Windows.Input;
7 /// Standard commands controling the PropertyValueEditing experience
9 public static class PropertyValueEditorCommands {
10 // PropertyContainer mode-switching commands
11 private static RoutedCommand _showInlineEditor;
12 private static RoutedCommand _showExtendedPopupEditor;
13 private static RoutedCommand _showExtendedPinnedEditor;
14 private static RoutedCommand _showDialogEditor;
16 // Transaction commands
17 private static RoutedCommand _beginTransaction;
18 private static RoutedCommand _commitTransaction;
19 private static RoutedCommand _abortTransaction;
21 // Signal to the editor that PropertyContainer is done editing a particular value.
22 // It is up to the host to interpret this command as it sees fit. Cider may decide
23 // to highlight the next property in the list. Sparkle will return the focus back to
24 // the design surface.
25 private static RoutedCommand _finishEditing;
28 /// Editors may raise this command to switch PropertyContainer mode Inline
30 public static RoutedCommand ShowInlineEditor {
32 if (_showInlineEditor == null)
33 _showInlineEditor = new RoutedCommand("ShowInlineEditor", typeof(PropertyValueEditorCommands));
35 return _showInlineEditor;
40 /// Editors may raise this command to switch PropertyContainer mode ExtendedPopup
42 public static RoutedCommand ShowExtendedPopupEditor {
44 if (_showExtendedPopupEditor == null)
45 _showExtendedPopupEditor = new RoutedCommand("ShowExtendedPopupEditor", typeof(PropertyValueEditorCommands));
47 return _showExtendedPopupEditor;
52 /// Editors may raise this command to switch PropertyContainer mode ExtendedPinned
54 public static RoutedCommand ShowExtendedPinnedEditor {
56 if (_showExtendedPinnedEditor == null)
57 _showExtendedPinnedEditor = new RoutedCommand("ShowExtendedPinnedEditor", typeof(PropertyValueEditorCommands));
59 return _showExtendedPinnedEditor;
64 /// Editors may raise this command to switch PropertyContainer mode Dialog
66 public static RoutedCommand ShowDialogEditor {
68 if (_showDialogEditor == null)
69 _showDialogEditor = new RoutedCommand("ShowDialogEditor", typeof(PropertyValueEditorCommands));
71 return _showDialogEditor;
76 /// Editors may raise this command to begin a transaction.
78 public static RoutedCommand BeginTransaction {
80 if (_beginTransaction == null)
81 _beginTransaction = new RoutedCommand("BeginTransaction", typeof(PropertyValueEditorCommands));
83 return _beginTransaction;
88 /// Editors may raise this command to commit a transaction. If this command is
89 /// executed when there aren't any open transactions, an exception will be thrown.
91 public static RoutedCommand CommitTransaction {
93 if (_commitTransaction == null)
94 _commitTransaction = new RoutedCommand("CommitTransaction", typeof(PropertyValueEditorCommands));
96 return _commitTransaction;
101 /// Editors may raise this command to abort a transaction. If this command is
102 /// executed when there aren't any open transactions, an exception will be thrown.
104 public static RoutedCommand AbortTransaction {
106 if (_abortTransaction == null)
107 _abortTransaction = new RoutedCommand("AbortTransaction", typeof(PropertyValueEditorCommands));
109 return _abortTransaction;
114 /// Editors may raise this command to indicate to the host that they have finished editing.
115 /// This allows the host to do cleanup or potentially change the focus to a different UIElement.
117 public static RoutedCommand FinishEditing {
119 if (_finishEditing == null)
120 _finishEditing = new RoutedCommand("FinishEditing", typeof(PropertyValueEditorCommands));
122 return _finishEditing;