Hello!
I want to adjust the size of the panel or font by the horizontal and vertical resolution of the device. That is, we want to represent the view in different lengths depending on the size of the device.
I used a function to measure the size of the device.
However, the way I write it seems to dirty the source too. I want to know if there is another good way.
Help me
var width = Observable();
var height = Observable();
function placed(args) {
width.value = args.width;
height.value = args.height;
}
<Panel Height="{height}/19.685714286" Margin="{width}/53.571428571,0" Clicked="{changedGender}">
<Text Value="Change" FontSize="{width}/31.25" Alignment="Center" Color="White" />
<Rectangle ux:Name="test" Layer="Background" Color="Purple" >
<DropShadow Angle="90" Distance="1" Spread="0.2" Size="2" Color="#00000020" />
<Stroke Width="0.3" Color="Purple"/>
</Rectangle>
<WhilePressed>
<Scale Factor=".98" Duration=".08" Easing="QuadraticOut" />
</WhilePressed>
</Panel>