Skip to content

Commit

Permalink
Replace all StackLayout with the oriented ones
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis committed May 4, 2024
1 parent ead511e commit e9e34ea
Show file tree
Hide file tree
Showing 237 changed files with 814 additions and 870 deletions.
2 changes: 1 addition & 1 deletion 8.0/Apps/BugSweeper/BugSweeper/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
TextColor="Red" />
<Label Text="!"
TextColor="Red" />
</StackLayout>
</VerticalStackLayout>
<HorizontalStackLayout x:Name="consolationText"
HorizontalOptions="Center">
<Label Text="T"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ListView.ItemTemplate>
<DataTemplate x:DataType="local:NamedColor">
<ViewCell>
<StackLayout Orientation="Horizontal">
<HorizontalStackLayout>
<BoxView Color="{Binding Color}"
HeightRequest="32"
WidthRequest="32"
Expand All @@ -26,7 +26,7 @@
<Label Text="{Binding FriendlyName}"
FontSize="24"
VerticalOptions="Center" />
</StackLayout>
</HorizontalStackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@
<Entry Text="{Binding Name}"
Grid.Row="0" Grid.Column="1" />
<Label Text="Age: " Grid.Row="1" Grid.Column="0" />
<StackLayout Orientation="Horizontal"
Grid.Row="1" Grid.Column="1">
<HorizontalStackLayout Grid.Row="1" Grid.Column="1">
<Stepper Value="{Binding Age}"
Maximum="100" />
<Label Text="{Binding Age, StringFormat='{0} years old'}"
VerticalOptions="Center" />
</StackLayout>
</HorizontalStackLayout>
<Label Text="Skills: " Grid.Row="2" Grid.Column="0" />
<Entry Text="{Binding Skills}"
Grid.Row="2" Grid.Column="1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal">
<HorizontalStackLayout>
<Label Text="{Binding Fullname}"
VerticalOptions="Center" />
<!--
Expand All @@ -25,7 +25,7 @@
Command="{Binding Source={RelativeSource AncestorType={x:Type local:PeopleViewModel}}, Path=DeleteEmployeeCommand}"
CommandParameter="{Binding}"
HorizontalOptions="End" />
</StackLayout>
</HorizontalStackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
</Border>
</ControlTemplate>
</ContentPage.Resources>
<StackLayout Margin="30" Spacing="30">
<VerticalStackLayout Margin="30" Spacing="30">
<controls:CardView BorderColor="DarkGray"
CardTitle="John Doe"
CardDescription="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla elit dolor, convallis non interdum."
Expand All @@ -80,5 +80,5 @@
IconBackgroundColor="SlateGray"
IconImageSource="user.png"
ControlTemplate="{StaticResource CardViewControlTemplate}" />
</StackLayout>
</VerticalStackLayout>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="DataBindingDemos.ReverseBindingPage"
Title="Reverse Binding">
<StackLayout Padding="10, 0">
<VerticalStackLayout Padding="10, 0">

<Label x:Name="label"
Text="TEXT"
Expand All @@ -15,5 +15,5 @@
VerticalOptions="Center"
Value="{Binding Source={x:Reference label},
Path=Opacity}" />
</StackLayout>
</VerticalStackLayout>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
</Grid.RowDefinitions>
<BoxView Color="{Binding Color}"
Grid.Row="0" />
<StackLayout Grid.Row="1"
<VerticalStackLayout Grid.Row="1"
Margin="10, 0">
<Label Text="{Binding Name}"
HorizontalTextAlignment="Center" />
<Slider Value="{Binding Hue}" />
<Slider Value="{Binding Saturation}" />
<Slider Value="{Binding Luminosity}" />
</StackLayout>
</VerticalStackLayout>
</Grid>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</Style>
</ContentPage.Resources>

<StackLayout Margin="10">
<VerticalStackLayout Margin="10">
<Slider x:Name="slider" />
<Label Text="{Binding Source={x:Reference slider},
Path=Value,
Expand All @@ -39,20 +39,20 @@

<BoxView />

<StackLayout BindingContext="{x:Static sys:DateTime.Now}">
<VerticalStackLayout BindingContext="{x:Static sys:DateTime.Now}">
<Label Text="{Binding}" />
<Label Text="{Binding Path=Ticks,
StringFormat='{0:N0} ticks since 1/1/1'}" />
<Label Text="{Binding StringFormat='The {{0:MMMM}} specifier produces {0:MMMM}'}" />
<Label Text="{Binding StringFormat='The long date is {0:D}'}" />
</StackLayout>
</VerticalStackLayout>

