Resolution problem in silverlight

HI, I need to have an independent permission interface in a silverlight application. Will this be supported implicitly or should care be taken to execute the ScaleTransform code?

Will it support multiple browsers?

Thanks in advance.

0
source share
2 answers

You can use the ViewBox control in the Silverlight Toolkit to scale. It will work on all supported browsers.

You can also set the width and height of the UserControl in Auto (or delete them), and then configure your user interface (but not resize) for the rules you configured (usually using the Grid control).

+2
source

Well, I decided that I will describe all the methods that you can use the implicit methods that Silverlight allows you to specify the size.

If you define something using the Stretch parameter for the VerticalAlignment parameter in the control:

<TextBox Grid.Column="0" Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>

The UIElement will stretch to cover all the space available to it in its parent control. Another option, for example, is to do something like determining the grid column width or row height as follows:

<ColumnDefinition Width="*"/>

It will take up all the space available on the screen.

You can grow columns and grid lines in the form of a relation:

<RowDefinition Height="3*"/> <RowDefinition Height="2*"/>

This will increase the height of the first row by 3px for every 2px than the second.

Then you may have options like Auto

<ColumnDefinition Width="Auto"/>

This will increase the UIElement according to size requirements. If a child of an element requires a larger size, the element takes up more space on the screen.

And finally:

<TextBox Grid.Column="1" Grid.Row="0" Height="100" MinWidth="200" MaxWidth="400" x:Name="text"/>

These are fixed values โ€‹โ€‹and ensures that at any resolution the element will not occupy more than 400 pixels in width, but not less than 200 pixels. It also indicates that the height of the element should always be 100 pixels. This is useful for elements such as buttons, etc., which you do not want to increase or decrease when changing the resolution.

Finally, you probably want to wrap the ScrollViewer around everything, just to make sure the items on the screen can be scrolled. This can happen when your view requires more space than is available on the screen, or has items set to Auto .

0
source

Source: https://habr.com/ru/post/1301213/


All Articles