private void OnCanOpenDialogWindow(object sender, CanExecuteRoutedEventArgs eventArgs) { DataTemplate dialogEditorTemplate = PropertyEditingHelper.GetDialogEditorTemplate(PropertyEditingHelper.GetEditedProperty(eventArgs.OriginalSource, eventArgs.Parameter)); eventArgs.CanExecute = dialogEditorTemplate != null; eventArgs.Handled = true; }
public EasingFunctionEditor() { this.InitializeComponent(); this.propertyHelper = new PropertyEditingHelper((UIElement)this.SubPropertiesContainer); this.DataContextChanged += new DependencyPropertyChangedEventHandler(this.EasingFunctionEditor_DataContextChanged); this.Loaded += new RoutedEventHandler(this.EasingFunctionEditor_Loaded); this.Unloaded += new RoutedEventHandler(this.EasingFunctionEditor_Unloaded); }
private void SwitchPropertyContainerMode(ExecutedRoutedEventArgs eventArgs, PropertyContainerEditMode newMode) { PropertyContainer propertyContainer = PropertyEditingHelper.GetPropertyContainer(eventArgs.OriginalSource); if (propertyContainer == null) { return; } propertyContainer.set_ActiveEditMode(newMode); eventArgs.Handled = true; }
public TransitionEffectPickerEditor() { this.InitializeComponent(); this.propertyHelper = new PropertyEditingHelper((UIElement)this.SubPropertiesContainer); this.transitionEffects.Add(new TransitionEffectInfo((Asset)null)); this.transitionEffects.Add(new TransitionEffectInfo((Asset)null) { IsLoadingPlaceholder = true }); this.hasLoadingPlaceholder = true; this.DataContextChanged += new DependencyPropertyChangedEventHandler(this.TransitionEffectPickerEditor_DataContextChanged); this.Loaded += new RoutedEventHandler(this.TransitionEffectPickerEditor_Loaded); this.Unloaded += new RoutedEventHandler(this.TransitionEffectPickerEditor_Unloaded); }
private void OnBeginTransactionCore(object originalSource, object parameter) { if (this.ActiveDocument == null) { return; } FrameworkElement element = originalSource as FrameworkElement; if (element != null) { this.HookEditEndingHandlers(element); } string description = string.Format((IFormatProvider)CultureInfo.CurrentCulture, StringTable.PropertyChangeUndoDescription, new object[1] { (object)"Property" }); string str = parameter as string; PropertyTransactionParameters transactionParameters = parameter as PropertyTransactionParameters; SceneEditTransactionType transactionType = SceneEditTransactionType.AutoCommitting; if (transactionParameters != null) { description = transactionParameters.TransactionDescription; transactionType = transactionParameters.TransactionType; } else if (str != null) { description = str; } else { PropertyContainer propertyContainer; if ((propertyContainer = PropertyEditingHelper.GetPropertyContainer(originalSource)) != null) { description = string.Format((IFormatProvider)CultureInfo.CurrentCulture, StringTable.PropertyChangeUndoDescription, new object[1] { (object)propertyContainer.get_PropertyEntry().get_PropertyName() }); } } this.editTransactions.Push(this.ActiveDocument.CreateEditTransaction(description, false, transactionType)); }
private void OnOpenDialogWindow(object sender, ExecutedRoutedEventArgs eventArgs) { PropertyReferenceProperty referenceProperty = (PropertyReferenceProperty)PropertyEditingHelper.GetEditedProperty(eventArgs.OriginalSource, eventArgs.Parameter); DataTemplate dialogEditorTemplate = PropertyEditingHelper.GetDialogEditorTemplate((PropertyEntry)referenceProperty); if (dialogEditorTemplate == null) { return; } Dialog dialog = (Dialog) new DialogValueEditorHost(referenceProperty.get_PropertyValue(), dialogEditorTemplate); int remaining = 0; SceneEditTransaction sceneEditTransaction = (SceneEditTransaction)null; if (this.ActiveDocument != null) { this.CommitOutstandingTransactions(0); sceneEditTransaction = this.ActiveDocument.CreateEditTransaction(string.Format((IFormatProvider)CultureInfo.CurrentCulture, StringTable.DialogValueEditorUndoDescription, new object[1] { (object)referenceProperty.get_DisplayName() })); this.editTransactions.Push(sceneEditTransaction); remaining = this.editTransactions.Count; } bool?nullable = dialog.ShowDialog(); if (this.ActiveDocument != null) { this.CommitOutstandingTransactions(remaining); if (nullable.HasValue && nullable.Value) { sceneEditTransaction.Commit(); } else { sceneEditTransaction.Cancel(); } this.editTransactions.Pop(); } eventArgs.Handled = true; }