Beispiel #1
0
        private static void OnChangeTypeChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            AmountControl owner = o as AmountControl;

            if (owner == null)
            {
                return;
            }

            ChangeTypes?changeType = e.NewValue as ChangeTypes?;

            if (!changeType.HasValue)
            {
                owner.ChangedPath.Visibility = Visibility.Collapsed;
                return;
            }

            if (changeType == ChangeTypes.Up)
            {
                owner.ChangedPath.Visibility          = Visibility.Visible;
                owner.ChangePathOffsetColor.Color     = Colors.Red;
                owner.ChangedPathRenderTransorm.Angle = 0;
            }
            else if (changeType == ChangeTypes.Down)
            {
                owner.ChangedPath.Visibility          = Visibility.Visible;
                owner.ChangePathOffsetColor.Color     = Colors.Green;
                owner.ChangedPathRenderTransorm.Angle = 180;
            }
            else
            {
                owner.ChangedPath.Visibility = Visibility.Collapsed;
            }
        }
Beispiel #2
0
        private static void OnTitleChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            AmountControl owner = o as AmountControl;

            if (owner == null)
            {
                return;
            }

            owner.TitleTextBox.Text = e.NewValue as string;
        }
Beispiel #3
0
        private static void OnAmountChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            AmountControl owner = o as AmountControl;

            if (owner == null)
            {
                return;
            }

            int?amount = e.NewValue as int?;

            if (amount.HasValue)
            {
                owner.AmountTextBox.Text = amount.ToString();
            }
            else
            {
                owner.AmountTextBox.Text = "0";
            }
        }