[C#/MAUI/.NET6] VisualStateManager 엘리먼트 : VisualStateGroups 첨부 속성을 Button 객체에서 사용하기
C#/MAUI 2022. 6. 5. 15:16728x90
반응형
728x170
▶ 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">
<StackLayout
HorizontalOptions="Center"
VerticalOptions="Center"
Spacing="10">
<Label Text="프랑수 수도는 어디입니까?" />
<Entry x:Name="entry"
Placeholder="답을 입력해 주시기 바랍니다." />
<Button Text="정답 보기">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Property="Scale" Value="0.8" />
<Setter TargetName="entry"
Property="Entry.Text"
Value="파리" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Button>
</StackLayout>
</ContentPage>
728x90
반응형
그리드형(광고전용)
댓글을 달아 주세요