I have a navigation panel in the left hand side of my WPF application. I want to make a button (like in photoshop or a similar program) when you push it, it expands across the bounds and "on top" of the other controls (the center column) - and allowing the user to push a button. Just like in the ribbon bar.
Does it make sense?
You should try Avalon Dock : http://avalondock.codeplex.com/ It gives you exactly what you want.
Related
I have a list and its scroll bar on the right along with two custom buttons representing upscroll and downscroll. These two buttons simulate scrolling by using list.setSelectedIndex(index, true) and are placed above and below my scrollbar via my custom layout.
I have two questions regarding this:
1). Since the upscroll and downscroll buttons are overlayed on top of the list, they disappear when i click elsewhere..and they kind of flash into appearance when i click the area it's supposed to be in. How can I remedy this behavior?
2). I have a scrollbar image that I have used in the "Scroll" theme in the GUI builder. It's alignment is IMAGE_ALIGNED_CENTER. However the scroll thumb doesn't reach the end of the bar when i scroll to the end of the list via my upscroll and downscroll buttons. The upscroll and downscroll buttons essentially scroll the list by one index with each press (using setSelectedIndex(index, true)).
Thanks
How do you overlay the buttons. I'm assuming you just set them into a specific location which disallowed as we can't possibly adapt them to the various resolutions. I suggest reading the developer guide section on layouts very carefully.
To place something on top of the list in a portable way you need to use the LayeredLayout or the LayeredPane and a Container + correct layout to position this within (e.g. BorderLayout EAST).
In this blog post there is a sample for making a scrollbar but it isn't "on top". It can be used as a starting point.
I am creating an interface using WPF which contains a menu of tiles. UI has an image which is below the menubar. When the menu bar is hidden the image expands and takes its place as I am using Avalon Dock.
I have a design in which, menu tiles expand in height when mouse is hovered over them. But the expanded tiles get hidden as the dockable panel doesn't expand in height. Is there a way to overlay the tiles' panel over the image panel so that the tiles are visible entirely?
Thank You.
I searched a lot over the internet and also documentations. Finally found out that, the 2 panels are separate components so content among it can't be overlayed.
eg. a button can't be shared by 2 windows as their Visual Tree is different.
So, the answer to my Question is that the components can't be overlayed.
Hi everyone I would like to implement an ImageViewer (like the one in Facebook for example) in a WPF application
I already have a ListBox whith my pictures, it works well. But I would like to add pop "image full size" when the user double click on one of them. (something like in FB, with a fade out of the background etc).
Currently I'm thinking of to use a Window...Do you have a better idea of what I should use ?
i would probably use a window for that as well. Then you can easily put an opacity animation when the window loads to give it the fade in and fade out effect
You could also use a Popup control.
It comes with some some built in (but very limited) animations, like fade, see PopupAnimation.
I'd try that and if it doesn't fit your needs, I second bflosabre91 oppionion and would use a separate opacity animated window.
But bear in mind that with an additional window you could have negative side effects e.g always sync the window positions correctly, handle task switches (ie. correctly hide the window in the taskbar/tasklist)
I'm a newbie. Designing a form that can be resized, and I want my textboxes, labels and buttons to resize with the form, can someone tell me how to do this?
It depends on the type of layout you need. The "basic tools" you have to do that are following properties: Anchor and Dock.
Anchor
With the Anchor property you "attach" a side of an element to a side of its container. For example if you place a button in the bottom-right corner of a window and you set "Bottom, Right" as Anchor then when you'll resize the form the button will keep its relative position to that corner.
Now imagine you place a multiline text-box in the form, resize as needed (for example 4 px from top, left and right border and 128 px height) and set the Anchor property to "Left, Top, Right". When you'll resize the form that control will keep its height but it'll resize to keep its margins (so if you'll make the form wider its width will be increased).
Dock
Dock is different. With docking you "say" to the Layout Manager to use all available space in one direction. For example if you set to Left then your control will keep its width but it'll use all the available height and its location will be most left as possible.
You may have more than one control docked in a container, imagine you have 5 textbox with Top docking inside a form. They'll be stacked to the top of the form using all the width (and resizing). Another example: a Top docked control (as a banner) and a "Fill" docked control (as main content). Remember that with docking the order of controls matters (if you first place the "Fill" control it'll use ALL the available space and the "Top" dock control will overlap).
Even more
Moreover you have some layout controls too (tables and stacks). They're really easy to use and a 30 minutes of "experiments" will clarify much better than a long text.
I want to be able to display a tooltip centered above my control.
I know how to customize the XAML used to display the tooltip using the TooltipService, however, the placement options the TooltipService makes available only allow you to specify top, bottom, left, right, etc. They don't let you specify an alignment once on the given side.
By simply using the TooltipService, selecting a placement of "Top" puts the tooltip above the control and has it aligned to the left side of the control. If there is not enough room for it to be aligned left, it moves it to be aligned on the right side of the control.
I want the tooltip to be centered on the top of the control. I don't want it to anchor to either the left or the right while on top.
Is this possible? How?
you should check out the TooltipService. MSDN documentation is here. and here is a (WPF) sample from CodeProject.
A quick shot: you could create your own TooltipService class to extend the possibilities of the existing one to manipulate a Tooltip instance.
Here you can find a nice class to help position a popup by specifying a list of preferred positions, like the TooltipService does for tooltip. You can specify a Top placement with Center HorizontalAlignment. I know this isn't a tooltip but I thought you could check it out and use it to create a BetterTooltipService.