private void InitQRInput() { TextBox qrInputTextBox = (TextBox)this.FindName("QRInput"); Binding binding = new Binding("CurrentUserQRIndex") { Mode = BindingMode.TwoWay, Converter = new ZeroBasedIndexToOneBasedIndex(), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, }; ActionViewBase.InitUserInputField(qrInputTextBox, binding, 1, 4, ViewModel.QRInputHandler); }
private void InitRoundInput() { TextBox roundInputTextBox = (TextBox)this.FindName("RoundInput"); int maxRound = ViewModel.Settings.Rounds; Binding binding = new Binding("CurrentUserRoundIndex") { Mode = BindingMode.TwoWay, Converter = new ZeroBasedIndexToOneBasedIndex(), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, }; ActionViewBase.InitUserInputField(roundInputTextBox, binding, 1, maxRound, ViewModel.RoundInputHandler); }
private void InitKeystreamBlockInput() { TextBox keystreamBlockInput = (TextBox)this.FindName("KeystreamBlockInput"); int maxKeystreamBlock = ViewModel.ChaCha.TotalKeystreamBlocks; Binding binding = new Binding("CurrentKeystreamBlockIndex") { Mode = BindingMode.TwoWay, Converter = new ZeroBasedIndexToOneBasedIndex(), UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged, }; ActionViewBase.InitUserInputField(keystreamBlockInput, binding, 1, maxKeystreamBlock, ViewModel.KeystreamBlockInputHandler); }