Skip to content

Commit 0790fe1

Browse files
authored
Fix MAUI sample panel layouts and interactions (#1778)
1 parent 684f851 commit 0790fe1

5 files changed

Lines changed: 76 additions & 84 deletions

File tree

src/MAUI/Maui.Samples/Samples/Geometry/SnapGeometryEdits/SnapGeometryEdits.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
Text="Enable all"
159159
VerticalOptions="Center" />
160160
</Grid>
161-
<VerticalStackLayout HeightRequest="130" WidthRequest="250">
161+
<VerticalStackLayout HeightRequest="130">
162162
<Grid ColumnSpacing="3">
163163
<Grid.ColumnDefinitions>
164164
<ColumnDefinition Width="auto" />
Lines changed: 66 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,81 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8" ?>
22
<ContentPage
33
x:Class="ArcGIS.Samples.FilterBuildingSceneLayer.FilterBuildingSceneLayer"
44
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
55
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
66
xmlns:local="clr-namespace:ArcGIS.Samples.FilterBuildingSceneLayer"
77
xmlns:esriUI="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui">
8-
<Grid>
8+
<Grid Style="{DynamicResource EsriSampleContainer}">
99
<!-- LocalSceneView displays the 3D building scene. -->
10-
<esriUI:LocalSceneView x:Name="MySceneView" />
10+
<esriUI:LocalSceneView x:Name="MySceneView" Style="{DynamicResource EsriSampleGeoView}" />
1111

12-
<!-- Settings panel for floor filtering and category visibility controls. -->
13-
<Border
14-
x:Name="SettingsPanel"
15-
Margin="10"
16-
Padding="16"
17-
HeightRequest="300"
18-
HorizontalOptions="End"
19-
Style="{DynamicResource EsriSampleControlPanel}"
20-
VerticalOptions="Start"
21-
WidthRequest="250">
22-
<ScrollView>
23-
<VerticalStackLayout Spacing="12">
24-
<!-- Floor selection dropdown. -->
25-
<Grid ColumnDefinitions="Auto,*">
12+
<!-- Control panel: toggles between settings and feature attributes. -->
13+
<Border Style="{DynamicResource EsriSampleControlPanel}">
14+
<Grid>
15+
<!-- Settings panel for floor filtering and category visibility controls. -->
16+
<ScrollView x:Name="SettingsPanel">
17+
<VerticalStackLayout Spacing="12">
18+
<!-- Floor selection dropdown. -->
19+
<Grid ColumnDefinitions="Auto,*">
20+
<Label
21+
Grid.Column="0"
22+
FontAttributes="Bold"
23+
FontSize="14"
24+
Text="Floor:"
25+
VerticalOptions="Center" />
26+
<Picker
27+
x:Name="FloorPicker"
28+
Grid.Column="1"
29+
Margin="10,0,0,0"
30+
SelectedIndexChanged="FloorPicker_SelectedIndexChanged" />
31+
</Grid>
32+
33+
<!-- Category controls for toggling sublayer visibility. -->
2634
<Label
27-
Grid.Column="0"
2835
FontAttributes="Bold"
2936
FontSize="14"
30-
Text="Floor:"
31-
VerticalOptions="Center" />
32-
<Picker
33-
x:Name="FloorPicker"
34-
Grid.Column="1"
35-
Margin="10,0,0,0"
36-
SelectedIndexChanged="FloorPicker_SelectedIndexChanged" />
37-
</Grid>
38-
39-
<!-- Category controls for toggling sublayer visibility. -->
40-
<Label
41-
FontAttributes="Bold"
42-
FontSize="14"
43-
Text="Categories:" />
44-
<VerticalStackLayout x:Name="CategoriesStackLayout" Spacing="4" />
37+
Text="Categories:" />
38+
<VerticalStackLayout x:Name="CategoriesStackLayout" Spacing="4" />
4539

46-
<!-- Instruction text. -->
47-
<BoxView HeightRequest="1" Color="Gray" />
48-
<Label
49-
FontSize="12"
50-
Text="Tap on a building feature to view its attributes."
51-
TextColor="Gray" />
52-
</VerticalStackLayout>
53-
</ScrollView>
54-
</Border>
55-
56-
<!-- Feature attributes panel, shown when a feature is selected. -->
57-
<Border
58-
x:Name="FeaturePanel"
59-
Margin="10"
60-
Padding="16"
61-
HorizontalOptions="End"
62-
IsVisible="False"
63-
Style="{DynamicResource EsriSampleControlPanel}"
64-
VerticalOptions="Start"
65-
WidthRequest="250">
40+
<!-- Instruction text. -->
41+
<BoxView HeightRequest="1" Color="Gray" />
42+
<Label
43+
FontSize="12"
44+
Text="Tap on a building feature to view its attributes."
45+
TextColor="Gray" />
46+
</VerticalStackLayout>
47+
</ScrollView>
6648

67-
<Grid RowDefinitions="Auto,*" RowSpacing="8">
68-
<!-- Header with close button. -->
69-
<Grid Grid.Row="0">
70-
<Label
71-
FontAttributes="Bold"
72-
FontSize="14"
73-
HorizontalOptions="Start"
74-
Text="Feature Attributes"
75-
VerticalOptions="Center" />
76-
<Button
77-
BackgroundColor="Gray"
78-
Clicked="CloseFeatureButton_Clicked"
79-
FontSize="16"
80-
HorizontalOptions="End"
81-
Text=""
82-
TextColor="{AppThemeBinding Light=Black,
83-
Dark=White}" />
84-
</Grid>
49+
<!-- Feature attributes panel, shown when a feature is selected. -->
50+
<Grid
51+
x:Name="FeaturePanel"
52+
IsVisible="False"
53+
RowDefinitions="Auto,*"
54+
RowSpacing="8">
55+
<!-- Header with close button. -->
56+
<Grid Grid.Row="0">
57+
<Label
58+
FontAttributes="Bold"
59+
FontSize="14"
60+
HorizontalOptions="Start"
61+
Text="Feature Attributes"
62+
VerticalOptions="Center" />
63+
<Button
64+
BackgroundColor="Gray"
65+
Clicked="CloseFeatureButton_Clicked"
66+
FontSize="16"
67+
HorizontalOptions="End"
68+
Text=""
69+
TextColor="{AppThemeBinding Light=Black,
70+
Dark=White}" />
71+
</Grid>
8572

