Partial views, filling up UI
This commit is contained in:
25
AdventureWorks.MAUI/ViewsPartial/HeaderView.xaml
Normal file
25
AdventureWorks.MAUI/ViewsPartial/HeaderView.xaml
Normal file
@ -0,0 +1,25 @@
|
||||
<?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.HeaderView">
|
||||
|
||||
<Grid RowDefinitions="Auto,Auto,Auto">
|
||||
|
||||
<Label Grid.Row="0"
|
||||
Text="{Binding ViewTitle}"
|
||||
HorizontalOptions="Center"
|
||||
FontSize="Title" />
|
||||
|
||||
<Label Grid.Row="1"
|
||||
Grid.ColumnSpan="2"
|
||||
Text="{Binding ViewDescription}"
|
||||
HorizontalOptions="Center"
|
||||
FontSize="Body" />
|
||||
|
||||
<BoxView Grid.Row="2"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="0,0,0,20"
|
||||
HeightRequest="1"
|
||||
Color="Black" />
|
||||
</Grid>
|
||||
</ContentView>
|
||||
30
AdventureWorks.MAUI/ViewsPartial/HeaderView.xaml.cs
Normal file
30
AdventureWorks.MAUI/ViewsPartial/HeaderView.xaml.cs
Normal file
@ -0,0 +1,30 @@
|
||||
namespace AdventureWorks.MAUI.ViewsPartial;
|
||||
|
||||
public partial class HeaderView : ContentView
|
||||
{
|
||||
public HeaderView()
|
||||
{
|
||||
InitializeComponent();
|
||||
ViewTitle = "View Title";
|
||||
ViewDescription = "View Description";
|
||||
this.BindingContext = this;
|
||||
}
|
||||
|
||||
public string ViewTitle
|
||||
{
|
||||
get { return (string)GetValue(ViewTitleProperty); }
|
||||
set { SetValue(ViewTitleProperty, value); }
|
||||
}
|
||||
|
||||
public string ViewDescription
|
||||
{
|
||||
get { return (string)GetValue(ViewDescriptionProperty); }
|
||||
set { SetValue(ViewDescriptionProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly BindableProperty ViewTitleProperty =
|
||||
BindableProperty.Create(nameof(ViewTitle), typeof(string), typeof(HeaderView), string.Empty);
|
||||
|
||||
public static readonly BindableProperty ViewDescriptionProperty =
|
||||
BindableProperty.Create(nameof(ViewDescription), typeof(string), typeof(HeaderView), default(string));
|
||||
}
|
||||
Reference in New Issue
Block a user