The ViewBox is a very useful control in WPF. If does nothing more than scale to fit the content to the available size. It does not resize the content, but it transforms it.
Questions tagged [viewbox]
358 questions
0
votes
2 answers
Displaying a listbox of viewboxes
I have a list box that I'm trying to populate with a list of viewboxes.
The listbox takes in the list without a problem. However, when my function reaches its end, I receive the error:
"Must disconnect specified child from current parent Visual…

andrew
- 3
- 2
0
votes
0 answers
How to make Line charts developed using svg, responsive
I have created a line chart in which I am setting the width and height of the line chart depending on the size of the container
"style": {
"width": Math.round($('#' + container).width()) + "px",
"height":…

Darshan Pawar
- 1
- 1
0
votes
0 answers
How to make a control scale proportionately with its contents
I am using WPF to create an interactive touch-based application. The application uses ScatterViewItem objects to hold two scrollable menus inside, a main menu and a sub-menu side by side and display various content depending on the items…

eliba
- 140
- 10
0
votes
1 answer
WPF Datagrid with a Viewbox in a cell block right mouse button selection
I use a datagrid with templated cells to present my data. I can add any type of UI element I think of (DataTemplate, ContentControl, StackPanel, Rectangle) and everything still work fine. But as soon as I add a ViewBox, the right click mouse button…

Dunge
- 89
- 1
- 11
0
votes
2 answers
Alternate between "Stretch.Uniform" and "Stretching.None" for ViewBox with ScrollViewer
I want to achieve a very well known behavior seen in the browser when you have an image to display that is larger then the monitor:
Originally, the image is displayed fitting inside the window area, and the mouse cursor is a magnifying glass with a…

heltonbiker
- 26,657
- 28
- 137
- 252
0
votes
1 answer
ViewBox default width and height
i've created usercontrol with viewbox as a main container.
If i add this usercontrol to a window it will place all area of it.
How to set up default width and height for the control?
...

user3916810
- 43
- 1
- 8
0
votes
1 answer
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…

Aibynn
- 115
- 1
- 8
0
votes
1 answer
Nested SVG viewBox and preserveAspectRatio to align
I am constructing an svg using D3.js. Inside it I am using to place two types of images img1 and img2 where both have same width W but img1 is shorter than img2 i.e. H1

Thalis K.
- 7,363
- 6
- 39
- 54
0
votes
1 answer
Have a clickable page
What I want is to have a page with a Textblock in the middle. Also I want the page to be clickable (as in you should be able to click anywhere on the entire page and the function will be called).
What I've tried is to have the TextBlock in a Viewbox…

Winky2222
- 46
- 7
0
votes
1 answer
How to fit a list of paths inside a border in WPF
am writing a C# WPF program to view and edit SVGs.
So i have a List of pathes (PathList) and i diplay them inside a border on a canvas here's my XAML:
…

Mohab Mesherf
- 13
- 1
- 9
0
votes
1 answer
User control Changing size when In ViewBox
I have a user control(Windows 8.1 app) which I have developed using PATH vector control. I have put it inside a ViewBox . The problem is , when I change the screen resolution or even orientation , the Control either get reduced or get too much…

Apoorv
- 2,023
- 1
- 19
- 42
0
votes
1 answer
Stretch control inside ViewBox
I'm using ViewBox control to scale my forms in winstore application. I need stretch controls inside ViewBox but common HorizontalAlignment="Stretch" does not work
This is my code :

y0j0
- 3,369
- 5
- 31
- 52
0
votes
1 answer
How to maintain alignment and spacing in Viewbox
I have a list of labels and values. For instance (this sample is for illustrative purposes):
Tim 0.333
Fred 0.357
Fernando 0.300
I would like to be able to add to this list and have the text shrink so the list will fill the available…

JAB
- 313
- 2
- 10
0
votes
1 answer
WPF. FormatException when binding an ImageBrush Viewbox property to an object
I'm trying to bind the "Viewbox" property of an ImageBrush to a class property at code-behind.
I have two images, the idea is that while i move the mouse over the top image, the bottom one shows a part of the top image in a Viewbox, relative to the…

MorgoZ
- 2,012
- 5
- 27
- 54
0
votes
1 answer
Need a svg figure
I have a figure with 100% width. And I need her inverted version. I rely on your help please.