public FIXED16RuntimeField(FieldModel fieldModel) : base(fieldModel) { _options = new FixedPointOptionWrapper(fieldModel.Options); _editor = new RuntimeFieldEditor <DoubleUpDown>( fieldModel.Name, new DoubleUpDown() { VerticalAlignment = VerticalAlignment.Stretch, HorizontalAlignment = HorizontalAlignment.Stretch, Margin = new Thickness(0), BorderThickness = new Thickness(0), ClipValueToMinMax = true, Minimum = Int16.MinValue / _options.Scale, Maximum = Int16.MaxValue / _options.Scale }); }
public override FieldOptionModel[] EditOptions(FieldOptionModel[] options) { var optionsWrapper = new FixedPointOptionWrapper(options); var viewModel = new FixedPointOptionsViewModel(optionsWrapper); var view = new FixedPointOptionsView() { DataContext = viewModel }; if (view.ShowDialog() == true) { return(optionsWrapper.GetOptions()); } return(null); }
internal FixedPointOptionsViewModel(FixedPointOptionWrapper options) { _options = options; OkCommand = new RelayCommand(Ok, CanOk); CancelCommand = new RelayCommand(Cancel); }