1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <ContentPage xmlns =" http://schemas.microsoft.com/dotnet/2021/maui"
3+ xmlns : x =" http://schemas.microsoft.com/winfx/2009/xaml"
4+ xmlns : local =" clr-namespace:Maui.Controls.Sample"
5+ x : Class =" Maui.Controls.Sample.BoxViewControlMainPage"
6+ x : DataType =" local:BoxViewViewModel"
7+ Title =" BoxViewControlPage" >
8+
9+ <Grid >
10+ <Grid .RowDefinitions>
11+ <RowDefinition Height =" *" />
12+ <RowDefinition Height =" Auto" />
13+ </Grid .RowDefinitions>
14+
15+ <!-- BoxView at top center -->
16+ <BoxView Grid.Row=" 0"
17+ Color =" {Binding Color}"
18+ WidthRequest =" {Binding Width}"
19+ Opacity =" {Binding Opacity}"
20+ HeightRequest =" {Binding Height}"
21+ CornerRadius =" {Binding CornerRadius}"
22+ IsVisible =" {Binding IsVisible}"
23+ Shadow =" {Binding BoxShadow}"
24+ VerticalOptions =" Center"
25+ FlowDirection =" {Binding FlowDirection}"
26+ HorizontalOptions =" Center" />
27+
28+ <!-- Controls at bottom -->
29+ <Grid Grid.Row=" 1"
30+ ColumnSpacing =" 20"
31+ VerticalOptions =" End"
32+ HorizontalOptions =" Center" >
33+
34+ <Grid .ColumnDefinitions>
35+ <ColumnDefinition Width =" Auto" />
36+ <ColumnDefinition Width =" Auto" />
37+ </Grid .ColumnDefinitions>
38+
39+ <!-- Left Column - Entry Controls -->
40+ <StackLayout Grid.Column=" 0"
41+ Grid.Row=" 0"
42+ Padding =" 20"
43+ Spacing =" 10" >
44+ <Label FontAttributes =" Bold"
45+ AutomationId =" CornerRadiusLabel"
46+ Text =" Corner Radius" />
47+ <local : UITestEntry x : Name =" CornerRadiusEntry"
48+ AutomationId =" CornerRadiusEntry"
49+ Placeholder =" e.g. 10,20,30,40"
50+ IsCursorVisible =" False"
51+ Text =" {Binding CornerRadiusEntryText, Mode=TwoWay}"
52+ TextChanged =" OnCornerRadiusEntryChanged" />
53+ <Label FontAttributes =" Bold"
54+ AutomationId =" OpacityLabel"
55+ Text =" Opacity" />
56+ <local : UITestEntry x : Name =" OpacityEntry"
57+ Placeholder =" Enter opacity (0.0 - 1.0)"
58+ AutomationId =" OpacityEntry"
59+ IsCursorVisible =" False"
60+ Text =" {Binding OpacityEntryText, Mode=TwoWay}"
61+ TextChanged =" OnOpacityChanged" />
62+
63+ <Button Text =" Reset Changes"
64+ WidthRequest =" 150"
65+ AutomationId =" ResetButton"
66+ Clicked =" OnResetChangesClicked" />
67+ </StackLayout >
68+
69+ <!-- Right Column - Controls -->
70+ <StackLayout Grid.Column=" 1"
71+ Grid.Row=" 0"
72+ Padding =" 20"
73+ Spacing =" 1" >
74+ <Label FontAttributes =" Bold"
75+ Text =" Box Color" />
76+ <VerticalStackLayout >
77+ <RadioButton Content =" Red"
78+ Value =" Red"
79+ GroupName =" Colors"
80+ AutomationId =" RedRadioButton"
81+ IsChecked =" {Binding IsRedChecked, Mode=TwoWay}" />
82+
83+ <RadioButton Content =" Blue"
84+ Value =" Blue"
85+ GroupName =" Colors"
86+ AutomationId =" BlueRadioButton"
87+ IsChecked =" {Binding IsBlueChecked, Mode=TwoWay}" />
88+ </VerticalStackLayout >
89+
90+ <VerticalStackLayout Spacing =" 5" >
91+ <HorizontalStackLayout
92+ Spacing =" 10" >
93+ <CheckBox IsChecked =" {Binding IsVisible}"
94+ AutomationId =" VisibilityCheckBox" />
95+ <Label Text =" Is Visible"
96+ VerticalOptions =" Center" />
97+ </HorizontalStackLayout >
98+ <HorizontalStackLayout Spacing =" 10" >
99+ <CheckBox
100+ IsChecked =" {Binding HasShadow}"
101+ AutomationId =" ShadowCheckBox" />
102+ <Label Text =" Has Shadow"
103+ VerticalOptions =" Center" />
104+ </HorizontalStackLayout >
105+
106+ <Label Text =" Flow Direction:"
107+ FontAttributes =" Bold"
108+ FontSize =" 15" />
109+ <StackLayout Orientation =" Horizontal"
110+ Spacing =" 10" >
111+
112+ <CheckBox x : Name =" FlowDirectionRTLCheckBox"
113+ AutomationId =" FlowDirectionRTLCheckBox"
114+ IsChecked =" False"
115+ CheckedChanged =" OnFlowDirectionCheckBoxChanged" />
116+ <Label Text =" RTL"
117+ VerticalOptions =" Center" />
118+ </StackLayout >
119+
120+ </VerticalStackLayout >
121+ </StackLayout >
122+ </Grid >
123+ </Grid >
124+ </ContentPage >
0 commit comments