diff --git a/src/Lithnet.CredentialProvider/Controls/SubmitButtonControl.cs b/src/Lithnet.CredentialProvider/Controls/SubmitButtonControl.cs index eb60da3..8aa30c5 100644 --- a/src/Lithnet.CredentialProvider/Controls/SubmitButtonControl.cs +++ b/src/Lithnet.CredentialProvider/Controls/SubmitButtonControl.cs @@ -7,6 +7,8 @@ namespace Lithnet.CredentialProvider /// public class SubmitButtonControl : ControlBase { + private ControlBase adjacentToControl; + /// /// Creates a new control /// @@ -22,24 +24,40 @@ namespace Lithnet.CredentialProvider /// The control that the submit button should appear adjacent to public SubmitButtonControl(string key, string label, ControlBase adjacentToControl) : base(key, label, FieldType.Submit) { - this.AdjacentToId = adjacentToControl.Id; - this.AdjacentToKey = adjacentToControl.Key; this.State = FieldState.DisplayInSelectedTile; + this.adjacentToControl = adjacentToControl; + } + + /// + /// Gets or sets the control that the button is adjacent to + /// + public ControlBase AdjacentToControl + { + get + { + return this.adjacentToControl; + } + set + { + this.adjacentToControl = value; + this.Events?.SetFieldSubmitButton(this.Credential, this.Id, this.adjacentToControl.Id); + this.RaisePropertyChanged(); + } } /// /// Gets the unique ID of the control that the button is adjacent to /// - public string AdjacentToKey { get; } + public string AdjacentToKey => this.adjacentToControl?.Key; - internal uint AdjacentToId { get; private set; } + internal uint AdjacentToId => this.adjacentToControl.Id; private SubmitButtonControl(SubmitButtonControl source) : base(source) { } internal override ControlBase Clone() { var clone = new SubmitButtonControl(this); - clone.AdjacentToId = this.AdjacentToId; + clone.adjacentToControl = this.adjacentToControl; return clone; }