728x90
반응형
728x170
▶ App.xaml
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application x:Class="TestProject.App"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Application.Resources>
<ControlTemplate x:Key="TealControlTemplateKey">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.1*" />
<RowDefinition Height="0.8*" />
<RowDefinition Height="0.1*" />
</Grid.RowDefinitions>
<BoxView Color="Teal" />
<Label
VerticalOptions="Center"
Margin="20,0,0,0"
FontSize="24"
TextColor="White"
Text="{TemplateBinding Title}" />
<ContentPresenter Grid.Row="1" />
<BoxView Grid.Row="2"
Color="Teal" />
<Label Grid.Row="2"
HorizontalOptions="Start"
VerticalOptions="Center"
Margin="20,0,0,0"
TextColor="White"
Text="테마 변경" />
<Label Grid.Row="2"
VerticalOptions="Center"
HorizontalOptions="End"
Margin="0,0,20,0"
TextColor="White"
Text="도움말" />
</Grid>
</ControlTemplate>
</Application.Resources>
</Application>
728x90
▶ MainPage.xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="TestProject.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
ControlTemplate="{StaticResource TealControlTemplateKey}"
Title="테스트 앱">
<StackLayout
HorizontalOptions="Center"
VerticalOptions="Center"
Spacing="10">
<Entry
HorizontalOptions="Center"
Placeholder="사용자명을 입력해 주시기 바랍니다." />
<Entry
HorizontalOptions="Center"
Placeholder="패스워드를 입력해 주시기 바랍니다."
IsPassword="True" />
<Button
HorizontalOptions="Center"
Text="로그인" />
</StackLayout>
</ContentPage>
728x90
반응형
그리드형(광고전용)
'C# > MAUI' 카테고리의 다른 글
[C#/MAUI/.NET6] DataTemplate 엘리먼트 : 인라인 데이터 템플리트 사용하기 (0) | 2022.06.23 |
---|---|
[C#/MAUI/.NET6] RelativeSource 태그 확장 : 바인딩 뷰 모델 참조하기 (0) | 2022.06.23 |
[C#/MAUI/.NET6] ControlTemplate 엘리먼트 : 템플리트에서 뷰 모델 바인딩하기 (0) | 2022.06.23 |
[C#/MAUI/.NET6] TemplatedView 클래스 : GetTemplateChild 메소드를 사용해 템플리트 내 객체 구하기 (0) | 2022.06.23 |
[C#/MAUI/.NET6] 프로젝트 파일에 스플래시 화면 추가하기 (0) | 2022.06.22 |
[C#/MAUI/.NET6] Style 엘리먼트 : TargetTye 속성을 사용해 컨트롤 템플리트 설정하기 (0) | 2022.06.22 |
[C#/MAUI/.NET6] ControlTemplate 엘리먼트 : ContentView 엘리먼트 정의하기 (커스텀 컨트롤 만들기) (0) | 2022.06.22 |
[C#/MAUI/.NET6] ContentView 엘리먼트 : 카드 뷰 만들기 (0) | 2022.06.22 |
[C#/MAUI/.NET6] StyleSheet 엘리먼트 : Source 속성을 사용해 CSS 파일 로드하기 (0) | 2022.06.22 |
[C#/MAUI/.NET6] 프로젝트 파일에 앱 아이콘 추가하기 (0) | 2022.06.22 |
댓글을 달아 주세요