Example #1
0
 public XmlDataSourceDialogModel(DataPanelModel dataPanelModel, string initialDataSourceName, DataSourceDialogMode mode)
 {
     this.dataPanelModel          = dataPanelModel;
     this.initialDataSourceName   = initialDataSourceName;
     this.dataSourceName          = initialDataSourceName;
     this.suggestedName           = initialDataSourceName;
     this.browseForXmlFileCommand = (ICommand) new DelegateCommand(new DelegateCommand.SimpleEventHandler(this.OnBrowseForXmlFile));
     this.mode = mode;
     this.UpdateIsProjectScope(true);
 }
        public XmlDataSourceDialog(DataPanelModel dataPanelModel, string initialDataSourceName, DataSourceDialogMode mode)
        {
            this.model = new XmlDataSourceDialogModel(dataPanelModel, initialDataSourceName, mode);
            FrameworkElement element = FileTable.GetElement("Resources\\DataPane\\XmlDataSourceDialog.xaml");

            ((UIElement)element.FindName("XmlDataSourceUrlTextBox")).LostFocus += new RoutedEventHandler(this.DataSourceUrlTextBox_LostFocus);
            element.DataContext           = (object)this.model;
            this.DialogContent            = (UIElement)element;
            this.Title                    = this.DialogTitle;
            this.SizeToContent            = SizeToContent.WidthAndHeight;
            this.controlNameMessageBubble = new MessageBubbleHelper((UIElement)(element.FindName("DataSourceNameTextBox") as TextBox), (IMessageBubbleValidator) new DataSourceNameValidator(this.model));
        }