Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7567432
Add 3D Basemap Gallery support in WPF and BasemapGalleryItem
prathameshnarkhede Feb 27, 2025
4c14393
Add 3D basemap support to BasemapGallery in UWP, WinUI and MAUI
prathameshnarkhede Feb 27, 2025
bceb6a3
Added condition to check if `GeoModel` is a `Scene` before fetching 3…
prathameshnarkhede Feb 27, 2025
dd83807
Renamed `BasemapGallery3DAppearanceSample` to `BasemapGallerySceneVie…
prathameshnarkhede Feb 27, 2025
88b9296
Consolidated Basemap fetching methods
prathameshnarkhede Feb 27, 2025
d5298a5
Refactor BasemapGalleryItem to dynamically determine Is3D
prathameshnarkhede Feb 27, 2025
ed5edbd
Refactored 3D tag in BasemapGallery to sta on top right corner of the…
prathameshnarkhede Feb 28, 2025
ba14de8
Introduce caching for basemaps in BasemapGalleryController
prathameshnarkhede Mar 1, 2025
9de0da1
Update src/Toolkit/Toolkit.WinUI/Esri.ArcGISRuntime.Toolkit.WinUI.csproj
prathameshnarkhede Mar 4, 2025
dcaed50
Update bindings to use static lambdas for type safety as new feature …
prathameshnarkhede Mar 5, 2025
c194240
Reverted binding style for private set properties
prathameshnarkhede Mar 5, 2025
4358565
Revert Margin in Basemap Gallery Item
prathameshnarkhede Mar 5, 2025
e86f2e3
Fixing bug in BasemapGallery loading
prathameshnarkhede Mar 5, 2025
009dc01
Restore styling for basemapgallery
prathameshnarkhede Mar 5, 2025
94dddb4
Refactor basemap loading to be fully asynchronous
prathameshnarkhede Mar 6, 2025
b884fe3
Refactor basemap loading and update visibility handling
prathameshnarkhede Mar 6, 2025
9ca2ffd
Update BasemapGallery itemTypeBorder to theme-based color
prathameshnarkhede Mar 7, 2025
bffa7aa
Add one-way binding to fix the width sldier in WinUI and UWP and erro…
prathameshnarkhede Mar 10, 2025
0967132
Refactor loading state handling in BasemapGalleryController
prathameshnarkhede Mar 10, 2025
35741ff
Refactor basemap update logic in BasemapGallery
prathameshnarkhede Mar 10, 2025
97dbb3c
Enhance theme management in BasemapGallery
prathameshnarkhede Mar 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="Toolkit.SampleApp.Maui.Samples.BasemapGallerySceneViewAppearanceSample"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:esri="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:Esri.ArcGISRuntime.Toolkit.Maui;assembly=Esri.ArcGISRuntime.Toolkit.Maui"
Title="3D BasemapGallery - appearance"
mc:Ignorable="d">
<ContentPage.Content>
<Grid BackgroundColor="{AppThemeBinding Dark=Black, Light=White}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="200" />
</Grid.RowDefinitions>
<StackLayout Grid.Row="0" Orientation="Horizontal">
<Button Clicked="Button_Add_Item" Text="Add special items" />
<Button Clicked="Button_Remove_Item" Text="Remove last item" />
</StackLayout>

<esri:SceneView x:Name="MySceneView" Grid.Row="1" />

<toolkit:BasemapGallery
x:Name="Gallery"
Grid.Row="2"
GeoModel="{Binding Source={x:Reference MySceneView}, Path=Scene, Mode=OneWay}" />
</Grid>
</ContentPage.Content>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Toolkit.Maui;

namespace Toolkit.SampleApp.Maui.Samples
{
[XamlCompilation(XamlCompilationOptions.Compile)]
[SampleInfo(Category = "BasemapGallery", Description = "Sceneview Basemap Appearance customization sample", ApiKeyRequired = true)]
public partial class BasemapGallerySceneViewAppearanceSample : ContentPage
{
public BasemapGallerySceneViewAppearanceSample()
{
InitializeComponent();
MySceneView.Scene = new Scene(BasemapStyle.ArcGISImagery);
}

private async void Button_Add_Item(object? sender, EventArgs e)
{
if (Gallery.AvailableBasemaps is null) return;
BasemapGalleryItem item = await BasemapGalleryItem.CreateAsync(new Basemap());
item.Name = "With Thumbnail";
item.Tooltip = Guid.NewGuid().ToString();
item.Thumbnail = new Esri.ArcGISRuntime.UI.RuntimeImage(new Uri("https://www.esri.com/content/dam/esrisites/en-us/home/homepage-tile-arcgis-collaboration.jpg"));
Gallery.AvailableBasemaps.Add(item);

BasemapGalleryItem item2 = await BasemapGalleryItem.CreateAsync(new Basemap());
item2.Name = "Without Thumbnail";
Gallery.AvailableBasemaps.Add(item2);
}

private void Button_Remove_Item(object? sender, EventArgs e)
{
if (Gallery.AvailableBasemaps?.Any() == true)
{
Gallery.AvailableBasemaps.RemoveAt(Gallery.AvailableBasemaps.Count - 1);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<Page
x:Class="Esri.ArcGISRuntime.Toolkit.SampleApp.Samples.BasemapGallery.BasemapGallerySceneViewAppearanceSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:esri="using:Esri.ArcGISRuntime.UI.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="using:Esri.ArcGISRuntime.Toolkit.UI.Controls"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">
<Page.Resources>
<Style TargetType="Button">
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
</Page.Resources>
<Grid>
<esri:SceneView x:Name="MySceneView" />

<Border
Width="200"
Margin="8"
Padding="8"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel>
<TextBlock Text="Control Width:" />
<Slider
x:Name="WidthSlider"
Maximum="1000"
Minimum="0"
Value="200" />
<TextBlock Text="Gallery View Style: " />
<ComboBox
x:Name="ViewStyleCombobox"
HorizontalAlignment="Stretch"
SelectionChanged="ViewStyleCombobox_SelectionChanged" />
<Button
Margin="0,4,0,4"
Click="Button_Add_Last"
Content="Add special items" />
<Button Click="Button_Remove_Last" Content="Remove last item" />
</StackPanel>
</Border>

<Border
Margin="8"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Background="White">
<toolkit:BasemapGallery
x:Name="Gallery"
Width="{x:Bind WidthSlider.Value}"
GeoModel="{x:Bind MySceneView.Scene, Mode=OneWay}" />
</Border>
</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Toolkit.UI;
using System;
using System.Linq;

namespace Esri.ArcGISRuntime.Toolkit.SampleApp.Samples.BasemapGallery
{
[SampleInfo(ApiKeyRequired = true)]
public sealed partial class BasemapGallerySceneViewAppearanceSample : Page
{
public BasemapGallerySceneViewAppearanceSample()
{
InitializeComponent();
MySceneView.Scene = new Scene(BasemapStyle.ArcGISImagery);
ViewStyleCombobox.Items.Add("Auto");
ViewStyleCombobox.Items.Add("List");
ViewStyleCombobox.Items.Add("Grid");
ViewStyleCombobox.SelectedIndex = 0;
}

private void ViewStyleCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
switch (ViewStyleCombobox.SelectedIndex)
{
case 0:
Gallery.GalleryViewStyle = BasemapGalleryViewStyle.Automatic;
break;
case 1:
Gallery.GalleryViewStyle = BasemapGalleryViewStyle.List;
break;
case 2:
Gallery.GalleryViewStyle = BasemapGalleryViewStyle.Grid;
break;
}
}

private async void Button_Add_Last(object sender, RoutedEventArgs e)
{
BasemapGalleryItem item = await BasemapGalleryItem.CreateAsync(new Basemap());
item.Name = "With Thumbnail";
item.Tooltip = Guid.NewGuid().ToString();
item.Thumbnail = new ArcGISRuntime.UI.RuntimeImage(new Uri("https://www.esri.com/content/dam/esrisites/en-us/home/homepage-tile-arcgis-collaboration.jpg"));
Gallery.AvailableBasemaps.Add(item);

BasemapGalleryItem item2 = await BasemapGalleryItem.CreateAsync(new Basemap());
item2.Name = "Without Thumbnail";
Gallery.AvailableBasemaps.Add(item2);
}

private void Button_Remove_Last(object sender, RoutedEventArgs e)
{
if (Gallery.AvailableBasemaps.Any())
{
Gallery.AvailableBasemaps.Remove(Gallery.AvailableBasemaps.Last());
}
}
}
}
15 changes: 11 additions & 4 deletions src/Samples/Toolkit.SampleApp.UWP/Toolkit.Samples.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="SampleDatasource.cs" />
<Compile Include="Samples\BasemapGallery\BasemapGallerySceneViewAppearanceSample.xaml.cs">
<DependentUpon>BasemapGallerySceneViewAppearanceSample.xaml</DependentUpon>
</Compile>
<Compile Include="Samples\BasemapGallery\BasemapGalleryAppearanceSample.xaml.cs">
<DependentUpon>BasemapGalleryAppearanceSample.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -218,6 +221,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Samples\BasemapGallery\BasemapGallerySceneViewAppearanceSample.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Samples\BasemapGallery\BasemapGalleryAppearanceSample.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down Expand Up @@ -322,9 +329,9 @@
<Project>{a6431f30-a608-4c78-80be-548c322cbe75}</Project>
<Name>Esri.ArcGISRuntime.Toolkit.UWP</Name>
</ProjectReference>
<PackageReference Include="Esri.ArcGISRuntime.UWP">
<Version>$(ArcGISRuntimePackageVersion)</Version>
</PackageReference>
<PackageReference Include="Esri.ArcGISRuntime.UWP">
<Version>$(ArcGISRuntimePackageVersion)</Version>
</PackageReference>
</ItemGroup>
</When>
<Otherwise>
Expand Down Expand Up @@ -358,4 +365,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<UserControl
x:Class="Esri.ArcGISRuntime.Toolkit.Samples.BasemapGallery.BasemapGallerySceneViewAppearanceSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
xmlns:local="clr-namespace:Esri.ArcGISRuntime.Toolkit.Samples.BasemapGallery"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Grid>
<esri:SceneView x:Name="MySceneView" />
<Border
Width="200"
Margin="8"
Padding="8"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Background="White">
<StackPanel>
<Label Content="Control Width:" />
<Slider
x:Name="WidthSlider"
Maximum="1000"
Minimum="0"
Value="200" />
<Label Content="Gallery View Style: " />
<ComboBox x:Name="ViewStyleCombobox" SelectionChanged="ViewStyleCombobox_SelectionChanged" />
<Button
Margin="0,4,0,4"
Click="Button_Add_Last"
Content="Add special items" />
<Button Click="Button_Remove_Last" Content="Remove last item" />
</StackPanel>
</Border>

<Border
Margin="8"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Background="White">
<esri:BasemapGallery
x:Name="Gallery"
Width="{Binding ElementName=WidthSlider, Path=Value}"
GeoModel="{Binding ElementName=MySceneView, Path=Scene, Mode=OneWay}" />
</Border>
</Grid>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Toolkit.UI;
using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;

namespace Esri.ArcGISRuntime.Toolkit.Samples.BasemapGallery
{
[SampleInfo(Category = "BasemapGallery", DisplayName = "Sceneview BasemapGallery - Appearance", Description = "Sample showing customization options related to appearance for a Sceneview Basemap Gallery", ApiKeyRequired = true)]
public partial class BasemapGallerySceneViewAppearanceSample : UserControl
{
public BasemapGallerySceneViewAppearanceSample()
{
InitializeComponent();
MySceneView.Scene = new Scene(BasemapStyle.ArcGISImagery);
ViewStyleCombobox.Items.Add("Auto");
ViewStyleCombobox.Items.Add("List");
ViewStyleCombobox.Items.Add("Grid");
ViewStyleCombobox.SelectedIndex = 0;
}

private void ViewStyleCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
switch (ViewStyleCombobox.SelectedIndex)
{
case 0:
Gallery.GalleryViewStyle = BasemapGalleryViewStyle.Automatic;
break;
case 1:
Gallery.GalleryViewStyle = BasemapGalleryViewStyle.List;
break;
case 2:
Gallery.GalleryViewStyle = BasemapGalleryViewStyle.Grid;
break;
}
}

private async void Button_Add_Last(object sender, RoutedEventArgs e)
{
BasemapGalleryItem item = await BasemapGalleryItem.CreateAsync(new Basemap());
item.Name = "With Thumbnail";
item.Tooltip = Guid.NewGuid().ToString();
item.Thumbnail = new ArcGISRuntime.UI.RuntimeImage(new Uri("https://www.esri.com/content/dam/esrisites/en-us/home/homepage-tile-arcgis-collaboration.jpg"));
Gallery.AvailableBasemaps.Add(item);

BasemapGalleryItem item2 = await BasemapGalleryItem.CreateAsync(new Basemap());
item2.Name = "Without Thumbnail";
Gallery.AvailableBasemaps.Add(item2);
}

private void Button_Remove_Last(object sender, RoutedEventArgs e)
{
if (Gallery.AvailableBasemaps.Any())
{
Gallery.AvailableBasemaps.Remove(Gallery.AvailableBasemaps.Last());
}
}
}
}
Loading
Loading