/// <summary>
 /// Initializes a new instance of the <see cref="IndependentParameterTypeAssignmentRowViewModel"/> class.
 /// </summary>
 /// <param name="thing">The <see cref="Thing"/> represented by the row</param>
 /// <param name="interpolationPeriod">The <see cref="InterpolationPeriod"/></param>
 /// <param name="session">The session</param>
 /// <param name="containerViewModel">The parent Row</param>
 public IndependentParameterTypeAssignmentRowViewModel(IndependentParameterTypeAssignment thing, string interpolationPeriod, ISession session, SampledFunctionParameterTypeDialogViewModel containerViewModel) : base(thing, session, containerViewModel)
 {
     this.InterpolationPeriod = interpolationPeriod;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DependentParameterTypeAssignmentRowViewModel"/> class.
 /// </summary>
 /// <param name="thing">The <see cref="Thing"/> represented by the row</param>
 /// <param name="session">The session</param>
 /// <param name="containerViewModel">The parent Row</param>
 public DependentParameterTypeAssignmentRowViewModel(DependentParameterTypeAssignment thing, ISession session, SampledFunctionParameterTypeDialogViewModel containerViewModel) : base(thing, session, containerViewModel)
 {
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ParameterTypeAssignmentRowViewModel{T}" /> class.
        /// </summary>
        /// <param name="thing">The <see cref="Thing" /> represented by the row</param>
        /// <param name="session">The session</param>
        /// <param name="containerViewModel">The parent Row</param>
        protected ParameterTypeAssignmentRowViewModel(IParameterTypeAssignment thing, ISession session, SampledFunctionParameterTypeDialogViewModel containerViewModel) : base((T)thing, session, containerViewModel)
        {
            this.PossibleScale    = new ReactiveList <MeasurementScale>();
            this.FilteringOptions = new Dictionary <string, Type>();
            this.FilteringOptions.Add(string.Empty, null);

            foreach (var type in TypeResolver.GetDerivedTypes(typeof(ParameterType), typeof(ParameterType).Assembly).Where(x => !x.IsAbstract))
            {
                this.FilteringOptions.Add(type.Name, type);
            }

            this.possibleParameterTypes = containerViewModel.PossibleParameterTypes;
            this.PossibleParameterType  = new ReactiveList <ParameterType>();

            this.PossibleParameterType.ChangeTrackingEnabled = true;

            this.PossibleParameterType.AddRange(this.possibleParameterTypes);

            this.Disposables.Add(
                this.WhenAnyValue(x => x.ParameterType).Subscribe(
                    _ =>
            {
                this.PopulatePossibleScale();
                containerViewModel.UpdateOkCanExecuteStatus();
            }));

            this.IsReadOnly = containerViewModel.IsReadOnly || !containerViewModel.IsCreateDialog();

            this.SelectedFilter = null;
            this.Disposables.Add(this.WhenAnyValue(x => x.SelectedFilter).Subscribe(_ => this.FilterPossibleParameterType()));
            this.UpdateProperties();
        }