WPF - Flahing button with a icon on it - wpf-controls

How do I place two icons on a WPF button, one in the middle (static icon) and one on the top left (based on a condition)? Also need to Flash the same WPF Button based on a condition?
(While flasing it switches between two background colors, the icons remains same).

Not sure if anyone will want to help you develop super annoying flashing advertising ad style buttons :)
But to point you in the right direction the answer is in learning how to override default control template for the button then for flashing - work on Animation. Once you try that and encounter problems, then post your code and someone will help.
P.S. 'Adam Nathan's WPF Unleashed' is a good start. Good luck!

Related

Android Studio: Part of Design View Hidden

This is a new one for me. In Design view I am unable to see the first 150 pixels of the design view window-- including the buttons/options to the left of the AppTheme button. I've tried the Pan and Zoom tool, which seems to do nothing. It shows the full view and blueprint view filling the Pan and Zoom tool interface. Any idea how to fix this:
"Window" -> "Restore Default Layout" worked for me.
I had the same problem.
Just drag the mouse where your projects are to the far left of the screen and slowly move with your mouse over to the right until you will see somewhere in the middle resize pointer- thats your design view border. Click it and move to the right and it should appear!
If you want i can try to make a gif how to do it if the above does not help.

How should a material design dialog box be animated?

I'm writing an application with a material design layout, but can't find any guidelines on how to animate dialog boxes onto the screen.
This suggests that the box should just "ping" into existence, but that seems to go against the ethos of the design, with its animations and tactile feel.
Does anyone have more information on what the correct course of action is?
Here are the specs for dialog boxes, by the way: http://www.google.co.uk/design/spec/components/dialogs.html#dialogs-specs
I took a look at existing Google apps, and it appears that the dialog box fades in at full size. The transition is pretty quick, like 0.25 seconds.
If you go into Developer Options and change Window animation scale to 10x, it will slow things down enough for you to see it clearly.
I chose Google Calendar > New Event, then select the different fields to see the dialog appear.
Here's a screen recording I did that shows the animation.
https://www.youtube.com/watch?v=jbU5yRhSbKg

Menu Button that does not dismiss options onclick in JavaFX 2

I am quite new in JavaFX and I have a question about the design. I am creating my main menu in FXML using Scene Builder. I have various menu buttons and each of these have a sub-menu. These sub-menu options will open new windows. Is it possible to declare these submenu choices so they do not dissapear after I click on them? If so, can I declare it in my fxml or I have to do it programatically?
Also, is it possible to detach it from the menu button? I would like to have my menu choices around 1 cm away from the menu button itself.
Thank you
Suggested Alternate Solution
If you want more flexibility in positioning a popup menu after a button click as well as fine control over when the menu shows and hides, try using a Button + a ContextMenu rather than a MenuButton.
The relevant methods are:
contextMenu.show(anchorNode, side, dx, dy)
contextMenu.hide()
There is sample code for triggering a context menu on a button press button in the ContextMenu javadoc.
You might also need to monitor the context menu's showingProperty and in a listener show the menu again if the JavaFX system has decided to try and hide it after some user action and you still want the menu visible.
Answers to additional unrelated comments
OK It sounds logical, yet since Im not really good in JavaFX yet, your Idea is quite challenging.
It's not that hard to implement, but from your subsequent comments it sounds like it's probably not the user interface you want for your users anyway (which makes sense to me because the interface you describe in your question seems a little strange).
I thought If it would be easier to have a static xml that have various menu choices, lets say aligned to the right and then whenever I click one of the choices, a new FXML would be loaded in the middle of the screen holding buttons for a submenu?
That seems logical. Sounds like a JavaFX version of a traditional web page layout with a navigation menu on the side controlling a content pane in the center.
A Java only version of that is: How to have menus in java desktop application. You could adapt that to a FXML based version without too much difficulty.
You might also be interested in Managing Multiple Screens in JavaFX.
Also, any tutorial for beginners would be greatly appreciated. These Oracle ones dont make too much sense for me
If you are beginning JavaFX, I recommend using just the Java API portions of JavaFX until you become familiar with them, and then use FXML only after you are comfortable with the Java API.
Personally, I think the Oracle JavaFX Tutorials are excellent. The difficulty for beginners is that the tutorials are also part reference material, which complicates portions of them (especially the deployment related pieces).
If you prefer a different tutorial style see:
Makery JavaFX tutorial (good for beginners)
zenjava tutorials (more advanced)

UIWebView with Custom Gestures

As of right now I have a View with a UIWebView inside of it and some added custom gestures. Some examples of these gesture are Two Finger Slide Right to Go Back, Two Finger Slide Left to Go Forward, Two Finger Long Press for Refresh, ect.. But now I'm facing an issue I knew I would have to face when I began developing this app:
All of the gestures work great unless the UIWebView is zoomed in. Even if it is zoomed in the tiniest bit (or you are able to scroll the web page horizontally), the gestures that require you to swipe left or right are suddenly disabled because UIWebView takes first priority over these gestures.
If anyone can shine some light on this issue or even provide a work-around, I would be very grateful. Thanks!
I'm more familiar with OS X, but could you subclass UIWebView to remove this behavior?

android - UI like sliding down notification bar

I want to develop a panel with animation same as notification panel. I mean to say the notification panel is a cool control where you grab and slide down the notification bar and see all the notifications.
Actually, I am having 2 UI , 1st should be shown with Button at top, when user click on that button, the 2nd UI with listview items should be slide down same as notification panel and again when user click or drag the 2nd UI at the top side, then 2nd UI should be become invisible. I hope i made clear my question.
From Christian's answer, I am trying to use a sliding drawer that will display a
list of options. I need this to expand over the current ListView on the page.
So if anybody know how to implement such layout or UI with sliding down animation then please share it.
Please suggest how to build with such control or layout? any ideas or suggestions
Thanx
Have you tried the SlidingDrawer widget?
Paresh I found a solution in this post about sliding drawers.
android misc widgets has it implemented , though it still has some flaws but it will definitely prove helpful.
Though in the same SO post CommonsWare has quoted :
...
You similarly cannot make a
SlidingDrawer that descends from the
top.
Good Luck.
You can use SlidingTray from: http://aniqroid.sileria.com to make this happen
http://aniqroid.sileria.com/doc/api/com/sileria/android/view/SlidingTray.html
Alternatively you can also use a custom PopupWindow class which is part of Android API.

Resources