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>
<ItemGroup> <ItemGroup>
<MauiXaml Update="ViewsPartial\AddressView.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ViewsPartial\HeaderView.xaml"> <MauiXaml Update="ViewsPartial\HeaderView.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>

View File

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

View File

@ -15,6 +15,15 @@
<Setter Property="Margin" Value="{StaticResource DefaultSpacingForGrid}" /> <Setter Property="Margin" Value="{StaticResource DefaultSpacingForGrid}" />
<Setter Property="Padding" Value="{StaticResource DefaultSpacingForGrid}" /> <Setter Property="Padding" Value="{StaticResource DefaultSpacingForGrid}" />
</Style> </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"> <Style TargetType="Label">
<Setter Property="VerticalTextAlignment" Value="Center" /> <Setter Property="VerticalTextAlignment" Value="Center" />
</Style> </Style>

View File

@ -4,32 +4,32 @@
xmlns:partial="clr-namespace:AdventureWorks.MAUI.ViewsPartial" xmlns:partial="clr-namespace:AdventureWorks.MAUI.ViewsPartial"
x:Class="AdventureWorks.MAUI.Views.LoginView" x:Class="AdventureWorks.MAUI.Views.LoginView"
Title="Login"> Title="Login">
<Border Style="{StaticResource Border.Page}">
<Grid RowDefinitions="Auto, Auto, Auto, Auto" <Grid RowDefinitions="Auto, Auto, Auto, Auto"
ColumnDefinitions="Auto, *" ColumnDefinitions="Auto, *"
Style="{StaticResource Grid.Page}"> Style="{StaticResource Grid.Page}">
<partial:HeaderView Grid.Row="0" <partial:HeaderView Grid.Row="0"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
ViewTitle="Login" ViewTitle="Login"
ViewDescription="Please enter your credentials to login." /> ViewDescription="Please enter your credentials to login." />
<Label Grid.Row="1" <Label Grid.Row="1"
Text="Login ID" /> Text="Login ID" />
<Entry Grid.Row="1" <Entry Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Placeholder="Enter your username" /> Placeholder="Enter your username" />
<Label Grid.Row="2" <Label Grid.Row="2"
Text="Password" /> Text="Password" />
<Entry Grid.Row="2" <Entry Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Placeholder="Enter your password" Placeholder="Enter your password"
IsPassword="True" /> IsPassword="True" />
<Button Grid.Row="3" <Button Grid.Row="3"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
Text="Login" Text="Login"
HorizontalOptions="Center" /> HorizontalOptions="Center" />
</Grid> </Grid>
</Border>
</ContentPage> </ContentPage>

View File

@ -5,78 +5,81 @@
xmlns:partial="clr-namespace:AdventureWorks.MAUI.ViewsPartial" xmlns:partial="clr-namespace:AdventureWorks.MAUI.ViewsPartial"
Title="Product Information"> Title="Product Information">
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto" <Border Style="{StaticResource Border.Page}">
<ScrollView>
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"
ColumnDefinitions="Auto, *" ColumnDefinitions="Auto, *"
Style="{StaticResource Grid.Page}"> Style="{StaticResource Grid.Page}">
<partial:HeaderView Grid.Row="0" <partial:HeaderView Grid.Row="0"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
ViewTitle="Product Information" ViewTitle="Product Information"
ViewDescription="Use this Screen to Modify Product Information." /> ViewDescription="Use this Screen to Modify Product Information." />
<Label Grid.Row="1" <Label Grid.Row="1"
Text="Product Name" /> Text="Product Name" />
<Entry Grid.Row="1" <Entry Grid.Row="1"
Grid.Column="1" /> Grid.Column="1" />
<Label Grid.Row="2" <Label Grid.Row="2"
Text="Xxx" /> Text="Product Number" />
<Entry Grid.Row="2" <Entry Grid.Row="2"
Grid.Column="1" /> Grid.Column="1" />
<Label Grid.Row="3" <Label Grid.Row="3"
Text="Xxx" /> Text="Color" />
<Entry Grid.Row="3" <Entry Grid.Row="3"
Grid.Column="1" /> Grid.Column="1" />
<Label Grid.Row="4" <Label Grid.Row="4"
Text="Xxx" /> Text="Cost" />
<Entry Grid.Row="4" <Entry Grid.Row="4"
Grid.Column="1" /> Grid.Column="1" />
<Label Grid.Row="5" <Label Grid.Row="5"
Text="Xxx" /> Text="Price" />
<Entry Grid.Row="5" <Entry Grid.Row="5"
Grid.Column="1" /> Grid.Column="1" />
<Label Grid.Row="6" <Label Grid.Row="6"
Text="Xxx" /> Text="Size" />
<Entry Grid.Row="6" <Entry Grid.Row="6"
Grid.Column="1" /> Grid.Column="1" />
<Label Grid.Row="7" <Label Grid.Row="7"
Text="Xxx" /> Text="Weight" />
<Entry Grid.Row="7" <Entry Grid.Row="7"
Grid.Column="1" /> Grid.Column="1" />
<Label Grid.Row="8" <Label Grid.Row="8"
Text="Xxx" /> Text="Category" />
<Entry Grid.Row="8" <Entry Grid.Row="8"
Grid.Column="1" /> Grid.Column="1" />
<Label Grid.Row="9" <Label Grid.Row="9"
Text="Model" /> Text="Model" />
<Entry Grid.Row="9" <Entry Grid.Row="9"
Grid.Column="1" /> Grid.Column="1" />
<Label Grid.Row="10" <Label Grid.Row="10"
Text="Selling Start Date" /> Text="Selling Start Date" />
<Entry Grid.Row="10" <Entry Grid.Row="10"
Grid.Column="1" /> Grid.Column="1" />
<Label Grid.Row="11" <Label Grid.Row="11"
Text="Selling End Date" /> Text="Selling End Date" />
<Entry Grid.Row="11" <Entry Grid.Row="11"
Grid.Column="1" /> Grid.Column="1" />
<Label Grid.Row="12" <Label Grid.Row="12"
Text="Discontinued Date" /> Text="Discontinued Date" />
<Entry Grid.Row="12" <Entry Grid.Row="12"
Grid.Column="1" /> Grid.Column="1" />
<HorizontalStackLayout Grid.Row="13"
Grid.ColumnSpan="1">
<Button Text="Save" />
<Button Text="Cancel" />
</HorizontalStackLayout>
</Grid>
<HorizontalStackLayout Grid.Row="13"
Grid.ColumnSpan="1">
<Button Text="Save" />
<Button Text="Cancel" />
</HorizontalStackLayout>
</Grid>
</ScrollView>
</Border>
</ContentPage> </ContentPage>

