Make a vector path in xaml responsive - xaml

I have a canvas that is within a page in XAML that contains some paths from an .ai document. I would like this to be responsive and have resize according to the proportions of the grid that it is contained on. How?

Okay I fixed it myself. Replaced the canvas with a grid, then enclosed that grid in a viewbox. All paths under the canvas now has horizontal and vertical alignment set to left and top respectively, and its Canvas.Left and Canvas.Top values are now replaced by a margin reflecting these values.

Related

How to center objects in parent with Dock Fill VB.NET

I'm trying to make a RichTextBox have fixed size and blank space flexible (like Word, WordPad), I made this:
Set Dock to Fill
Set MaximumSize to 600,0 (0 is wildcard for sizes) (Width=600 and Height=0 -wildcard)
I got this: blank spaces are flexible and RichTextBox size is fixed, but RichTextBox is not positioned at center.
I have some options:
Set padding to auto (I suppose that it's not possible)
Set margin to auto (I suppose that it's not possible AND margins not works in winforms)
What do I have to do to position RichTextBox to center?
Use anchor instead of dock.
Dock is designed for Size, Anchor is designed for Location
Your problem is based on location, locate your box to center instead of make Dock margins.

How to handle Segoe UI in pixel perfect layout (glyph "margin")

i am fighting with the layout of my windows store app. My problem is with the segoe ui font that I am using for the labels of some textboxes.
I have a borderless label above a textbox with a border like this:
LABEL
_____________
|__TEXTBOX___|
My problem is, that the font of the label does not align perfectly with the left border of the textbox.
First I though that it must be the label padding or something, maybe a padding or margin in the control template. But this is not the case. The true reason is the space around the glyphs within the font itself. Depending on the first letter or the size of the font the gap is bigger or smaller.
Is there a way to perfectly align the label text and the textbox independant of the first letter or the font size? Or do I really have to place every label in a different position to reduce this problem?

How to fill WinRT/XAML paragraph with variable height element?

Suppose I have a RichTextBlock with 2 paragraphs. The second paragraph is just some text. The first paragraph is a FlipView with images like a slideshow. What properties on the <Paragraph> or the <InlineUIContainer> or the <FlipView> should I set so that if the FlipView's images have different heights, the second paragraph text would move to stack just underneath the image in the FlipView?
I don't think you can with a FlipView.
The FlipView will have a rectangular clipping to make sure none of the other items appear in the view box. The dimensions (width/height) of this view box are based on the values you explicitly set, or chosen by the parent container. They do not change based on the images inside the FlipView.

Relative maximum width in XUL

I'm working on a Firefox extension, and am having problems getting relative constraints on the width of elements in the sidebar. For example, I want a description element in the sidebar that will always be as big as the sidebar when the sidebar is resized, and has text wrapping accordingly.
If I put a description in a box with a fixed maximum width, it will wrap correctly, but I can't get relative widths to work correctly using css. If is set the max-width to be 100% in css, it seems to just ignore it and the text will be on a single line and will overflow the sidebar. Any suggestions on how to put relative width constraints on a box in XUL so that text will wrap correctly?
It sounds like setting maximum width isn't what you really want. Have a look at https://developer.mozilla.org/en/XUL_Tutorial/The_Box_Model, setting flex attribute would be the right approach to make an element fill all the available space (typically flex="1"). The corresponding CSS property would be -moz-box-flex: 1.

Scale a canvas inside a templated usercontrol

I created a templated usercontrol from a button in order to use common states etc. What I dont get is how to scale a canvas inside the template. I created a little drawing with lines but they do not scale/transform with the control when I use it.
Most interesting would be if that is possible using xaml element binding (I am playing with SL3).
Regards Mario
I would use a Grid and set it's Height and Width to Auto. If yo addi items to the rows and columns and they are all set to stretch the stuff nside the grid will automatically resize. Not sure if that is what you are asking but that is what comes off the top of my head.