<BoxView />

<StackLayout BindingContext="{x:Static sys:Math.PI}">
<VerticalStackLayout BindingContext="{x:Static sys:Math.PI}">
<Label Text="{Binding}" />
<Label Text="{Binding StringFormat='PI to 4 decimal points = {0:F4}'}" />
<Label Text="{Binding StringFormat='PI in scientific notation = {0:E7}'}" />
</StackLayout>
</StackLayout>
</VerticalStackLayout>
</VerticalStackLayout>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
</Style>
</ContentPage.Resources>

<StackLayout Padding="10, 0">
<StackLayout Orientation="Horizontal"
VerticalOptions="Center">
<VerticalStackLayout Padding="10, 0">
<HorizontalStackLayout VerticalOptions="Center">
<Label Text="Subscribe?" />
<Switch x:Name="switch1" />
<Label>
Expand All @@ -32,10 +31,9 @@
</Binding>
</Label.Text>
</Label>
</StackLayout>
</HorizontalStackLayout>

<StackLayout Orientation="Horizontal"
VerticalOptions="Center">
<HorizontalStackLayout VerticalOptions="Center">
<Label Text="Allow popups?" />
<Switch x:Name="switch2" />
<Label>
Expand All @@ -60,10 +58,9 @@
</Binding>
</Label.TextColor>
</Label>
</StackLayout>
</HorizontalStackLayout>

<StackLayout Orientation="Horizontal"
VerticalOptions="Center">
<HorizontalStackLayout VerticalOptions="Center">
<Label Text="Learn more?" />
<Switch x:Name="switch3" />
<Label FontSize="18"
Expand Down Expand Up @@ -93,6 +90,6 @@
</Binding>
</Label.Style>
</Label>
</StackLayout>
</StackLayout>
</HorizontalStackLayout>
</VerticalStackLayout>
</ContentPage>
4 changes: 2 additions & 2 deletions 8.0/Fundamentals/Shell/Xaminals/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@
<!-- Not required, as the FlyoutFooter is set above -->
<!--<Shell.FlyoutFooterTemplate>
<DataTemplate>
<StackLayout>
<VerticalStackLayout>
<Label Text="Xaminals"
TextColor="GhostWhite"
FontAttributes="Bold"
HorizontalOptions="Center" />
<Label Text="{Binding Source={x:Static sys:DateTime.Now}, StringFormat='{0:MMMM dd, yyyy}'}"
TextColor="GhostWhite"
HorizontalOptions="Center" />
</StackLayout>
</VerticalStackLayout>
</DataTemplate>
</Shell.FlyoutFooterTemplate>-->

