Пример #1
0
        public ConvertValue()
        {
            Application.Current.MainWindow.Title = "Конвертер валют";
            InitializeComponent();
            ConvertingMoney[] inputs = ParsingJson.ListConvertMoney.GetRange(0, 2).ToArray();
            if (ConvertingValuesMoney.СheckButton1 != true && ConvertingValuesMoney.Convert1Text == null)
            {
                ValueElement1.convertName.Content     = inputs[0].IdMoney;
                ConvertingValuesMoney.Convert1Text    = inputs[0].IdMoney;
                ConvertingValuesMoney.Convert1Value   = inputs[0].ValueMoney;
                ConvertingValuesMoney.Convert1Nominal = inputs[0].NominalMoney;
            }
            else
            {
                ValueElement1.convertName.Content = ConvertingValuesMoney.Convert1Text;
                ValueElement1.convertSum.Text     = ConvertingValuesMoney.PrintSum1;
                string dataText = ValueElement1.convertSum.Text;
                ValueElement2.convertSum.Text = ConvertingValuesMoney.Convert1Convert2(dataText);
            }

            if (ConvertingValuesMoney.СheckButton2 != true && ConvertingValuesMoney.Convert2Text == null)
            {
                ValueElement2.convertName.Content     = inputs[1].IdMoney;
                ConvertingValuesMoney.Convert2Text    = inputs[1].IdMoney;
                ConvertingValuesMoney.Convert2Value   = inputs[1].ValueMoney;
                ConvertingValuesMoney.Convert2Nominal = inputs[1].NominalMoney;
            }
            else
            {
                ValueElement2.convertName.Content = ConvertingValuesMoney.Convert2Text;
                ValueElement2.convertSum.Text     = ConvertingValuesMoney.PrintSum2;
                string dataText = ValueElement1.convertSum.Text;
                ValueElement2.convertSum.Text = ConvertingValuesMoney.Convert1Convert2(dataText);
            }
        }
Пример #2
0
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            ConvertingValuesMoney.TranspositionConvert();
            ValueElement1.convertName.Content = ConvertingValuesMoney.Convert1Text;
            ValueElement2.convertName.Content = ConvertingValuesMoney.Convert2Text;
            string dataText = ValueElement1.convertSum.Text;

            ValueElement2.convertSum.Text = ConvertingValuesMoney.Convert1Convert2(dataText);
        }
Пример #3
0
        private void TextChangedConvertSum2(object sender, RoutedEventArgs e)
        {
            string dataText = ValueElement2.convertSum.Text;

            if (ValueElement2.convertSum.IsFocused == true)
            {
                ValueElement1.convertSum.Text = ConvertingValuesMoney.Convert2Convert1(dataText);
            }
        }