Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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();
            }
        }
Esempio n. 5
0
        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();
            }
        }
Esempio n. 6
0
 public Diffusion()
 {
     InitializeComponent();
     ActionViewBase.LoadLocaleResources(this);
     this.DataContextChanged += OnDataContextChanged;
 }
Esempio n. 7
0
 public Overview()
 {
     InitializeComponent();
     ActionViewBase.LoadLocaleResources(this);
 }