Fix selection issues occured after NUI behaviur change:
* Button is not selectable by default. Enable IsSelectable
proporty to allow applying Selected style.
* When tapped, the selected state changes automatically so using:
button.IsSelected = !button.IsSelecetd actually reverts selection
state.
Change-Id: I506b8dfb804e0399d917fcc85c06a1fb93f9eb59
{
Size = new Size(32, 32),
Position = position,
+ IsSelectable = true,
};
button.Clicked += (s, e) =>
{
this.passwordEntry.Revealed = !this.passwordEntry.Revealed;
- button.IsSelected = !button.IsSelected;
};
return button;
}
{
Size = new Size(48, 48),
Position = new Position(720, 79),
+ IsSelectable = true,
};
revealButton.Clicked += (s, e) => TogglePasswordVisibility();
this.Add(revealButton);
private void TogglePasswordVisibility()
{
passwordEntry.Revealed = !passwordEntry.Revealed;
- revealButton.IsSelected = !revealButton.IsSelected;
}
private void UpdateOKButton()
Size = new Size(72, 32),
Position = new Position(369, 39),
};
+ button.IsSelectable = true;
button.IsSelected = State.IsTurnedOn;
State.OnTurnedOff += () => button.IsSelected = State.IsTurnedOn;