How to make a window modal to Page in WPF? - wpf

I know how to make a Window Modal to a Window
I have a Page as my main window. I want to open a window and make it Modal to the Page. Is it possible? Does Page class have API's to support my requirement? If yes a sample illustration will be nice!!

This is very simple (unless I've misunderstood your issue)
Window win = new MainWindow();
win.ShowDialog();

These links may help:
http://social.msdn.microsoft.com/Forums/en/windowsgeneraldevelopmentissues/thread/3c3e1a4a-6b26-435c-b59b-2e2f1766f52d
Link
​​​

Related

Add a Tool button in titlebar in GTK

How to add a button (tool) in title bar like maximize and minimize button in title bar.
I need to add help tool button in my window title bar..?
Thanks in Advance
You can remove the window manager decoration and place some widgets on top of your toplever window, emulating the same behavior.

How to check if element has class with AngularJS?

I have an off panel menu working perfectly on a site. The user can open and close it using both a navicon or sliding it with the finger.
Right now I have a very nice navicon icon that transitions from Menu Icon to X Icon when is clicked (and opens the menu) and the other way around when is clicked again and the menu closes. Buuut if the user slides the menu open or closed instead of using the navicon, the transition is not triggered, which might lead to confusions on the UX (i.e. the menu being closed, and the navicon showing an X instead of the regular 3 horizontal lines icon).
So, the navicon has right now the following code to trigger the transition:
ng-click="open = !open" ng-class="{'open-mob':open}">
I thought that a nice and easy way to fix this, would be to trigger this "open = !open" every time that the menu is open or closed, as the js from the off panel adds the class slidRight to the main section when the menu is open, and removes it when it is closed.
Being so, is there some straight way to check if the class is there using AngularJS?
Something like if class = slidRight -> "open = !open".
Thanks!!
for those (including me) who could not get their head around Angular's documentation, here is an example which worked for me:
angular.element(myElement).hasClass('my-class');
angular.element(myElement).addClass('new-class');
angular.element(myElement).removeClass('old-class');
hope this help someone ...
Angular uses jqLite's .hasClass() natively.
Read here on the angular docs for more info.
http://docs.angularjs.org/api/angular.element
https://docs.angularjs.org/api/ng/function/angular.element

Slider in codenameone

Can any one please tell me how i can add slider and moving form in codename one (with sample lines of code) and also want to know are these features supported by all types of devices?
Regards,
Megha
I think you mean how to animate forms changes
Form.setTransitionInAnimator(CommonTransitions.somthing)
Form.setTransitionOutAnimator(CommonTransitions.somthing)
Next, you should handle some "finger slide" event.
To add a slider you can use the following code
Slider jSlider = new Slider();
jSlider.setMaxValue(255);
jSlider.setMinValue(0);
jSlider.setProgress(50); // Set the starting value
jSlider.setEditable(true); // To it works as a slider instead of a progress bar
Now you have created a slider which you can add to your component like you would in Swing. You can type 'jSlider.' in eclipse to find out which other methods you can use, or you can go to the API: http://codenameone.googlecode.com/svn/trunk/CodenameOne/javadoc/com/codename1/ui/Slider.html
I think min/maxValue are selfexplenatory though :)
If you want to open a new form, simply create a new class extending form or do it in code like
Form form = new Form();
form.animate(); // To make it "slide in"
form.show();
Also noteworthy, the slider doesn't work with the lumia skin per default, though you can make it work. I actually asked this question on here as well:
Slider doesn't draw (CodeName One) with Windows phone skin

How to use a modal window in titanium?

i have a serious problem here. i'm trying to use a modal window in my application. till now i used just a window over the parent window. but this caused a problem of not disabling the background.
here is my window:
the problem in the above pic is the background is not being disabled. if i use the modal window it occupies the whole view, which i dont want.
What i'm need of:
i need a view something like this alert view, which wen shown the background goes to disable mode.
any help is highly appreciated..
thank you...
Unfortunately You can not use the modal window as dialog box, but you can do a small trick and make your window look like a modal window.
Create a view and disable the click event on it. Add your dialog window to this view and show this view on screen.
var disableView = Titanium.UI.createView({
height:480,
width:320,
top:0,
backgroundColor:'#000',
opacity:0.7,
touchEnabled:true
});
disableView.add( yourWindow);

How to make the ChildWindow Fullscreen?

I have a ChildWindow , in which I have a Video Playing in Expression MediaPlayer.
When I press the FullScreen Button then the whole Application switch to FullScreen Mode, but I want only the Child Window to be Full Screen.
A child window can't be made fullscreen. Its a security restriction.
To do this make you form property : MDIChile = true
so you can see your full screen window into you parent window.
got it.

Resources