Example #1
0
        private void CameraSettingsCB_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var selection = vm.CurrentCameraSettings;

            if (DescriptionTextBox != null)
            {
                //CameraSettingIDTextBlock.GetBindingExpression(TextBlock.TextProperty).UpdateTarget();
                DescriptionTextBox.GetBindingExpression(TextBox.TextProperty).UpdateTarget();
                VSSCombo.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateTarget();
                HSSCombo.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateTarget();
                VertClockAmpCombo.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateTarget();
                UseEMGainCkBx.GetBindingExpression(CheckBox.IsCheckedProperty).UpdateTarget();
                UseFrameTransferCkBx.GetBindingExpression(CheckBox.IsCheckedProperty).UpdateTarget();
                IsDefaultCkBx.GetBindingExpression(CheckBox.IsCheckedProperty).UpdateTarget();
                StartingExposureUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget();
                ExposureLimitUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget();
                HighPixelThresholdPercentUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget();
                LowPixelThresholdPercentUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget();
                MinPercentPixelsAboveLowThresholdUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget();
                MaxPercentPixelsAboveHighThresholdUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget();
                IncreasingSignalRB.GetBindingExpression(RadioButton.IsCheckedProperty).UpdateTarget();
                DecreasingSignalRB.GetBindingExpression(RadioButton.IsCheckedProperty).UpdateTarget();
                StartingBinningCombo.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateTarget();
                EMGainLimitUpDown.GetBindingExpression(Xceed.Wpf.Toolkit.IntegerUpDown.ValueProperty).UpdateTarget();
            }
        }
Example #2
0
        /// <summary>
        /// Checks if the scenario details need saving or not
        /// </summary>
        /// <returns></returns>
        public bool NeedSave()
        {
            BindingExpression be = TitleTextBox.GetBindingExpression(TextBox.TextProperty);

            if (be != null && be.IsDirty)
            {
                return(true);
            }
            be = AuthorTextbox.GetBindingExpression(TextBox.TextProperty);
            if (be != null && be.IsDirty)
            {
                return(true);
            }
            be = DescriptionTextBox.GetBindingExpression(TextBox.TextProperty);
            if (be != null && be.IsDirty)
            {
                return(true);
            }
            be = CreateDatePicker.GetBindingExpression(DatePicker.SelectedDateProperty);
            if (be != null && be.IsDirty)
            {
                return(true);
            }
            be = RatingTextBox.GetBindingExpression(TextBox.TextProperty);
            if (be != null && be.IsDirty)
            {
                return(true);
            }
            return(false);
        }
Example #3
0
        /// <summary>
        /// Updates the Targets of every field. This is done when changes get discarded. So the values get overridden with the values in the source of the binding
        /// </summary>
        private void UpdateTargets()
        {
            BindingExpression be = TitleTextBox.GetBindingExpression(TextBox.TextProperty);

            if (be != null)
            {
                be.UpdateTarget();
            }
            be = AuthorTextbox.GetBindingExpression(TextBox.TextProperty);
            if (be != null)
            {
                be.UpdateTarget();
            }
            be = DescriptionTextBox.GetBindingExpression(TextBox.TextProperty);
            if (be != null)
            {
                be.UpdateTarget();
            }
            be = CreateDatePicker.GetBindingExpression(DatePicker.SelectedDateProperty);
            if (be != null)
            {
                be.UpdateTarget();
            }
            be = RatingTextBox.GetBindingExpression(TextBox.TextProperty);
            if (be != null)
            {
                be.UpdateTarget();
            }
        }
