control with image, title and hyperlinks like in VS - wpf

I am completely new to wpf and the question is this.
Is there available xaml for the control like on attached image?
As you can see, when we click on a control the image on the left becomes larger and all the text slides to the left. Or how could I create similar control?

The easiest way to accomplish that is a Storyboard.
Open Expression-Blend, build a Control. Hide all Elements you dont see first so its small. Create a new Storyboard, make a Keyframe and change the Properties of the elements you then want to change, create a new Keyframe.
Its like an Animation now. You can now start the Storyboard any time, on any event to expand your control.
If you dont know how to use Expression Blend and the Storyboard, there are some fine Tutorials and Videos.
Good luck!

Related

Image Button with no border that works like a toolbar button?

I want a button that
Displays an image with NO border, NO background, NO text
If I tab into the imagebutton, THEN it shows the background and border
Also if I hover over it, it shows the background and border
I've searched and I've tried so many different things, but nothing it exactly what I want. I've tried setting various properties on the button to make the background and border transparent, but it still shows up. I've tried a style with a custom control template. I'd rather not have to completely reinvent all the triggers etc to get the button to render on mouse over. The biggest problem with custom control template is that then I loose all existing functionality and I'm basically building a new control from the ground up.
Here is another link that came closest to what I wanted but it doesn't properly work for me.
How do you completely remove the button border in wpf? - BUT.... for some reason the hover effect gets stuck. One I mouse over the image and the button border draws, it stays stuck on until I click somewhere else.
Actually, you will want to override the control template. You're not "losing" any functionality (aside from the UI triggers).
Original/Default Template -- This is a good starting point... copy/paste that into you're XAML (wherever you want to style this button... ie Button resources, UserControl/Window resources, App Resources?). From there make your adjustments.
Another easy way is to use Expression Blend. You can easily create a new template based on the existing template, and the styling/authoring tools it provides are much better than hand-coding XAML (unless you're good at doing that).
As far as displaying an image instead of text, just set the image as the content. A Button is a type of ContentControl which means that it can house any type of content (Object).

Drawing Control Visual Elements onto a Rectangle

I've got a custom composite WPF control (AvalonEdit) in my application that I'd like to animate whenever its Text property is changed. What I intend to do is:
Create a copy of the control's visual representation before the text is changed and paint it over a rectangle.
Fade out the above rectangle, update the text property and fade in the control using the DoubleAnimation and Storyboard classes.
I've got #2 figured out but haven't got a clue about how I'd achieve #1. Any help would be appreciated.
For (1) there are a couple of approaches that spring to mind:
VisualBrush - A visual brush is a brush which is defined by a complex UI element. In other words, you can create a visual tree of elements and use this to create your brush. See the tutorial here. I think in your case you would have to define your UI twice, i.e. have an instance of your AvalonEdit control as the 'visual' for you VisualBrush, so perhaps not ideal
WriteableBitmap - A writeable bitmap allows you to copy part of your UI into a bitmap where you can manipulate he pixel data. Whilst you do not need pixel-level manipulation it is still a convenient mechanism for cloning your UI. See this tutorial I wrote here.

WPF - Adding ScatterViewItem.Content to a StackPanel as UIElement

I'm attempting to make a application where you can drag ScatterViewItems next to each other, and the items will dock together, so that you can move them around as a single item.
Right now I'm trying to create a StackPanel and add the content of the two ScatterViewItems being docked to it, but am not sure how to convert the SVI's content property to a UIElement in any meaningful way. Has anyone tried to do something similar, or have any ideas on how to get it to work?
Look at the ScatterPuzzle example in the Surface SDK. It shows precisely how to accomplish this scenario of snapping items together

VisualstateManager in Style

I am new to both Silverlight and Blend 4.
I am trying to make a Image Gallery, where u click on the image and it shows details of the same.
I used VisualStateManager to get a mouseOver and mouseOut effect to the thumbnails. and here is wat i want. I want to add the VisualState's to all my thumbnails through Style. (I had seen this in some forum, but i cudnt figure it out how he did it.)
Here is wat i want:
I have set of thumbnails to, which need to scale up on MouseOver and come back to normal on MouseOUT. I created a VisualStateManager States.
But i want to use the state as a
common state for all the thumbnails
and apply it to the thumbnails through
Style.
Is this possible? If so how?
If not? then is how can i achieve it.
Would be really thankful to any one who can help me :) just that this is a bit urgent. :(
MSDN documentation says that you should be able to add the VisualStageManager XAML tag to any control which inherits from UIElement and accepts child controls.
It seems to me then that the best way to do this is to create a UserControl for your thumbnail and set the VisualStateManager there. You can then reuse that UserControl.
More reading material:
MSDN UserControl documentation
Adding behaviour to stock controls

WPF page layout control selection

I have an imagebrush of a soccer field as the page background and I want to be able create a line up by dragging players off the bench and positioning them on the field accordingly. I don't know what control to use for the background that allows the PlayerCard control to reside where it is dragged. Any help as to how to begin would be appreciated.
You can get the idea here.
What control to use?
I believe you want the Canvas container control. It lets you arbitrarily place child controls with a Left and Top attached property, similar to the way Windows Forms does it.

Resources