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); }
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { ViewModel = (ChaChaHashViewModel)e.NewValue; if (ViewModel != null) { // On page enter, the real DOM and virtual DOM should be in sync. DomSync(); ViewModel.PropertyChanged += new PropertyChangedEventHandler(OnViewModelPropertyChange); ActionViewBase.AddEventHandlers(ViewModel, Root); InitKeystreamBlockInput(); InitRoundInput(); InitQRInput(); } }
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { StateMatrixInitViewModel ViewModel = (StateMatrixInitViewModel)e.NewValue; if (ViewModel != null) { ActionViewBase.AddEventHandlers(ViewModel, Root); this.ViewModel = ViewModel; // State parameter diffusion values InitDiffusionStateParameters(); // State encoding diffusion values InitDiffusionStateEncoding(); // State matrix diffusion values InitDiffusionStateMatrix(); } }
public Diffusion() { InitializeComponent(); ActionViewBase.LoadLocaleResources(this); this.DataContextChanged += OnDataContextChanged; }
public Overview() { InitializeComponent(); ActionViewBase.LoadLocaleResources(this); }