Skip to content

Commit dbef203

Browse files
Merge pull request #2 from NatarajanSF4844/sampleWarning
Sample warning
2 parents 49d1417 + 237aa84 commit dbef203

File tree

11 files changed

+38
-38
lines changed

11 files changed

+38
-38
lines changed

TreeMapLayoutTypeChange/TreeMapLayoutTypeChange/App.xaml.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ public partial class App : Application
55
public App()
66
{
77
InitializeComponent();
8+
}
89

9-
MainPage = new AppShell();
10+
protected override Window CreateWindow(IActivationState? activationState)
11+
{
12+
return new Window(new MainPage());
1013
}
1114
}
1215
}

TreeMapLayoutTypeChange/TreeMapLayoutTypeChange/AppShell.xaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

TreeMapLayoutTypeChange/TreeMapLayoutTypeChange/AppShell.xaml.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

TreeMapLayoutTypeChange/TreeMapLayoutTypeChange/Behaviour/LayoutTypeBehaviour.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,27 @@ protected override void OnDetachingFrom(ContentPage sampleView)
7272
/// <param name="e">The event args.</param>
7373
private void OnComboBoxSelectionChanged(object? sender, Syncfusion.Maui.Inputs.SelectionChangedEventArgs e)
7474
{
75-
if (comboBox.SelectedIndex == 0)
75+
if(treeMap == null)
76+
{
77+
return;
78+
}
79+
80+
if (comboBox?.SelectedIndex == 0)
7681
{
7782
treeMap.LayoutType = LayoutType.Squarified;
7883
}
7984

80-
else if (comboBox.SelectedIndex == 1)
85+
else if (comboBox?.SelectedIndex == 1)
8186
{
8287
treeMap.LayoutType = LayoutType.SliceAndDiceAuto;
8388
}
8489

85-
else if (comboBox.SelectedIndex == 2)
90+
else if (comboBox?.SelectedIndex == 2)
8691
{
8792
treeMap.LayoutType = LayoutType.SliceAndDiceHorizontal;
8893
}
8994

90-
else if (comboBox.SelectedIndex == 3)
95+
else if (comboBox?.SelectedIndex == 3)
9196
{
9297
treeMap.LayoutType = LayoutType.SliceAndDiceVertical;
9398
}

TreeMapLayoutTypeChange/TreeMapLayoutTypeChange/MainPage.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
FontAttributes="Bold" />
2323

2424
<editors:SfComboBox x:Name="comboBox"
25+
x:DataType="local:LayoutTypeViewModel"
2526
Grid.Row="2"
2627
WidthRequest="250"
2728
HeightRequest="50"
@@ -36,6 +37,7 @@
3637
</editors:SfComboBox>
3738

3839
<treemap:SfTreeMap x:Name="treeMap"
40+
x:DataType="local:PopulationViewModel"
3941
Margin="8"
4042
Grid.Row="1"
4143
DataSource="{Binding PopulationDetails}"

TreeMapLayoutTypeChange/TreeMapLayoutTypeChange/Model/LayoutTypes.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ public class LayoutTypes
44
{
55
public LayoutTypes()
66
{
7+
Name = string.Empty;
78
}
89

910
/// <summary>

TreeMapLayoutTypeChange/TreeMapLayoutTypeChange/Model/PopulationDetails.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ public class PopulationDetails
44
{
55
public PopulationDetails()
66
{
7+
Country = string.Empty;
8+
Continent = string.Empty;
79
}
810

911
/// <summary>

TreeMapLayoutTypeChange/TreeMapLayoutTypeChange/TreeMapLayoutTypeChange.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
4+
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
66
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
77
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
88

@@ -59,9 +59,9 @@
5959
<ItemGroup>
6060
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
6161
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
62-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
63-
<PackageReference Include="Syncfusion.Maui.Inputs" Version="25.1.39" />
64-
<PackageReference Include="Syncfusion.Maui.TreeMap" Version="25.1.39" />
62+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="*" />
63+
<PackageReference Include="Syncfusion.Maui.Inputs" Version="*" />
64+
<PackageReference Include="Syncfusion.Maui.TreeMap" Version="*" />
6565
</ItemGroup>
6666

6767
</Project>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<IsFirstTimeProjectOpen>False</IsFirstTimeProjectOpen>
5+
<ActiveDebugFramework>net9.0-windows10.0.19041.0</ActiveDebugFramework>
6+
<ActiveDebugProfile>Windows Machine</ActiveDebugProfile>
7+
<SelectedPlatformGroup>Emulator</SelectedPlatformGroup>
8+
<DefaultDevice>pixel_5_-_api_34</DefaultDevice>
9+
</PropertyGroup>
10+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net9.0-android|AnyCPU'">
11+
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
12+
</PropertyGroup>
13+
</Project>

TreeMapLayoutTypeChange/TreeMapLayoutTypeChange/ViewModel/LayoutTypeViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class LayoutTypeViewModel
1313
public ObservableCollection<LayoutTypes> LayoutType { get; set; }
1414

1515
/// <summary>
16-
/// Initializes a new instance of the <see cref="LayoutTypeViewModel"/> class.
16+
/// Initializes a new instance of the <see cref="LayoutTypes"/> class.
1717
/// </summary>
1818
public LayoutTypeViewModel()
1919
{

0 commit comments

Comments
 (0)