コード例 #1
0
        /// <summary>
        /// Configure a UpDownBase&lt;T&gt; control.
        /// </summary>
        /// <typeparam name="T">Type parameter.</typeparam>
        /// <param name="udbt">UpDownBase&lt;T&gt; control.</param>
        private void ConfigUDB <T>(UpDownBase <T> udbt)
        {
            Debug.Assert(udbt != null, "udb should not be null!");

            udbt.Value = ParseUtility.ReadValue(tbValue, udbt.Value);
            ////udbt.IsCyclic = (bool)cbIsCyclic.IsChecked;
            udbt.IsEditable = (bool)cbIsEditable.IsChecked;
            udbt.IsEnabled  = (bool)cbIsEnabled.IsChecked;
        }
コード例 #2
0
        /// <summary>
        /// Change ContentControl settings (Header, HeaderTemplate, Content, ContentTemplate).
        /// </summary>
        /// <param name="sender">Sender Button.</param>
        /// <param name="e">Event args.</param>
        private void ChangeSettings(object sender, RoutedEventArgs e)
        {
            nud.Minimum       = ParseUtility.ReadValue(tbMininum, nud.Minimum);
            nud.Maximum       = ParseUtility.ReadValue(tbMaximum, nud.Maximum);
            nud.Value         = ParseUtility.ReadValue(tbValue, nud.Value);
            nud.Increment     = ParseUtility.ReadValue(tbIncrement, nud.Increment);
            nud.DecimalPlaces = ParseUtility.ReadValue(tbDecimalPlaces, nud.DecimalPlaces);
            nud.IsEditable    = cbIsEditable.IsChecked ?? false;
            nud.IsEnabled     = cbIsEnabled.IsChecked ?? true;

            OutputNUD();
        }