viewbox

Aligning content in a WPF Viewbox

I have a Viewbox that is using Stretch=Uniform in order to not distort the content. However... when the frame window is wider or taller than the content, the Viewbox content is always centered. I cannot seem to find any content alignment options on the Viewbox. Is there a way to do this? ...

WPF Component Obscures Subcomponents in Designer

Some components like the viewbox are displayed in the visual designer as solid boxes. However, they can contain subcomponents. To view the subcomponents I comment out the viewbox. When I'm done I have to remove the comments to restore the functionality. It's rather annoying. Is there any way to permanently make the viewbox invisible ...

WPF Lock Window Size to Viewbox Size

I have a window that contains a resizable viewbox with a uniform stretch. The window frame however does not stretch uniformly. So when someone resizes the form gaps of whitespace open up along one or another edge of the form. Looks bad. Any way to force the window to only expand uniformly? (or another way to look at it, lock it to t...

Viewbox behavior that I cannot understand

I have a DataTemplate that's used as a logo to describe a Version object. The logo is simply an image and some text on top of it. I have to use the DataTemplate in 2 places: - As the Content of a Button - As a thumbnail item of a ListBox The thing is, the logo has to be much smaller in the ListBox than in the Button. This doesn't cause...

Viewbox in Cider designer hides all controls in the "box"

When I place a Viewbox as the child element of a WPF window, the Cider Designer "hides" all interior controls with the text "Viewbox" only appearing on the display. Why? Is there a problem with this layout? Are there better layouts to achieve scalable images on a canvas? <Window x:Class="WpfApplication1.Window1" xmlns="http://schem...

WPF. How to show only part of big canvas?

Lets say I have a canvas defined to be 1000x1000 big. Is it possible to only show a 100x100 part of it in a Viewbox(or a rectangel)? Any help is apreciated..... ...

WPF ViewBox Zoom

Hello, Is there a way to zoom a viewbox content, excpet for one control? I have a viewbox with a grid, and in this grid I have some controls and I'm trying to zoom all the controls in the viewbox except one, is it possible? Many thanks, Paulo ...

Viewbox in Silverlight

How can use "Viewbox" in Silverlight? ...

Viewbox alternative using Winforms

Hello, I'm getting used to WPF and it's sometimes very painful to come back to Winforms development. I'm looking for some kind of alternative to the WPF Viewbox for Winforms. Do you have any idea? My major issue is that I need to update dynamically the size of the Font used in a Label control and/or a Picture control. ...

Treeview in viewbox wpf

Just wondering if it is possible to display treeview in a viewbox. Thanks ...

Why does UseLayoutRounding not seem to work with Viewbox?

I'm trying to write a tile-based game in WPF 4. I want the game board to scale to fit the window, so I'm using a Viewbox; but I want each tile to be on a nice, crisp pixel boundary. I might be wrong, but my understanding is that this is what the new UseLayoutRounding property is supposed to be for -- but it isn't working the way I expect...

How do I keep a constant FontSize in WPF Viewbox?

I have a Viewbox with a number of TextBlocks that are scaled and positioned perfectly by the ViewBox. Something like this: <Viewbox Stretch="Uniform"> <Canvas Width="100" Height="100"> <Ellipse Width="100" Height="100" Stroke="Black"/> <TextBlock Width="100" TextAlignment="Center" FontSize="12">Top Center</TextBlock>...

WPF Viewbox only shrink if I shrink the window horizontally

I have a grid in a Viewbox. If shrink the width of my window the grid getting smaller.. but if I shrink the height, nothing happened. ...

Get the size (after it has been "streched") of an item in a ViewBox

Consider the following: Let's say the Window is 1024x768 and the ViewBox fills the entire window, this means the TextBox is really large on the screen. I want to get the size of the TextBox as it is currently on the screen. If I get DesiredSize or ActualSize or even RenderedSize I always get 100. Any suggestions? Updat...

WPF: Viewbox and TranslatePoint

Hello, I have a Viewbox with a Canvas Child, I have the Stretch property of Viewbox to Fill, I have changed the width and height of the Viewbox, I need to get the location of children in Canvas with respect to Viewbox parent I tried : Point p = viewboxInstance.TranslatePoint(new Point(Canvas.GetLeft(child), Canvas.GetTop(child)), vie...

WPF: Change the style of a ViewBox depending upon the amount of data

Hi there, I have a WPF app that has a ViewBox to display the items in my collection, diplaying a 2-column grid for my results. What I'd like to do is, depending on the number of items in my collection, change the number of columns. E.g if there are < 10 items in the list, then show them in just 1 column; If there are 10 items in my li...

Conditional XAML

For easy of development I'm using a ViewBox to wrap all content inside a Window. This is because my development machine has a smaller screen than the deployment machine so using a ViewBox allows for better realisation of proportion. Obviously there is no reason for it to be there on Release versions of the code. Is there an easy method t...

SVG Scaling Text to fit container

This is likely a very simple question, but how do I get text in SVG to stretch to fit its container? I don't care if it looks ugly from being stretched too long or high, but it needs to fits its container and be as big as possible. Thanks ...

Rotating Viewbox contents smoothly

I'm looking to teach myself better methods of doing things in WPF that I would normally do manually. In this case, I have a ViewBox with an image in it. I also have a button that uses a DoubleAnimation to rotate the image 90 to the right. This animation works fine, but obviously because it's square as it turns, the image does a "best f...

WPF Viewbox size changes but PointToScreen of child is always same

Hi, In order to handle multiple resolutions I have following controls in the same xaml page. Grid -> Viewbox (stretch, centered) -> Canvas (centered) -> Rectangle X (centered) FrameworkElement I am trying to cover the whole page with a black overlay and cut a rectangle for the Rectangle X in the center of the page. To create the b...