/** This is called from Parameter-View on selection change */ public void FindAndShowPresetsForSelectedOp() { var op = App.Current.MainWindow.XParameterView.ShownOperator; if (op == null || op.Definition == null || _operatorPresetsByMetaOpID == null) { return; } if (_operatorPresetsByMetaOpID.ContainsKey(op.Definition.ID)) { CurrentOperatorPresets.Clear(); foreach (var p in _operatorPresetsByMetaOpID[op.Definition.ID]) { if (p.IsInstancePreset && p.OperatorInstanceID != op.ID) { continue; } CurrentOperatorPresets.Add(p); // FIXME: This triggers update events for each preset. Needs refactoring to new custom observable collection that enables range setting } HighlightActivePreset(); } else { CurrentOperatorPresets.Clear(); } if (LivePreviewEnabled) { RerenderThumbnails(); } }
public void UpdateAllThumbnails() { var keepList = CurrentOperatorPresets.ToArray(); CurrentOperatorPresets.Clear(); // We rebuild the list to trigger update notification of the observable collection foreach (var preset in keepList) { PreviewPreset(preset); RenderAndSaveThumbnail(preset); RestorePreviewPreset(); CurrentOperatorPresets.Add(preset); } }
public void RerenderThumbnails() { PresetImageManager.ReleasePreviousImages(); var keepList = CurrentOperatorPresets.ToArray(); CurrentOperatorPresets.Clear(); // We rebuild the list to trigger update notification of the observable collection foreach (var preset in keepList) { PreviewPreset(preset); if (!LivePreviewEnabled) { PresetImageManager.RenderAndSaveThumbnail(preset); } else { PresetImageManager.RenderImageForPreset(preset); } RestorePreviewPreset(); CurrentOperatorPresets.Add(preset); } }
public void FilterPresetsForSelectedOperator() { var op = App.Current.MainWindow.XParameterView.ShownOperator; if (op == null || op.Definition == null || _operatorPresetsByMetaOpID == null) { return; } if (_operatorPresetsByMetaOpID.ContainsKey(op.Definition.ID)) { CurrentOperatorPresets.Clear(); foreach (var p in _operatorPresetsByMetaOpID[op.Definition.ID]) { CurrentOperatorPresets.Add(p); // FIXME: This triggers update events for each preset. Needs refactoring to new custom observable collection that enables range setting } SelectActivePreset(); } else { CurrentOperatorPresets.Clear(); } }