Example #4
0
        /// <summary>
        /// Updates the changes in the scenario values into the datamodel. Occurs when the save button is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveDataButton_OnClickDataButton_Click(object sender, RoutedEventArgs e)
        {
            BindingExpression be = TitleTextBox.GetBindingExpression(TextBox.TextProperty);

            if (be != null)
            {
                be.UpdateSource();
            }
            be = AuthorTextbox.GetBindingExpression(TextBox.TextProperty);
            if (be != null)
            {
                be.UpdateSource();
            }
            be = DescriptionTextBox.GetBindingExpression(TextBox.TextProperty);
            if (be != null)
            {
                be.UpdateSource();
            }
            be = CreateDatePicker.GetBindingExpression(DatePicker.SelectedDateProperty);
            if (be != null)
            {
                be.UpdateSource();
            }
            be = RatingTextBox.GetBindingExpression(TextBox.TextProperty);
            if (be != null)
            {
                be.UpdateSource();
            }
            WorkbookModel workbook = new WorkbookModel(Globals.ThisAddIn.Application.ActiveWorkbook);

            workbook.ShouldScanAfterSave = false;
            Globals.ThisAddIn.Application.ActiveWorkbook.Save();
            workbook.ShouldScanAfterSave = true;
        }
Example #5
0
        public bool Validate()
        {
            ServernameTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            ServerAddressTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            PortTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            PasswordTextBox.GetBindingExpression(PasswordHelper.PasswordProperty).UpdateSource();
            DescriptionTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();

            return(IsValid());
        }
Example #6
0
 private void displayValidation()
 {
     DescriptionTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
     NameTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
     ImageTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
     TypesComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource();
     EraComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource();
     IconTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
     TouristicComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource();
     IncomeTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
     DateTextBox.GetBindingExpression(Xceed.Wpf.Toolkit.MaskedTextBox.TextProperty).UpdateSource();
     DateComboBox.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource();
 }
Example #7
0
        private void EditTagButton_Click(object sender, RoutedEventArgs e)
        {
            newTag.Description = DescriptionTextBox.Text;
            TagColor           = ColorPickerCP.SelectedColor.Value;
            IdTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            DescriptionTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            ColorPickerCP.GetBindingExpression(ColorPicker.SelectedColorProperty).UpdateSource();
            bool validation = ValidateForm();

            if (validation == false)
            {
                return;
            }
            newTag.Color = new models.Color(TagColor);
            EditTagCallback(newTag);
            EditTagButton.IsCancel = true;
        }
        private void forceRefreshUI()
        {
            DescriptionsListView.Items.Refresh();

            BindingExpression be = DescriptionTextBox.GetBindingExpression(TextBoxReadOnlyCaretVisible.TextReadOnlyProperty);

            if (be != null)
            {
                be.UpdateTarget();
            }

            BindingExpression be2 = DescriptionTextBox_LongDesc.GetBindingExpression(TextBoxReadOnlyCaretVisible.TextReadOnlyProperty);

            if (be2 != null)
            {
                be2.UpdateTarget();
            }

            BindingExpression be3 = DescriptionTextBox_Summary.GetBindingExpression(TextBoxReadOnlyCaretVisible.TextReadOnlyProperty);

            if (be3 != null)
            {
                be3.UpdateTarget();
            }

            BindingExpression be4 = DescriptionTextBox_SimplifiedLanguage.GetBindingExpression(TextBoxReadOnlyCaretVisible.TextReadOnlyProperty);

            if (be4 != null)
            {
                be4.UpdateTarget();
            }

            BindingExpression be5 = DescriptionTextBox_TactileImage.GetBindingExpression(TextBoxReadOnlyCaretVisible.TextReadOnlyProperty);

            if (be5 != null)
            {
                be5.UpdateTarget();
            }

            BindingExpression be6 = DescriptionTextBox_SimplifiedImage.GetBindingExpression(TextBoxReadOnlyCaretVisible.TextReadOnlyProperty);

            if (be6 != null)
            {
                be6.UpdateTarget();
            }
        }
        private void EditTypeButton_Click(object sender, RoutedEventArgs e)
        {
            newType.Description = DescriptionTextBox.Text;
            newType.Name        = NameTextBox.Text;
            newType.Icon        = IconTextBox.Text;
            IdTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            NameTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            DescriptionTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            IconTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            bool validation = ValidateForm();

            if (validation == false)
            {
                return;
            }
            EditTypeCallback(newType);
            //this.DialogResult = true;
            this.Close();
        }