86-
<!-- Scrollable list of feature attributes. -->
87-
<ScrollView Grid.Row="1" MaximumHeightRequest="200">
88-
<CollectionView x:Name="FeatureAttributesCollection" ItemsLayout="VerticalList">
73+
<!-- Scrollable list of feature attributes. -->
74+
<CollectionView
75+
x:Name="FeatureAttributesCollection"
76+
Grid.Row="1"
77+
ItemsLayout="VerticalList"
78+
MaximumHeightRequest="400">
8979
<CollectionView.ItemTemplate>
9080
<DataTemplate x:DataType="local:BuildingSceneFeatureAttribute">
9181
<VerticalStackLayout Margin="0,4" Spacing="2">
@@ -106,8 +96,8 @@
10696
</DataTemplate>
10797
</CollectionView.ItemTemplate>
10898
</CollectionView>
109-
</ScrollView>
99+
</Grid>
110100
</Grid>
111101
</Border>
112102
</Grid>
113-
</ContentPage>
103+
</ContentPage>

src/MAUI/Maui.Samples/Samples/UtilityNetwork/CreateLoadReport/CreateLoadReport.xaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<HorizontalStackLayout Spacing="5">
1414
<Picker x:Name="PhasesList"
1515
x:DataType="esri:CodedValue"
16+
IsEnabled="False"
1617
ItemDisplayBinding="{Binding Name}"
1718
WidthRequest="150" />
1819
<Button Clicked="OnAddPhase" Text="Add" />
@@ -30,25 +31,25 @@
3031
HeightRequest="300"
3132
VerticalScrollBarVisibility="Default">
3233
<CollectionView.Header>
33-
<Grid ColumnDefinitions="Auto, Auto, Auto"
34-
ColumnSpacing="25"
35-
HorizontalOptions="Center">
34+
<Grid ColumnDefinitions="*, *, *"
35+
Padding="5,0">
3636
<Label Grid.Column="0"
3737
FontAttributes="Bold"
3838
Text="Phase" />
3939
<Label Grid.Column="1"
4040
FontAttributes="Bold"
41+
HorizontalOptions="Center"
4142
Text="Total Customers" />
4243
<Label Grid.Column="2"
4344
FontAttributes="Bold"
45+
HorizontalOptions="Center"
4446
Text="Total Load" />
4547
</Grid>
4648
</CollectionView.Header>
4749
<CollectionView.ItemTemplate>
4850
<DataTemplate x:DataType="local:PhaseSummary">
49-
<Grid Margin="5"
50-
ColumnDefinitions="100, 50, 175"
51-
HorizontalOptions="Center">
51+
<Grid ColumnDefinitions="*, *, *"
52+
Padding="5,0">
5253
<Label Text="{Binding Phase}" />
5354
<Label Grid.Column="1"
5455
HorizontalOptions="Center"

src/MAUI/Maui.Samples/Samples/UtilityNetwork/CreateLoadReport/CreateLoadReport.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ private async Task Initialize()
120120
if (_phasesNetworkAttribute.Domain is CodedValueDomain codedValueDomain)
121121
{
122122
PhasesList.ItemsSource = codedValueDomain.CodedValues.ToList();
123+
PhasesList.IsEnabled = true;
123124
}
124125
}
125126
}

src/MAUI/Maui.Samples/Samples/UtilityNetwork/SnapGeometryEditsWithUtilityNetworkRules/SnapGeometryEditsWithUtilityNetworkRules.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
Light=White}"
151151
HorizontalOptions="Center"
152152
IsVisible="False"
153-
HeightRequest="250"
153+
MaximumHeightRequest="250"
154154
StrokeShape="RoundRectangle 10"
155155
VerticalOptions="Center"
156156
WidthRequest="300">

0 commit comments

Comments
 (0)