WPF - LibraryBar - Animation - wpf

Is there any way to animate or fade a LibraryBar? I want a Library Bar which isnt shown to 100 percent on normal use. I want a little bar at the bottom (maybe a part of the LibrarayBar). When the mouse or finger click on the bar (little part of the LibrarayBar) the whole bar should appear with a slow fade in or animation.
Anybody of you know how to this?
Sry fpr my English......

You could write 2 routed event handlers for GetFocus and LostFocus events by declaring them as attributes of GetFocusEvent and LostFocusEvent (or MouseEnter and MouseLeave) depending on whether you want the glowing/dimming to happen with an explicit click or reactive to just "hovering".
These handlers would alter the OpacityProperty property.
To start "dimmed", you can adjust an initial value for the Opacity propert

Related

handle Multi touch and mouse events with single event -WPF

I need to provide panning and zooming capabilities to my image in WPF. I have followed the below link and it works fine for Touch screen based system.
Multi touch with WPF . But what it doesn't work with ,mouse events. such as scrolling the mouse wheel to zoom or rotating the image using mouse. below are my questions?
Is there any possibilities to achieve both mouse and touch events by means single event?
IF yes how to do that?
If it is not possible, Why?
There are no such Common thing except the click events like MouseLeftButtonDown,MouseDown ... You have to Implement your own logic for Touch and Mouse Based Interaction.
Because they are not the same
Take a touch and drag, and a click and drag, superficially the same
But a click can be left, right, middle, special, it can be multiple buttons at once, none of that has anything to do with a touch
likewise a touch pinch has no meaning as mouse scroll wheel event
So you need to capture the different Events and convert them into a meaningful command that the VM can perform

How to scroll contents WHILE scrolling

I have created a usercontrol that is essentially a text editor (using Graphics.Drawstring in OnPaint).
I have set AutoScroll = true, and AutoScrollMinSize values appropriately. Everything is working how it should...
EXCEPT, i would like the control to scroll itself WHILST I am currently scrolling (i.e. click and drag the scroll bar... and whilst it is being dragged the control should be scrolling the entire time). At the moment it only scrolls when the scroll bar is released (mouse up).
I have tried implementing _Scroll and invalidating the control, but that just makes it flicker uncontrollably.
I cannot find any examples online for this, due to it being difficult to describe!
Can anyone point me in the right direction please?
Control.Invalidate() will make something flicker badly. I faced this problem drawing cross-hairs over a mouse position on a PictureBox drawing a line chart before. The trick is to use (and I cant remember which one is best to come first)
Control.Update();
Control.Refresh();
in the Scroll event. Depending on what else you are drawing in the Control and how you are drawing it this may be better for you. Also this is tested on PictureBox, Control may be another matter.

Transition animiation that shows parts of both pages at the same time?

In my Phone 7 app, I'm currently using the Silverlight Toolkit's transition service to implement transition animations when the user navigates between pages. It's working. But I don't like these animations because they always consist of two phases: the first phase shows an animation between the current page and the background, and the second one an animation between the background and the next page. It seems that most Phone 7 applications have this kind of animations.
What I would like to have instead is a direct animation from one page to another so that during the animation parts of both pages are visible. For a slide animation for example, the old page would move to the left and directly reveal the new page underneath. During the animation, the screen is split: the left part show less and less of the old page while the right part shows more and more of the new page.
How can I achieve that? Is a Silverlight storyboard able to do this?
I did similar research for calendar control and ended with the next solution:
before navigating to the other month, copy current control content
into underlying rectangle (render it to image and use as ImageBrush
to fill rectangle);
set current control content Opacity to 0 so that only underlying rectangle is visible;
create new control content (while it is still with opacity = 0);
start animation. Animation is performed for underlying rectangle and control content opacities and for their RenderTransforms.
when animation completes, clear underlying rectangle Fill property.
It's the idea. All storyboards can be defined in xaml, but animation handling requires some code.
I'm not sure whether it is applicable to your case, maybe you need something like Book control.

Mouse button press in silverlight 3

I have an slider control in my application and an image control. When the slider value is going up, the image is zoomed in and vice versa.
In addtion i have a zoom-in and a zoom-out button. the zoom-in button will increase the slider value by one smallchange and the zoom-out will decrease it.
What i want: while the zoom-in (and out) button is pressed i want to slider to keep increasing(performin a zoom in) and not just one time.
In other words, as long as the left button is pressed, i want to keep performing the mousebuttonpressed on the button until the mousebutton is released.
Oh, by the way, im using Silverlight 3.
Thanks.
You can use the RepeatButton class to do this. It raises it's click event repeatedly while held down, much like the thumb of a scrollbar or an up/down spinner.
http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.repeatbutton(VS.95).aspx

Events on animations in expression blend 2 silverlight

I have just created a simple animation. Lets say that in one frame I have an image of the world. I would like to create an event when a certain country is chosen. How can I allow for the event to be triggered by clicking on one particular country in an image? e.g. just displaying the name of the country, etc
Thank you
Extra info: In other words I am trying to split my image into regions using Blend...Do I need to "Clip the image"? I clipped part of the image but dont know what to do now. can anyone help me please?
If you just want "hotspots" over the image that you can click on, you could simply draw some shapes over the areas and set their opacity to 0 then handle the mouse events on them(don't change visibility to collapsed, since that will mean they won't received any mouse events)

Resources