Change Silverlight transformation height direction - silverlight-3.0

Here's my xaml
<Button x:Name="btnTest" Width="88" Content="{Binding Value, ElementName=slSlider}" Height="{Binding Value, ElementName=slSlider}" HorizontalAlignment="Left" ></Button>
<Slider x:Name="slSlider" SmallChange="1" LargeChange="10" Maximum="100" Height="32" VerticalAlignment="Top" UseLayoutRounding="False" d:LayoutRounding="Auto" HorizontalAlignment="Left" Width="256" ></Slider>
Very simple stuff. Now what I want to do is restrict the button to only grow in an upwards direction, instead of growing both upwards and downwards. How's this done?
Thanks

Set a MinWidth or MinHeight. There's also MaxWidth and MaxHeight if you need them.
Although re-reading your question I am unsure if you're asking about limiting the minimum size of the button or if you actually are talking about alignment. If you're talking about alignment and you want the top of the button to grow out while the bottom stays in position, set the VerticalAlignment of the Button to "Bottom".

Related

TextInput align text on top on multiline={false} (with height)

I am forced to use multiline={false} and set the height of TextInput in order to show it like it is a text area. Reason is that multiline={true} doesn't work very well with KeyboardAvoidingView (https://github.com/facebook/react-native/issues/16826).
So here is a simple code:
<TextInput placeholder="Input text here..." style={{height: 200}} multiline={false} />
and the output is: Screenshot
I just want to make it the text align at the top. Works properly with Android though
Set style property textAlignVertical to top on the TextInput
<TextInput ... multiline={true} textAlignVertical: 'top' />

TFS Work Item Form 100% Height

In TFS web interface, is it possible to force a Work Item Form layout to fill 100% height? For example:
Would it be possible in the WIT definition to make it so the tab fills the full height of the form when the form is expanded? There's an option for width to be 100%, but not sure if possible for height.
You need to use "Minimumsize" like following:
<Control FieldName="System.Description" Type="HtmlFieldControl" LabelPosition="Top" Dock="Fill" MinimumSize="(0,465)" />
And you could also use TFS Power Tools to edit the work item
definitions as you can preview the changes with it.
More details and screenshot please refer Eddie's answer here, the value of height as below should be 465.
Besides, there is a Maximize button in the right top corner
After click it, the tab will expand and fills both 100 height and width.

Xamarin.Forms - Expand Width of Column To Longest Content

In Xamarin Forms, I want to create a 2-column table where the first column expands to the width of the cell with the longest content, like:
What's the best way to accomplish this in Xamarin.Forms?
Make the first column 'auto' and the second '*'. According to the docs auto should be the size of its children and * will take the remaining space.
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

Why is the width attribute of a XUL button ignored?

I have problems to set the width of my XUL button. I have this code:
<button label="Ok" width="16" maxwidth="16" height="16" maxheight="16"/>
By with that code, the size of my entire window is changed and not only the button.
And when I write that :
<button label="Ok" width="16" height="16"/>
Only the height is changed. Why is that?
XUL uses the flexible box model for positioning. The width and height attributes define the intrinsic size of the element, not the size at which they are displayed. Your button is apparently placed in a vertical box (not necessarily the actual vbox element, rather any element with orient="vertical"). By default, the align attribute of a box is assumed to have the value stretch - so a vertical box will always stretch the elements inside it horizontally:
<vbox>
<!-- this button is stretched horizontally to match the width of its container -->
<button label="Ok" width="16" height="16"/>
</vbox>
You can set the align attribute explicitly to avoid this:
<vbox align="center">
<!-- this button is centered inside its container -->
<button label="Ok" width="16" height="16"/>
</vbox>

WPF : How to bind StackPanel height (which is auto) to ImageControl height?

I have stackPanel created in design (xmal) which has Auto height and width. Adding list of image controls dynamically in Code on Load to stackPanel. Now it works fine. But when i try to resize the window, though the stack panel gets resized due to auto, but not the image contrl.
How to bind the actualheight of stackpanel dynamically to image control height, (so when ever stakpanl height gets changed ,image control also should get changed !!).
thanks
Use a ViewBox
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<Viewbox MaxWidth="500" MaxHeight="500" Name="vb1">
<Image Source="tulip_farm.jpg"/>
</Viewbox>
</StackPanel>
How to: Apply Stretch Properties to the Contents of a Viewbox
Or you could use binding as below:
<StackPanel x:Name="MyStackPanel">
<Image Source="C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg" Stretch="Uniform" Height="{Binding ElementName=MyStackPanel, Path=ActualHeight}"></Image>
</StackPanel>

Resources