/// <summary> /// Initializes a new instance of the <see cref="GenericAnnotationDialogViewModel{T}"/> class /// </summary> /// <param name="genericAnnotation"> /// The <see cref="GenericAnnotation"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> protected GenericAnnotationDialogViewModel(T genericAnnotation, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(genericAnnotation, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="DerivedQuantityKindDialogViewModel"/> class. /// </summary> /// <param name="derivedQuantityKind"> /// The Derived quantity Kind. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DerivedQuantityKindDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DerivedQuantityKindDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> /// <exception cref="ArgumentException"> /// The container must be of type <see cref="ReferenceDataLibrary"/>. /// </exception> public DerivedQuantityKindDialogViewModel(DerivedQuantityKind derivedQuantityKind, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(derivedQuantityKind, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(vm => vm.Container).Subscribe(_ => this.PopulatePossiblePossibleScales()); this.WhenAnyValue(vm => vm.SelectedDefaultScale).Subscribe(_ => this.UpdateOkCanExecute()); this.QuantityKindFactor.CountChanged.Subscribe(_ => this.UpdateOkCanExecute()); }
/// <summary> /// Initializes a new instance of the <see cref="LinearConversionUnitDialogViewModel"/> class /// </summary> /// <param name="linearConversionUnit"> /// The <see cref="LinearConversionUnit"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public LinearConversionUnitDialogViewModel(LinearConversionUnit linearConversionUnit, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(linearConversionUnit, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { if (container != null) { var containerThing = container as ReferenceDataLibrary; if (containerThing == null) { var errorMessage = string.Format( "The container parameter is of type {0}, it shall be of type ReferenceDataLibrary", container.GetType()); throw new ArgumentException(errorMessage); } } }
/// <summary> /// Initializes a new instance of the <see cref="DomainOfExpertiseDialogViewModel"/> class /// </summary> /// <param name="domain">The <see cref="DomainOfExpertise"/> represented</param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DomainOfExpertiseDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DomainOfExpertiseDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that allows to navigate to <see cref="Thing"/> dialog view models /// </param> /// <param name="container">The container <see cref="Thing"/> for the created <see cref="Thing"/></param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public DomainOfExpertiseDialogViewModel(DomainOfExpertise domain, ThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(domain, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="ElementUsageDialogViewModel"/> class /// </summary> /// <param name="elementUsage"> /// The <see cref="ElementUsage"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public ElementUsageDialogViewModel(ElementUsage elementUsage, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(elementUsage, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { if (container != null) { var containerThing = container as ElementDefinition; if (containerThing == null) { var errorMessage = string.Format( "The container parameter is of type {0}, it shall be of type ElementDefinition", container.GetType()); throw new ArgumentException(errorMessage); } } }
/// <summary> /// Initializes a new instance of the <see cref="IntervalScaleDialogViewModel"/> class. /// </summary> /// <param name="intervalScale"> /// The Simple quantity Kind. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="IntervalScaleDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="IntervalScaleDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> /// <exception cref="ArgumentException"> /// The container must be of type <see cref="ReferenceDataLibrary"/>. /// </exception> public IntervalScaleDialogViewModel(IntervalScale intervalScale, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(intervalScale, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(vm => vm.Container).Subscribe(_ => this.PopulatePossibleUnit()); this.WhenAnyValue(vm => vm.SelectedUnit).Subscribe(_ => this.UpdateOkCanExecute()); }
/// <summary> /// Initializes a new instance of the <see cref="PersonDialogViewModel"/> class. /// </summary> /// <param name="person"> /// The <see cref="Person"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that allows to navigate to <see cref="Thing"/> dialog view models /// </param> /// <param name="container">The container <see cref="Thing"/> for the created <see cref="Thing"/></param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public PersonDialogViewModel(Person person, ThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers = null) : base(person, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.Password = string.Empty; this.WhenAnyValue(vm => vm.PwdEditIsChecked).Subscribe(x => { this.RaisePropertyChanged("Password"); this.RaisePropertyChanged("PasswordConfirmation"); }); }
/// <summary> /// Initializes a new instance of the <see cref="NaturalLanguageDialogViewModel"/> class /// </summary> /// <param name="naturalLanguage">The <see cref="NaturalLanguage"/> represented</param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DomainOfExpertiseDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DomainOfExpertiseDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that allows to navigate to <see cref="Thing"/> dialog view models /// </param> /// <param name="container">The container <see cref="Thing"/> for the created <see cref="Thing"/></param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public NaturalLanguageDialogViewModel(NaturalLanguage naturalLanguage, ThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(naturalLanguage, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
public TestFileRevisionDialogViewModel(FileRevision fileRevision, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNav, Thing container) : base(fileRevision, transaction, session, isRoot, dialogKind, thingDialogNav, container, null) { }
/// <summary> /// Initializes a new instance of the <see cref="MappingToReferenceScaleDialogViewModel"/> class /// </summary> /// <param name="mappingToReferenceScale"> /// The <see cref="MappingToReferenceScale"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public MappingToReferenceScaleDialogViewModel(MappingToReferenceScale mappingToReferenceScale, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(mappingToReferenceScale, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { if (container != null) { var containerThing = container as MeasurementScale; if (containerThing == null) { var errorMessage = string.Format( "The container parameter is of type {0}, it shall be of type MeasurementScale", container.GetType()); throw new ArgumentException(errorMessage); } } }
/// <summary> /// Initializes a new instance of the <see cref="DomainOfExpertiseGroupDialogViewModel"/> class /// </summary> /// <param name="domainOfExpertiseGroup"> /// The <see cref="DomainOfExpertiseGroup"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public DomainOfExpertiseGroupDialogViewModel(DomainOfExpertiseGroup domainOfExpertiseGroup, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(domainOfExpertiseGroup, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { if (container != null) { var containerThing = container as SiteDirectory; if (containerThing == null) { var errorMessage = string.Format( "The container parameter is of type {0}, it shall be of type SiteDirectory", container.GetType()); throw new ArgumentException(errorMessage); } } }
/// <summary> /// Initializes a new instance of the <see cref="RuleVerificationDialogViewModel{T}"/> class /// </summary> /// <param name="ruleVerification"> /// The <see cref="RuleVerification"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> protected RuleVerificationDialogViewModel(T ruleVerification, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(ruleVerification, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { if (container != null) { var containerThing = container as RuleVerificationList; if (containerThing == null) { var errorMessage = string.Format( "The container parameter is of type {0}, it shall be of type RuleVerificationList", container.GetType()); throw new ArgumentException(errorMessage); } } }
/// <summary> /// Initializes a new instance of the <see cref="ParameterOverrideDialogViewModel" /> class /// </summary> /// <param name="parameterOverride"> /// The parameterOverride. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction" /> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession" /> in which the current <see cref="Thing" /> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}" /> is the root of all <see cref="DialogViewModelBase{T}" /> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}" /> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService" /> that is used to navigate to a dialog of a specific /// <see cref="Thing" />. /// </param> /// <param name="container"> /// The Container <see cref="Thing" /> of the created <see cref="MultiRelationshipRule" /> /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container" /> argument /// </param> public ParameterOverrideDialogViewModel(ParameterOverride parameterOverride, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(parameterOverride, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(vm => vm.SelectedOwner).Subscribe(_ => this.UpdateOkCanExecute()); this.WhenAnyValue(vm => vm.ValueSet).Subscribe(_ => this.PopulateValueSet()); this.WhenAnyValue(vm => vm.DisplayedValueSet).Where(x => x != null).Subscribe(_ => this.LoadValueSetGrid()); this.IsNameVisible = this.Thing.ParameterType is CompoundParameterType || this.Thing.IsOptionDependent || this.Thing.StateDependence != null; this.CheckValueValidation(); }
/// <summary> /// Initializes a new instance of the <see cref="ParameterValueDialogViewModel{T}"/> class /// </summary> /// <param name="parameterValue"> /// The <see cref="ParameterValue"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> protected ParameterValueDialogViewModel(T parameterValue, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(parameterValue, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="RequirementDialogViewModel"/> class. /// </summary> /// <param name="requirement"> /// The <see cref="Requirement"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService">The <see cref="IThingDialogNavigationService"/></param> /// <param name="container">The <see cref="RequirementsSpecificationDialogViewModel.container"/> for this <see cref="RequirementsSpecificationDialogViewModel.Thing"/></param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public RequirementDialogViewModel(Requirement requirement, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(requirement, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { if (dialogKind == ThingDialogKind.Create) { var iteration = (Iteration)container.Container; if (this.Session.OpenIterations.TryGetValue(iteration, out var domainOfExpertiseParticipantTuple)) { this.SelectedOwner = domainOfExpertiseParticipantTuple.Item1 ?? this.PossibleOwner.First(); } } this.WhenAnyValue(vm => vm.RequirementText).Subscribe(_ => this.UpdateOkCanExecute()); }
/// <summary> /// Initializes a new instance of the <see cref="GlossaryDialogViewModel"/> class. /// </summary> /// <param name="unitPrefix"> /// The <see cref="UnitPrefix"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="CategoryDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="CategoryDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> /// </param> /// <param name="container"> /// The Container <see cref="Thing"/> of the created <see cref="Thing"/> /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public UnitPrefixDialogViewModel(UnitPrefix unitPrefix, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(unitPrefix, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="ScaleValueDefinitionDialogViewModel"/> class. /// </summary> /// <param name="scaleValueDefinition"> /// The <see cref="ScaleValueDefinition"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="ScaleValueDefinitionDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="ScaleValueDefinitionDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public ScaleValueDefinitionDialogViewModel(ScaleValueDefinition scaleValueDefinition, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(scaleValueDefinition, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="SiteReferenceDataLibraryDialogViewModel"/> class /// </summary> /// <param name="siteRdl">The <see cref="SiteReferenceDataLibrary"/> represented</param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DomainOfExpertiseDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DomainOfExpertiseDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that allows to navigate to <see cref="Thing"/> dialog view models /// </param> /// <param name="container">The container <see cref="Thing"/> for the created <see cref="Thing"/></param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public SiteReferenceDataLibraryDialogViewModel(SiteReferenceDataLibrary siteRdl, ThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(siteRdl, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="ElementUsageDialogViewModel"/> class /// </summary> /// <param name="elementUsage"> /// The <see cref="ElementUsage"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="permissionService"> /// The <see cref="IPermissionService"/> that is used to compute whether the current <see cref="ISession"/> can execute CRUD. /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="isNewContainer"> /// Value indicating whether the container of the <see cref="Thing"/> that is being created is new /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public ElementUsageDialogViewModel(ElementUsage elementUsage, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers = null) : base(elementUsage, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(vm => vm.IncludeOption) .Subscribe( _ => this.ExcludeOption = new ReactiveList <Option>(this.PossibleExcludeOption.Except(this.IncludeOption))); }
/// <summary> /// Initializes a new instance of the <see cref="RelationalExpressionDialogViewModel"/> class /// </summary> /// <param name="relationalExpression"> /// The <see cref="RelationalExpression"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="IThingDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="IThingDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public RelationalExpressionDialogViewModel(RelationalExpression relationalExpression, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(relationalExpression, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(vm => vm.SelectedScale).Subscribe(_ => this.UpdateOkCanExecute()); this.Value.ChangeTrackingEnabled = true; this.Value.ItemChanged.Subscribe(_ => this.UpdateOkCanExecute()); this.WhenAnyValue(vm => vm.SelectedParameterType).Subscribe(_ => { this.PopulatePossibleScale(); this.PopulateValue(); this.UpdateOkCanExecute(); }); }
/// <summary> /// Initializes a new instance of the <see cref="MultiRelationshipRuleDialogViewModel"/> class. /// </summary> /// <param name="multiRelationshipRule"> /// The <see cref="CDP4Common.SiteDirectoryData.MultiRelationshipRule"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="CDP4Common.CommonData.Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="MultiRelationshipRuleDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="MultiRelationshipRuleDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The Container <see cref="CDP4Common.CommonData.Thing"/> of the created <see cref="CDP4Common.SiteDirectoryData.MultiRelationshipRule"/> /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public MultiRelationshipRuleDialogViewModel(MultiRelationshipRule multiRelationshipRule, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(multiRelationshipRule, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(vm => vm.Container).Subscribe(_ => this.RepopulatePossibleCategories()); this.WhenAnyValue(vm => vm.Container).Subscribe(_ => this.UpdateOkCanExecute()); this.WhenAnyValue(vm => vm.SelectedRelationshipCategory).Subscribe(_ => this.UpdateOkCanExecute()); this.WhenAnyValue(vm => vm.RelatedCategory).Subscribe(_ => this.UpdateOkCanExecute()); }
/// <summary> /// Initializes a new instance of the <see cref="DerivedUnitDialogViewModel"/> class. /// </summary> /// <param name="derivedUnit"> /// The <see cref="DerivedUnit"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DerivedUnitDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DerivedUnitDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public DerivedUnitDialogViewModel(DerivedUnit derivedUnit, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(derivedUnit, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { var canCreateCondition = this.WhenAnyValue(vm => vm.Container).Select(x => x != null); this.CreateUnitFactorCommand = ReactiveCommand.Create(canCreateCondition); this.CreateUnitFactorCommand.Subscribe(_ => this.ExecuteCreateCommand <UnitFactor>(this.PopulateUnitFactor)); this.WhenAnyValue(vm => vm.Container).Subscribe(_ => this.UpdateOkCanExecute()); }
/// <summary> /// Initializes a new instance of the <see cref="IterationSetupDialogViewModel"/> class /// </summary> /// <param name="iterationSetup"> /// The <see cref="IterationSetup"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="thingTransaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="DialogViewModelBase{T}"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public IterationSetupDialogViewModel(IterationSetup iterationSetup, IThingTransaction thingTransaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers = null) : base(iterationSetup, thingTransaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(x => x.SelectedSourceIterationSetupRow) .Subscribe(x => { this.SelectedSourceIterationSetup = (x == null) ? null : x.IterationSetup; this.UpdateOkCanExecute(); }); }
/// <summary> /// Initializes a new instance of the <see cref="FileDialogViewModel"/> class. /// </summary> /// <param name="file"> /// The <see cref="File"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name=""></param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="FileDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="FileDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> /// </param> /// <param name="container"> /// The Container <see cref="Thing"/> of the created <see cref="Thing"/> /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public FileDialogViewModel(File file, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(file, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.PopulatePossibleCategories(); this.WhenAnyValue( vm => vm.IsLocked).Subscribe( x => { this.SelectedLockedBy = x ? this.currentPerson : null; }); this.WhenAnyValue( vm => vm.SelectedLockedBy).Subscribe( x => { this.LockedBy = x?.Name; this.AllowEdit = !this.IsLockedByAnotherPerson(); }); this.WhenAnyValue( vm => vm.SelectedOwner, vm => vm.SelectedLockedBy, vm => vm.FileRevision) .Subscribe(_ => this.UpdateOkCanExecute()); this.Disposables.Add(this.FileRevision.Changed.Subscribe(_ => this.UpdateOkCanExecute())); }
/// <summary> /// Initializes a new instance of the <see cref="TextParameterTypeDialogViewModel"/> class. /// </summary> /// <param name="textParameterType"> /// The text Parameter Type. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="TextParameterTypeDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="TextParameterTypeDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public TextParameterTypeDialogViewModel(TextParameterType textParameterType, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(textParameterType, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="DecompositionRuleDialogViewModel"/> class. /// </summary> /// <param name="decompositionRule"> /// The <see cref="DecompositionRule"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="MultiRelationshipRuleDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="MultiRelationshipRuleDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService">The <see cref="IThingDialogNavigationService"/></param> /// <param name="container">The Container <see cref="Thing"/> of the created <see cref="Thing"/></param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public DecompositionRuleDialogViewModel(DecompositionRule decompositionRule, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(decompositionRule, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { }
/// <summary> /// Initializes a new instance of the <see cref="SimpleUnitDialogViewModel"/> class. /// </summary> /// <param name="simpleUnit"> /// The <see cref="SimpleUnit"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="SimpleUnitDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="SimpleUnitDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The <see cref="Thing"/> that contains the created <see cref="Thing"/> in this Dialog /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public SimpleUnitDialogViewModel(SimpleUnit simpleUnit, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(simpleUnit, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(vm => vm.Container).Subscribe(_ => this.UpdateOkCanExecute()); }
/// <summary> /// Initializes a new instance of the <see cref="DialogViewModelBase{T}"/> class /// </summary> /// <param name="thingClone">The clone of the <see cref="Thing"/> that this dialog belongs to.</param> /// <param name="parentTransaction"> /// The parent <see cref="ThingTransaction"/> that contains the log of recorded changes at the previous level. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="DialogViewModelBase{T}"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="DialogViewModelBase{T}"/> performs /// </param> /// <param name="thingDialogNavigationService">The <see cref="IThingDialogNavigationService"/></param> /// <param name="container">The <see cref="Thing"/> that contains the created one in this <see cref="DialogViewModelBase{T}"/></param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> /// <remarks> /// <paramref name="thingClone"/> shall always be a clone when opening a dialog to create or edit a thing. /// </remarks> protected DialogViewModelBase(T thingClone, IThingTransaction parentTransaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container, IEnumerable <Thing> chainOfContainers) : base(thingClone, session) { // add the animation uri path this.AnimationUri = string.Format("{0}{1}", Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), CdpLogoAnimationPath); this.LoadingMessage = "Processing..."; this.InitializeSpellingChecker(); this.thingDialogNavigationService = thingDialogNavigationService; this.PossibleContainer = new ReactiveList <Thing>(); this.Container = container; this.parentTransaction = parentTransaction; this.isRoot = isRoot; this.dialogKind = dialogKind; this.serializer = new Cdp4JsonSerializer(this.Session.Dal.MetaDataProvider, this.Session.DalVersion); this.ChainOfContainer = (chainOfContainers != null) ? chainOfContainers.ToList() : new List <Thing>(); this.ChainOfContainer.Add(this.Container); this.WhenAnyValue(vm => vm.Container) .Where(x => x != null) .Subscribe(_ => this.UpdateChainOfContainer()); this.Initialize(); this.InitializeCommands(); this.UpdateProperties(); this.WhenAnyValue(x => x.WriteException).Select(x => x != null).ToProperty(this, x => x.HasException, out this.hasException); switch (this.dialogKind) { case ThingDialogKind.Create: this.transaction = new ThingTransaction(this.Thing, (ThingTransaction)parentTransaction, container); break; case ThingDialogKind.Update: this.transaction = new ThingTransaction(this.Thing, (ThingTransaction)parentTransaction, container); break; case ThingDialogKind.Inspect: break; default: throw new InvalidEnumArgumentException("The provided dialogKind is Invalid"); } }
/// <summary> /// Initializes a new instance of the <see cref="GlossaryDialogViewModel"/> class. /// </summary> /// <param name="fileType"> /// The <see cref="FileType"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="CategoryDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="CategoryDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> /// </param> /// <param name="container"> /// The Container <see cref="Thing"/> of the created <see cref="Thing"/> /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public FileTypeDialogViewModel(FileType fileType, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(fileType, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(x => x.Container).Subscribe(_ => this.PopulateCategory()); }
/// <summary> /// Initializes a new instance of the <see cref="ParameterizedCategoryRuleDialogViewModel"/> class. /// </summary> /// <param name="parameterizedCategoryRule"> /// The <see cref="CDP4Common.SiteDirectoryData.ParameterizedCategoryRule"/> that is the subject of the current view-model. This is the object /// that will be either created, or edited. /// </param> /// <param name="transaction"> /// The <see cref="ThingTransaction"/> that contains the log of recorded changes. /// </param> /// <param name="session"> /// The <see cref="ISession"/> in which the current <see cref="CDP4Common.CommonData.Thing"/> is to be added or updated /// </param> /// <param name="isRoot"> /// Assert if this <see cref="ParameterizedCategoryRuleDialogViewModel"/> is the root of all <see cref="IThingDialogViewModel"/> /// </param> /// <param name="dialogKind"> /// The kind of operation this <see cref="ParameterizedCategoryRuleDialogViewModel"/> performs /// </param> /// <param name="thingDialogNavigationService"> /// The <see cref="IThingDialogNavigationService"/> that is used to navigate to a dialog of a specific <see cref="Thing"/>. /// </param> /// <param name="container"> /// The Container <see cref="CDP4Common.CommonData.Thing"/> of the created <see cref="CDP4Common.SiteDirectoryData.ParameterizedCategoryRule"/> /// </param> /// <param name="chainOfContainers"> /// The optional chain of containers that contains the <paramref name="container"/> argument /// </param> public ParameterizedCategoryRuleDialogViewModel(ParameterizedCategoryRule parameterizedCategoryRule, IThingTransaction transaction, ISession session, bool isRoot, ThingDialogKind dialogKind, IThingDialogNavigationService thingDialogNavigationService, Thing container = null, IEnumerable <Thing> chainOfContainers = null) : base(parameterizedCategoryRule, transaction, session, isRoot, dialogKind, thingDialogNavigationService, container, chainOfContainers) { this.WhenAnyValue(vm => vm.Container).Subscribe(_ => { this.PopulatePossibleCategory(); this.PopulatePossibleParameterTypes(); this.UpdateOkCanExecute(); }); this.WhenAnyValue(vm => vm.ParameterType.Count).Subscribe(_ => this.UpdateOkCanExecute()); }