Пример #1
0
        /// <summary>
        /// CheckBox
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ckCheckBox_Unchecked(object sender, RoutedEventArgs e)
        {
            ComboBox tb = sender as ComboBox;

            if (tb == null)
            {
                return;
            }
            if (tb.SelectedItem == null)
            {
                return;
            }
            PropertyModel p = tb.Tag as PropertyModel;

            if (p == null)
            {
                return;
            }
            KeyCaption k = tb.SelectedItem as KeyCaption;

            if (p.ComboBoxValueType == 0)
            {
                p.Value = k.Caption;
            }
            else
            {
                p.Value = k.ID;
            }
        }
Пример #2
0
        private void UpdatePropertyFromComboBox(object sender)
        {
            ComboBox tb = sender as ComboBox;

            if (tb == null)
            {
                return;
            }
            if (tb.SelectedItem == null)
            {
                return;
            }
            PropertyModel p = tb.Tag as PropertyModel;

            if (p == null)
            {
                return;
            }
            KeyCaption k = tb.SelectedItem as KeyCaption;

            if (p.ComboBoxValueType == 0)
            {
                p.Value = k.Caption;
            }
            else
            {
                p.Value = k.ID;
            }
            DealWithSpecialPrintControl((ContentControlBase)CurrentPrintControl, p);
        }
        private void cbSource_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            KeyCaption k = cbSource.SelectedItem as KeyCaption;

            if (k != null)
            {
                CurrentPrintControl.DataSourceType = k.ID;
            }
        }