Federal09
Federal09

Reputation: 649

Center Content XAML

How to center the element on XAML Windows 8.1? When set the margin after star application on full screen i see this: enter image description here

<ProgressRing   Name="Load" 
                IsActive="True" 
                HorizontalAlignment="Stretch"
                Margin="672,373,674,373" 
                VerticalAlignment="Stretch" 
                Foreground="White"/>

<TextBlock  Margin="528,466,526,256" 
            TextWrapping="Wrap" 
            Text="Caricamento..." 
            FontSize="50" 
            IsRightTapEnabled="False" 
            IsHoldingEnabled="False" 
            IsDoubleTapEnabled="False" 
            IsTapEnabled="False" 
            Foreground="White"/>

in programmer mode i see this: enter image description here

Upvotes: 3

Views: 4252

Answers (1)

DROP TABLE users
DROP TABLE users

Reputation: 1955

Try this, using HorizontalAlignment and VerticalAlignment center. And not the margins.

<ProgressRing   Name="Load" 
                IsActive="True" 
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Foreground="White"/>

<TextBlock  TextWrapping="Wrap" 
            Text="Caricamento..." 
            FontSize="50" 
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            IsRightTapEnabled="False" 
            IsHoldingEnabled="False" 
            IsDoubleTapEnabled="False" 
            IsTapEnabled="False" 
            Foreground="White"/>

Upvotes: 3

Related Questions