Expand Down
4 changes: 2 additions & 2 deletions 8.0/Fundamentals/Shell/Xaminals/Controls/FlyoutFooter.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard"
x:Class="Xaminals.Controls.FlyoutFooter">
<StackLayout>
<VerticalStackLayout>
<Label Text="Xaminals"
TextColor="GhostWhite"
FontAttributes="Bold"
HorizontalOptions="Center" />
<Label Text="{Binding Source={x:Static sys:DateTime.Now}, StringFormat='{0:MMMM dd, yyyy}'}"
TextColor="GhostWhite"
HorizontalOptions="Center" />
</StackLayout>
</VerticalStackLayout>
</ContentView>
4 changes: 2 additions & 2 deletions 8.0/Fundamentals/Shell/Xaminals/Views/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
HorizontalOptions="Center"
Aspect="AspectFit" />
<ScrollView Grid.Row="1">
<StackLayout Orientation="Vertical"
<VerticalStackLayout Orientation="Vertical"
Padding="16,40,16,40"
Spacing="10">
<Label FontSize="22">
Expand Down Expand Up @@ -56,7 +56,7 @@
CommandParameter="https://docs.microsoft.com/dotnet/maui"
BackgroundColor="{StaticResource Primary}"
TextColor="White" />
</StackLayout>
</VerticalStackLayout>
</ScrollView>
</Grid>
</ScrollView>
Expand Down
4 changes: 2 additions & 2 deletions 8.0/Fundamentals/Shell/Xaminals/Views/BearDetailPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
x:Class="Xaminals.Views.BearDetailPage"
Title="Bear Details">
<ScrollView>
<StackLayout Margin="20">
<VerticalStackLayout Margin="20">
<Label Text="{Binding Bear.Name}"
HorizontalOptions="Center"
Style="{DynamicResource TitleStyle}" />
Expand All @@ -17,6 +17,6 @@
HorizontalOptions="Center" />
<Label Text="{Binding Bear.Details}"
Style="{DynamicResource BodyStyle}" />
</StackLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
4 changes: 2 additions & 2 deletions 8.0/Fundamentals/Shell/Xaminals/Views/CatDetailPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
x:Class="Xaminals.Views.CatDetailPage"
Title="Cat Details">
<ScrollView>
<StackLayout Margin="20">
<VerticalStackLayout Margin="20">
<Label Text="{Binding Name}"
HorizontalOptions="Center"
Style="{DynamicResource TitleStyle}" />
Expand All @@ -17,6 +17,6 @@
HorizontalOptions="Center" />
<Label Text="{Binding Details}"
Style="{DynamicResource BodyStyle}" />
</StackLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
4 changes: 2 additions & 2 deletions 8.0/Fundamentals/Shell/Xaminals/Views/DogDetailPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
x:Class="Xaminals.Views.DogDetailPage"
Title="Dog Details">
<ScrollView>
<StackLayout Margin="20">
<VerticalStackLayout Margin="20">
<Label Text="{Binding Name}"
HorizontalOptions="Center"
Style="{DynamicResource TitleStyle}" />
Expand All @@ -17,6 +17,6 @@
HorizontalOptions="Center" />
<Label Text="{Binding Details}"
Style="{DynamicResource BodyStyle}" />
</StackLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
4 changes: 2 additions & 2 deletions 8.0/Fundamentals/Shell/Xaminals/Views/ElephantDetailPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
x:Class="Xaminals.Views.ElephantDetailPage"
Title="Elephant Details">
<ScrollView>
<StackLayout Margin="20">
<VerticalStackLayout Margin="20">
<Label Text="{Binding Elephant.Name}"
HorizontalOptions="Center"
Style="{DynamicResource TitleStyle}" />
Expand All @@ -17,6 +17,6 @@
HorizontalOptions="Center" />
<Label Text="{Binding Elephant.Details}"
Style="{DynamicResource BodyStyle}" />
</StackLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
4 changes: 2 additions & 2 deletions 8.0/Fundamentals/Shell/Xaminals/Views/MonkeyDetailPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</Shell.BackButtonBehavior>-->

<ScrollView>
<StackLayout Margin="20">
<VerticalStackLayout Margin="20">
<Label Text="{Binding Monkey.Name}"
HorizontalOptions="Center"
Style="{DynamicResource TitleStyle}" />
Expand All @@ -25,6 +25,6 @@
HorizontalOptions="Center" />
<Label Text="{Binding Monkey.Details}"
Style="{DynamicResource BodyStyle}" />
</StackLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
</Style>
</ContentPage.Resources>

<StackLayout Margin="20">
<VerticalStackLayout Margin="20">
<Label Text="This page contains four Label objects in a StackLayout." />
<Label Text="When the window width is >= 800 the StackLayout orientation will change." />
<Label Text="This is achieved with an AdaptiveTrigger." />
<Label Text="This page is most easily demonstrated on Windows." />
</StackLayout>
</VerticalStackLayout>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
Margin="24"
HorizontalOptions="Center"
VerticalOptions="Center">
<StackLayout Orientation="Horizontal">
<HorizontalStackLayout>
<CheckBox x:Name="checkBox"
VerticalOptions="Center" />
<Label Text="Check the CheckBox to modify the Grid background color."
VerticalOptions="Center" />
</StackLayout>
</HorizontalStackLayout>
</Frame>
</Grid>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="WorkingWithTriggers.DataTriggerXaml"
Padding="20, 50, 20, 0">
<StackLayout Spacing="20">
<VerticalStackLayout Spacing="20">
<Label FontSize="20"
Text="DataTrigger Example" />
<Label Text="Entry requires length>0 before button is enabled"
Expand All @@ -26,5 +26,5 @@
</DataTrigger>
</Button.Triggers>
</Button>
</StackLayout>
</VerticalStackLayout>
</ContentPage>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</ResourceDictionary>
</ContentPage.Resources>

<StackLayout Spacing="20">
<VerticalStackLayout Spacing="20">
<Label Text="EnterAction and ExitAction"
FontSize="20" />
<Label Text="FadeTriggerAction is triggered by IsFocused"
Expand All @@ -51,5 +51,5 @@
Text="Xamarin" />
<Entry Placeholder="enter industry"
Text="" />
</StackLayout>
</VerticalStackLayout>
</ContentPage>
Loading

0 comments on commit e9e34ea

Please sign in to comment.