private void ActionSelectedItem(string arg1, object arg2) { var name = (string)arg2; var isExist = CheckExist((string)arg2); SetPreviewAppearance(isExist); switch (arg1) { case "SelectedItem": BindStorage.TurnActionFor("FileName", false); FileName = name; BindStorage.TurnActionFor("FileName", true); RenderPreview(name); break; case "FileName": if (isExist) { BindStorage.TurnActionFor("SelectedItem", false); SelectedIndex = ListItems.IndexOf(name); BindStorage.TurnActionFor("SelectedItem", true); RenderPreview(name); } break; } }
public ComponTransformViewModel() { _transformModel = new TransformModel(); _flameColorMode = FlameColorMode.Color; Command = new RelayCommand(CommandHandler); GradientModel = new GradientModel(Colors.Gray, Colors.Gray); ColorPosition = .5; FColor = Colors.Gray; Parameter1Visibility = Visibility.Collapsed; Parameter2Visibility = Visibility.Collapsed; Parameter3Visibility = Visibility.Collapsed; Parameter4Visibility = Visibility.Collapsed; Variations = VariationFactoryModel.StaticVariationFactory.VariationNames; VariationSelected = "Linear"; BindStorage.SetActionFor(ActionValueChanged, _propParameters); BindStorage.SetActionFor(ActionValueChanged, _propValues2); BindStorage.SetActionFor(ActionTransformValueChanged, _propValues); BindStorage.SetActionFor(ActionVariationChanged, _propVariation); SetCoefficients(); }
private void Init() { CommandCanvasLoaded = new RelayCommand(CommandCanvasLoadedHandler); CommandCanvasMouseDown = new RelayCommand(CommandCanvasMouseDownHandler); CommandCanvasMouseUp = new RelayCommand(CommandCanvasMouseUpHandler); CommandCanvasMouseMove = new RelayCommand(CommandCanvasMouseMoveHandler); Command = new RelayCommand(CommandHandler); _cubeEllipse = new Ellipse { Width = 16.0, Height = 16.0, Stroke = Brushes.WhiteSmoke, StrokeThickness = 1 }; _columnArrows = Application.Current.TryFindResource("ArrowsBox") as Canvas; if (_columnArrows != null) { _columnArrows.Height = 8.0; } ColorCurrent = new SolidColorBrush(_initialColor); RadioH = true; BindStorage.SetActionFor(ActRadio, "RadioH", "RadioS", "RadioV", "RadioR", "RadioG", "RadioB"); BindStorage.SetActionFor(ActText, "TextH", "TextS", "TextV", "TextR", "TextG", "TextB", "TextHex"); }
public PanelTransformsViewModel() { Command = new RelayCommand(Handler); Transforms = new ObservableCollection <PanelTransform>(); ActionFire.AddOrReplace("panel-transform-remove", new Action <int>(HandlerTransformRemove), GetType()); PanelModel = new PanelModel(); BindStorage.SetActionFor(HandlerChanged, "Transforms", "Final"); }
public void Freeze(bool state) { _isFrozen = state; BindStorage.FreezeFor(state, _propParameters); BindStorage.FreezeFor(state, _propValues); BindStorage.FreezeFor(state, _propValues2); BindStorage.Set("IsVariationSelectEnabled", !state); }
public FileViewModel() { ListItems = new ObservableCollection <string>(); Command = new RelayCommand(CommandHandler); BindStorage.SetActionFor("SelectedItem", ActionSelectedItem); BindStorage.SetActionFor("FileName", ActionSelectedItem); PreviewBorder1 = new Thickness(0); SelectedIndex = -1; }
public void Set(RenderSettingsModel renderSettings, Action callback) { BindStorage.SetActionFor("RenderByQuality", ActionRenderByQuality); _renderSettings = renderSettings; ShotsPerIteration = _renderSettings.ShotsPerIteration * 0.001; Iterations = _renderSettings.Iterations * 0.001; RenderPerIterations = _renderSettings.RenderPerIterations; RenderColorMode = new RenderColorModeModel(); RenderColorMode.SetMode(_renderSettings.RenderColorMode); Quality = renderSettings.Quality; if (renderSettings.RenderByQuality) { RenderByQuality = true; } _callback = callback; }
public PanelTransformViewModel() { Command = new RelayCommand(HandlerCommand); Id = Guid.NewGuid().GetHashCode(); BindStorage.SetActionAll(HandlerItemChanged); }