XAF: How to minimize ribbon from code in XAF Windows App - devexpress

I want to minimize the ribbon when user click on particular navigation Item.
For example - when User clicks on Dashboard nav item, I want the ribbon minimized, and automatically "maximized" on others.
How can I do that ?

I've found that I can simple access the ribbon in the ViewController.
So like usual in XAF, override "OnActivated" and do the magic there
protected override void OnActivated()
{
if (Frame.Template != null)
{
((XtraFormTemplateBase)Frame.Template)).RibbonTransformer.Ribbon
.Minimized = View.Id == "TestView;
}
base.OnActivated();
}
I got a couple of errors while accessing Frame.Template being NULL when I'd hit a dashboardview, with many nested ListView in it. Make sure You don't forget to check it :)

They released a hotfix for this bug in Devexpress's version 22.1.4. Today I updated to 22.1.4 while getting this error when there was version 22.1.3 and the error was completely resolved.
NullReferenceException is thrown in the MinimizedRibbonPopupForm.GetSizeWithIndents method when the Classic panel style is used

Related

Navigation.PopAsync with a PushModalAsync?

i'm doing some support to an existing application. it's a really big application, and several pages are using a base controller, this controller works as the name says controller for all the events and stuff of the form.
the thing is that this application was done on xamarin 2.0 and never updated the version, now i've updated xamarin forms to the actual version 4.0 and some stuff works different. but the issue that bugs me more is Navigation.PopAsync.
In the 2.0 it closes all "windows" it doesn't matter if it's modal or a normal window.
but now with xamarin 4.0, the modal windows are not closed.
is there a way of knowing if the current window in Navigation is a modal or something like that?
Regards.
you could check whether it appears at the top of the Navigation.ModalStack like this:
private bool IsModal(Page page)
{
if (page == Navigation.ModalStack[Navigation.ModalStack.Count])
{
// is modal page
return true;
}
else
{
//not modal page
return false;
}
}

JXBrowser control over dialog website not responding

Hey im having issues with a website in the jxbrowser. it seems like it is running into a timeout or whatever and then in the jxbrowser there is a dialog showing up "website not responding" and i can click on "reload" or "leave".
Can I in any way access this dialog and overwrite it? For instance everytime i would get this dont ask but go to the homepage instead?
I'm having trouble finding this if it is even possible.
I found a solution. JXBrowser has a RenderAdapter where a function exists onRenderUnresponsive wich can be overridden. Look at this: https://jxbrowser.support.teamdev.com/support/solutions/articles/9000091687-detecting-unresponsive-web-page
In my case I simply want to reload the website:
Browser browser = new Browser();
browser.addRenderListener(new RenderAdapter() {
#Override
public void onRenderUnresponsive(RenderEvent event) {
browser.reloadIgnoringCache(false);
}
});

Qt installer framework hide or disable buttons

I want to hide or freeze the back button on a page ( to be more specific, License Agreement Page). I tried editing control.qs with few methods but it doesn't seem to work. Following is one of them
Controller.prototype.LicenseAgreementPageCallback = function()
{
var widget = gui.currentPageWidget();
if (widget != null)
{
widget.BackButton.setVisible(false) ;
}
}
I'm facing a similar problem trying to keep hide the Next button in the Target Directory page under certain conditions.
But your case may be easier:
1) You should use a global boolean variable set to true when you enter the License Agreement page.
2) When you enter the previous page test the value of this global: if true then force a click on the next page (gui.click(buttons.NextButton);).
Yes, it's a dirty workaround ;)
I think you could try what I've proposed here: Qt installer framework: remove radio buttons from uninstaller. Even if it wasn't accepted, that what I used in my installer, so I'm pretty confident it's working!
For the wizard BackButton specifically, it automatically disables itself if there are no pages before the current page a la the Introduction page.
From QtScript this can be accomplished by removing any dynamic pages before the current page with installer.removeWizardPage and disabling all default pages before the current page with installer.setDefaultPageVisible(QInstaller.Introduction, false).

Forms opening in the background in AX 2009

Sometimes when opening a form or when clicking on an object on the form, the form goes inactive or opens in the background. Is there a way to prevent this from occurring programatically?
I have seen this from time to time, but I don't have any documented solution.
You could try to clear the users AUC cache and see if that helps.
I have found the answer to this question. It is related to a 3rd party addition that we have installed (IEM). I had to remove some code that they have that sets forms as modal (which ends up putting them in the background because of the base timeout function in AX because the code to make the form modal takes too long to execute). I had to make a change to Classes/SysSetupFormRun: Below is the code and where it was changed
public void activate(boolean _active)
{
;
// if (_active)
// PUL_Modal::construct().hookModal(this);
super(_active);
/*
if (_active)
PUL_Modal::construct().checkModal(this);
*/
}
This returns the activate method to its previous state and prevents forms from going modal.

AS3: Main stage listener for ProgressEvent?

Can I add a ProgressEvent listener to the stage?
I don't see it in any of the auto-complete options when I am typing in Flex.
What do people normally do to get a progress readout of the entire main runner's loading progress?
I try the following, which is where I would expect to see the ProgressEvent options pop up:
stage.addEventListener(
Thanks...
Try adding it to loaderInfo.
something like:
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
Also , if you're using the framework, you should probably extend the DownloadProgressBar.
I remember this old tutorial, but surely there must be plenty online.
I have a new problem:
I use the following code to show the progress of the download of my site content:
public function mainProgress(e:ProgressEvent):void
{
var w:Number = e.bytesLoaded / e.bytesTotal;
_mainprog.graphics.clear();
_mainprog.graphics.beginFill(0x000000);
_mainprog.graphics.drawRect(0, 0, w * stage.stageWidth, 50);
_mainprog.graphics.endFill();
}
But it doesn't seem to work.
What happens is that the loaderInfo object thinks that the site has loaded before I am actually ready to display anything. So what ends up happening (I think) is the site loads, the loader progress disappears before the initial page's graphics have fully loaded, and then there is a delay between when the completion of the loaderInfo object happens and the actual graphics appearing.
Has anyone else had this problem before?
Thanks...

Resources