View File

@ -5,71 +5,78 @@
xmlns:partial="clr-namespace:AdventureWorks.MAUI.ViewsPartial" xmlns:partial="clr-namespace:AdventureWorks.MAUI.ViewsPartial"
Title="User Information"> 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, *" ColumnDefinitions="Auto, *"
Style="{StaticResource Grid.Page}"> Style="{StaticResource Grid.Page}">
<partial:HeaderView Grid.Row="0" <partial:HeaderView Grid.Row="0"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
ViewTitle="User Information" ViewTitle="User Information"
ViewDescription="Use this Screen to Modify User Information." /> ViewDescription="Use this Screen to Modify User Information." />
<Label Grid.Row="1" <Label Grid.Row="1"
Text="Login ID" /> Text="Login ID" />
<VerticalStackLayout Grid.Row="3" <VerticalStackLayout Grid.Row="3"
Grid.Column="1"> Grid.Column="1">
<Entry Text="" <Entry Text=""
Placeholder="Please use a combination of letters and numbers."/> Placeholder="Please use a combination of letters and numbers."/>
<Label FontSize="Micro" <Label FontSize="Micro"
Text="Please use a combination of letters and numbers." /> Text="Please use a combination of letters and numbers." />
</VerticalStackLayout> </VerticalStackLayout>
<Label Grid.Row="2" <Label Grid.Row="2"
Text="First Name" /> Text="First Name" />
<Entry Grid.Row="2" <Entry Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Text=""/> Text=""/>
<Label Grid.Row="3" <Label Grid.Row="3"
Text="Last Name" /> Text="Last Name" />
<Entry Grid.Row="3" <Entry Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Text=""/> Text=""/>
<Label Grid.Row="4" <Label Grid.Row="4"
Text="Email Address" /> Text="Email Address" />
<Entry Grid.Row="4" <Entry Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Text=""/> Text=""/>
<Label Grid.Row="5" Text="Is Enrolled ?"/> <Label Grid.Row="5" Text="Is Enrolled ?"/>
<FlexLayout Grid.Row="5" <FlexLayout Grid.Row="5"
Grid.Column="1" Grid.Column="1"
Wrap="Wrap" Wrap="Wrap"
Direction="Row"> Direction="Row">
<HorizontalStackLayout> <HorizontalStackLayout>
<Label Text="401k?"/> <Label Text="401k?"/>
<CheckBox IsChecked="True"/> <CheckBox IsChecked="True"/>
</HorizontalStackLayout> </HorizontalStackLayout>
<HorizontalStackLayout > <HorizontalStackLayout >
<Label Text="Flex Time?"/> <Label Text="Flex Time?"/>
<CheckBox IsChecked="False"/> <CheckBox IsChecked="False"/>
</HorizontalStackLayout> </HorizontalStackLayout>
<HorizontalStackLayout > <HorizontalStackLayout >
<Label Text="Health Care?"/> <Label Text="Health Care?"/>
<CheckBox IsChecked="True"/> <CheckBox IsChecked="True"/>
</HorizontalStackLayout> </HorizontalStackLayout>
<HorizontalStackLayout > <HorizontalStackLayout >
<Label Text="Health Savings Account?"/> <Label Text="Health Savings Account?"/>
<CheckBox IsChecked="True"/> <CheckBox IsChecked="True"/>
</HorizontalStackLayout> </HorizontalStackLayout>
</FlexLayout> </FlexLayout>
<HorizontalStackLayout Grid.Row="6"
<partial:AddressView Grid.Row="6"
Grid.ColumnSpan="2" />
<HorizontalStackLayout Grid.Row="7"
Grid.Column="1" Grid.Column="1"
Spacing="5"> Spacing="5">
<Button Text="Save" /> <Button Text="Save" />
<Button Text="Cancel" /> <Button Text="Cancel" />
</HorizontalStackLayout> </HorizontalStackLayout>
</Grid> </Grid>
</ScrollView>
</Border>
</ContentPage> </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();
}
}