private static object Coerce(DependencyObject obj, object value)
        {
            FilePathPicker filePicker = obj as FilePathPicker;
            string         filePath   = value as string;

            if (System.IO.Directory.Exists(filePath))
            {
                var brush = filePicker.BorderBrush as SolidColorBrush;
                if (brush != null)
                {
                    if (brush.Color == Colors.Red)
                    {
                        filePicker.BorderBrush     = new SolidColorBrush(Colors.Transparent);
                        filePicker.BorderThickness = new Thickness(0);
                    }
                }
                return(filePath);
            }
            else
            {
                filePicker.BorderThickness = new Thickness(1);
                filePicker.BorderBrush     = new SolidColorBrush(Colors.Red);
                return(DependencyProperty.UnsetValue);
            }
        }
Example #2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 7 "..\..\..\..\View\View.xaml"
                ((SFD_MVVM.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);

            #line default
            #line hidden

            #line 7 "..\..\..\..\View\View.xaml"
                ((SFD_MVVM.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.viewMenuShowTabCntl = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 3:
                this.StreamMenu = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 4:
                this.mainGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 5:
                this.colDefForImg = ((System.Windows.Controls.ColumnDefinition)(target));
                return;

            case 6:
                this.tabControl = ((System.Windows.Controls.TabControl)(target));
                return;

            case 7:
                this.SldrFrom = ((System.Windows.Controls.Slider)(target));
                return;

            case 8:
                this.SldrTo = ((System.Windows.Controls.Slider)(target));
                return;

            case 9:
                this.Sldr = ((System.Windows.Controls.Slider)(target));
                return;

            case 10:
                this.FramesNumber = ((SFD_MVVM.View.UpDown)(target));
                return;

            case 11:
                this.SeriesNumber = ((SFD_MVVM.View.UpDown)(target));
                return;

            case 12:
                this.HDRI_Directory = ((SFD_MVVM.View.FilePathPicker)(target));
                return;

            case 13:
                this.VideoDirectory = ((SFD_MVVM.View.FilePathPicker)(target));
                return;

            case 14:
                this.saveSingleImageRadioBtn = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 15:
                this.useSelectionCheckBox = ((System.Windows.Controls.CheckBox)(target));

            #line 193 "..\..\..\..\View\View.xaml"
                this.useSelectionCheckBox.Unchecked += new System.Windows.RoutedEventHandler(this.useSelectionCheckBox_Unchecked);

            #line default
            #line hidden

            #line 194 "..\..\..\..\View\View.xaml"
                this.useSelectionCheckBox.Checked += new System.Windows.RoutedEventHandler(this.useSelectionCheckBox_Checked);

            #line default
            #line hidden
                return;

            case 16:
                this.autoManualChekBox = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 17:
                this.Image = ((System.Windows.Controls.Image)(target));
                return;
            }
            this._contentLoaded = true;
        }