コード例 #1
0
        /// <summary>
        /// Handles a change to the animation speed.
        /// </summary>
        /// <param name="dependencyObject">The object that owns the property.</param>
        /// <param name="dependencyPropertyChangedEventArgs">A description of the changed property.</param>
        private static void OnAnimationSpeedChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            // Set the speed for animation.
            ReportCreditCard reportPrototype = dependencyObject as ReportCreditCard;
            AnimationSpeed   animationSpeed  = (AnimationSpeed)dependencyPropertyChangedEventArgs.NewValue;

            reportPrototype.Duration = ReportCreditCard.animationDurations[(Int32)animationSpeed];
        }
コード例 #2
0
        private void OnTextChanged(object sender, RoutedEventArgs routedEventArgs)
        {
            TextBox          textBox = routedEventArgs.OriginalSource as TextBox;
            ReportCreditCard report  = sender as ReportCreditCard;

            if (textBox == null || report == null)
            {
                return;
            }

            if (InputHelper.IsUserInitiated(textBox, TextBox.TextProperty))
            {
                report.CurrentSelectionChanged = true;
            }
        }
コード例 #3
0
        /// <summary>
        /// Handler for the textbox class.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="routedEventArgs"></param>
        private void OnTextBoxLostFocus(object sender, RoutedEventArgs routedEventArgs)
        {
            TextBox          textBox = routedEventArgs.OriginalSource as TextBox;
            ReportCreditCard report  = sender as ReportCreditCard;

            if (textBox == null || report == null)
            {
                return;
            }

            IContent iContent = textBox.DataContext as IContent;

            // This filters all the ComboBox events looking for user initiated actions that are bound to the data model.
            if (report.CurrentSelectionChanged == true &&
                iContent != null && iContent.Key is DataTableCoordinate)
            {
                TextBoxValueChanged(textBox.Text, iContent);
                report.CurrentSelectionChanged = false;
            }
        }