Borders, Frames scrollers

This commit is contained in:
2025-08-18 08:05:28 +02:00
parent ba8acd09e4
commit ebbea4c1d4
8 changed files with 170 additions and 98 deletions

View File

@ -71,6 +71,9 @@
</ItemGroup>
<ItemGroup>
<MauiXaml Update="ViewsPartial\AddressView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ViewsPartial\HeaderView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

View File

@ -3,10 +3,13 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="AdventureWorks.MAUI.MainPage"
Title="{StaticResource ApplicationTitle}">
<Border Stroke="Black" StrokeThickness="2"
HorizontalOptions="Center"
VerticalOptions="Center"
Padding="10">
<Label Text="{StaticResource ApplicationTitle}"
FontSize="Large"
HorizontalOptions="Center"
VerticalOptions="Center" />
</Border>
</ContentPage>

View File

@ -15,6 +15,15 @@
<Setter Property="Margin" Value="{StaticResource DefaultSpacingForGrid}" />
<Setter Property="Padding" Value="{StaticResource DefaultSpacingForGrid}" />
</Style>
<Style TargetType="Border"
x:Key="Border.Page">
<Setter Property="Stroke" Value="Gray" />
<Setter Property="StrokeThickness" Value="1" />
<Setter Property="Margin" Value="5" />
<Setter Property="HorizontalOptions" Value="Fill" />
<Setter Property="VerticalOptions" Value="Fill" />
</Style>
<Style TargetType="Label">
<Setter Property="VerticalTextAlignment" Value="Center" />
</Style>

View File

@ -4,7 +4,7 @@
xmlns:partial="clr-namespace:AdventureWorks.MAUI.ViewsPartial"
x:Class="AdventureWorks.MAUI.Views.LoginView"
Title="Login">
<Border Style="{StaticResource Border.Page}">
<Grid RowDefinitions="Auto, Auto, Auto, Auto"
ColumnDefinitions="Auto, *"
Style="{StaticResource Grid.Page}">
@ -30,6 +30,6 @@
Text="Login"
HorizontalOptions="Center" />
</Grid>
</Border>
</ContentPage>

View File

@ -5,6 +5,8 @@
xmlns:partial="clr-namespace:AdventureWorks.MAUI.ViewsPartial"
Title="Product Information">
<Border Style="{StaticResource Border.Page}">
<ScrollView>
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"
ColumnDefinitions="Auto, *"
Style="{StaticResource Grid.Page}">
@ -20,35 +22,35 @@
<Entry Grid.Row="1"
Grid.Column="1" />
<Label Grid.Row="2"
Text="Xxx" />
Text="Product Number" />
<Entry Grid.Row="2"
Grid.Column="1" />
<Label Grid.Row="3"
Text="Xxx" />
Text="Color" />
<Entry Grid.Row="3"
Grid.Column="1" />
<Label Grid.Row="4"
Text="Xxx" />
Text="Cost" />
<Entry Grid.Row="4"
Grid.Column="1" />
<Label Grid.Row="5"
Text="Xxx" />
Text="Price" />
<Entry Grid.Row="5"
Grid.Column="1" />
<Label Grid.Row="6"
Text="Xxx" />
Text="Size" />
<Entry Grid.Row="6"
Grid.Column="1" />
<Label Grid.Row="7"
Text="Xxx" />
Text="Weight" />
<Entry Grid.Row="7"
Grid.Column="1" />
<Label Grid.Row="8"
Text="Xxx" />
Text="Category" />
<Entry Grid.Row="8"
Grid.Column="1" />
@ -78,5 +80,6 @@
<Button Text="Cancel" />
</HorizontalStackLayout>
</Grid>
</ScrollView>
</Border>
</ContentPage>

View File

@ -5,7 +5,9 @@
xmlns:partial="clr-namespace:AdventureWorks.MAUI.ViewsPartial"
Title="User Information">
<Grid RowDefinitions="Auto, Auto, Auto,Auto, Auto, Auto , Auto"
<Border Style="{StaticResource Border.Page}">
<ScrollView>
<Grid RowDefinitions="Auto, Auto, Auto, Auto,Auto, Auto, Auto , Auto"
ColumnDefinitions="Auto, *"
Style="{StaticResource Grid.Page}">
@ -63,13 +65,18 @@
<CheckBox IsChecked="True"/>
</HorizontalStackLayout>
</FlexLayout>
<HorizontalStackLayout Grid.Row="6"
<partial:AddressView Grid.Row="6"
Grid.ColumnSpan="2" />
<HorizontalStackLayout Grid.Row="7"
Grid.Column="1"
Spacing="5">
<Button Text="Save" />
<Button Text="Cancel" />
</HorizontalStackLayout>
</Grid>
</ScrollView>
</Border>
</ContentPage>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="AdventureWorks.MAUI.ViewsPartial.AddressView">
<Frame>
<StackLayout>
<Label Text="Address Information"
FontSize="Small"
FontAttributes="Bold" />
<BoxView Color="Gray"
HeightRequest="1"
HorizontalOptions="Fill"/>
<Grid RowDefinitions="Auto,Auto,Auto,Auto"
ColumnDefinitions="Auto,*"
Style="{StaticResource Grid.Page}">
<Label Grid.Row="0"
Text="Street"/>
<Entry Grid.Row="0"
Grid.Column="1"/>
<Label Grid.Row="1"
Text="City"/>
<Entry Grid.Row="1"
Grid.Column="1"
Text="" />
<Label Grid.Row="2"
Text="State/Province"/>
<Entry Grid.Row="2"
Grid.Column="1"
Text="" />
<Label Grid.Row="3"
Text="Postal Code"/>
<Entry Grid.Row="3"
Grid.Column="1"
Text="" />
</Grid>
</StackLayout>
</Frame>
</ContentView>

View File

@ -0,0 +1,9 @@
namespace AdventureWorks.MAUI.ViewsPartial;
public partial class AddressView : ContentView
{
public AddressView()
{
InitializeComponent();
}
}