public POMEditPage(ApplicationPOMModel POM, eRIPageViewMode editMode = eRIPageViewMode.View) { InitializeComponent(); mPOM = POM; mEditMode = editMode; mBusinessFlowControl = new ucBusinessFlowMap(mPOM, nameof(mPOM.MappedBusinessFlow)); xFrameBusinessFlowControl.Content = mBusinessFlowControl; xShowIDUC.Init(mPOM); xFirstRowExpanderLabel.Content = string.Format("'{0}' Details", mPOM.Name); GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xNameTextBox, TextBox.TextProperty, mPOM, nameof(mPOM.Name)); GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xDescriptionTextBox, TextBox.TextProperty, mPOM, nameof(mPOM.Description)); xPageURLTextBox.Init(null, mPOM, nameof(mPOM.PageURL)); FillTargetAppsComboBox(); GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xTargetApplicationComboBox, ComboBox.SelectedValueProperty, mPOM, nameof(ApplicationPOMModel.TargetApplicationKey)); xTagsViewer.Init(mPOM.TagsKeys); BitmapSource source = null; if (mPOM.ScreenShotImage != null) { source = Ginger.General.GetImageStream(Ginger.General.Base64StringToImage(mPOM.ScreenShotImage.ToString())); } mScreenShotViewPage = new ScreenShotViewPage(mPOM.Name, source); xScreenShotFrame.Content = mScreenShotViewPage; mPomAllElementsPage = new PomAllElementsPage(mPOM, PomAllElementsPage.eAllElementsPageContext.POMEditPage); xUIElementsFrame.Content = mPomAllElementsPage; mPomAllElementsPage.raiseUIElementsCountUpdated += UIElementCountUpdatedHandler; UIElementTabTextBlockUpdate(); mAppPlatform = WorkSpace.Instance.Solution.GetTargetApplicationPlatform(POM.TargetApplicationKey); ObservableList <Agent> optionalAgentsList = GingerCore.General.ConvertListToObservableList((from x in WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <Agent>() where x.Platform == mAppPlatform select x).ToList()); GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(xAgentControlUC, ucAgentControl.SelectedAgentProperty, this, nameof(Agent)); xAgentControlUC.Init(optionalAgentsList, mPOM.LastUsedAgent); SetDefaultPage(); }
public POMEditPage(ApplicationPOMModel POM, RepositoryItemPageViewMode editMode = RepositoryItemPageViewMode.View) { InitializeComponent(); mPOM = POM; mEditMode = editMode; ControlsBinding.ObjFieldBinding(xNameTextBox, TextBox.TextProperty, mPOM, nameof(mPOM.Name)); ControlsBinding.ObjFieldBinding(xDescriptionTextBox, TextBox.TextProperty, mPOM, nameof(mPOM.Description)); ControlsBinding.ObjFieldBinding(xPageURLTextBox, TextBox.TextProperty, mPOM, nameof(mPOM.PageURL)); xTargetApplicationComboBox.ComboBox.Style = this.FindResource("$FlatInputComboBoxStyle") as Style; FillTargetAppsComboBox(); xTargetApplicationComboBox.Init(mPOM, nameof(ApplicationPOMModel.TargetApplicationKey)); xTagsViewer.Init(mPOM.TagsKeys); BitmapSource source = null; if (mPOM.ScreenShotImage != null) { source = Ginger.General.GetImageStream(Ginger.General.Base64StringToImage(mPOM.ScreenShotImage.ToString())); } mScreenShotViewPage = new ScreenShotViewPage(mPOM.Name, source); xScreenShotFrame.Content = mScreenShotViewPage; mPomAllElementsPage = new PomAllElementsPage(mPOM, PomAllElementsPage.eAllElementsPageContext.POMEditPage); xUIElementsFrame.Content = mPomAllElementsPage; UIElementTabTextBlockUpdate(); ePlatformType mAppPlatform = WorkSpace.UserProfile.Solution.GetTargetApplicationPlatform(POM.TargetApplicationKey); ObservableList <Agent> optionalAgentsList = GingerCore.General.ConvertListToObservableList((from x in WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <Agent>() where x.Platform == mAppPlatform select x).ToList()); App.ObjFieldBinding(xAgentControlUC, ucAgentControl.SelectedAgentProperty, this, nameof(Agent)); xAgentControlUC.Init(optionalAgentsList, mPOM.LastUsedAgent); }
public POMEditPage(ApplicationPOMModel POM) { InitializeComponent(); mPOM = POM; ControlsBinding.ObjFieldBinding(xNameTextBox, TextBox.TextProperty, mPOM, nameof(mPOM.Name)); ControlsBinding.ObjFieldBinding(xDescriptionTextBox, TextBox.TextProperty, mPOM, nameof(mPOM.Description)); xTargetApplicationComboBox.ComboBox.Style = this.FindResource("$FlatInputComboBoxStyle") as Style; FillTargetAppsComboBox(); xTargetApplicationComboBox.Init(mPOM, nameof(ApplicationPOMModel.TargetApplicationKey)); xTagsViewer.Init(mPOM.TagsKeys); BitmapSource source = null; if (mPOM.ScreenShotImage != null) { source = Ginger.Reports.GingerExecutionReport.ExtensionMethods.GetImageStream(Ginger.Reports.GingerExecutionReport.ExtensionMethods.Base64ToImage(mPOM.ScreenShotImage.ToString())); } //Bitmap ScreenShot = BitmapFromSource(Ginger.Reports.GingerExecutionReport.ExtensionMethods.GetImageStream(Ginger.Reports.GingerExecutionReport.ExtensionMethods.Base64ToImage(mPOM.LogoBase64Image.ToString()))); ScreenShotViewPage p = new ScreenShotViewPage(mPOM.Name, source); xScreenShotFrame.Content = p; //PomElementsMappingPage mappedUIElementsPage = new PomElementsMappingPage(mPOM,null); PomAllElementsPage pomAllElementsPage = new PomAllElementsPage(mPOM, null); //pomAllElementsPage.mappedUIElementsPage.MainElementsGrid.ValidationRules.Add(ucGrid.eUcGridValidationRules.CantBeEmpty); //pomAllElementsPage.unmappedUIElementsPage.MainElementsGrid.ValidationRules.Add(ucGrid.eUcGridValidationRules.CantBeEmpty); xUIElementsFrame.Content = pomAllElementsPage; //PageNameTextBox.BindControl(mApplicationPOM, nameof(ApplicationPOM.Name)); //ObservableList<ApplicationPlatform> Apps = App.UserProfile.Solution.ApplicationPlatforms; //ApplicationPlatform AP = (from x in Apps where x.Guid == mApplicationPOM.TargetApplicationKey.Guid select x).FirstOrDefault(); //mApplicationPOM.TargetApplicationKey = AP.Key; // Create new binding and get updates if exist as key app name might changed //Yuval Uncomment //TargetApplicationComboBox.BindControl<ApplicationPlatform>(mApplicationPOM, nameof(mApplicationPOM.TargetAppplicationKey), Apps, nameof(ApplicationPlatform.AppName), nameof(ApplicationPlatform.Key)); //TODO: lazy load based on tabs with cache //if (mPOM.ScreenShot == null) //{ // string filename = mPOM.FileName.Replace("xml", "Screenshot.bmp"); // TODO: use same const // //mPom.ScreenShot = General.LoadBitmapFromFile(filename); //} //POMSimulatorFrame.Content = new POMSimulatorPage(mPom); //LearnWizardPage p2 = new LearnWizardPage(mPom); //UIElementsFrame.Content = p2; //MappingFrame.Content = new MapUIElementsWizardPage(mPom); //NaviagtionsFrame.Content = new NavigationsPage(mPom); ////TODO: create a page and move code to design page //pd = new ScreenShotViewPage(mPom.Name, mPom.ScreenShot); //pd.MouseClickOnScreenshot += MouseClickOnScreenshot; //pd.MouseUpOnScreenshot += MouseUpOnScreenshot; //pd.MouseMoveOnScreenshot += MouseMoveOnScreenshot; //DesignFrame.Content = pd; //InitControlPropertiesGrid(); }