Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BugFix: Not trimmer friendly in .NET 8 #551

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Expand Up @@ -10,7 +10,9 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<!-- Display name -->
<WarningsAsErrors>$(WarningsAsErrors);IL2036;IL2037</WarningsAsErrors>

<!-- Display name -->
prathameshnarkhede marked this conversation as resolved.
Show resolved Hide resolved
<ApplicationTitle>Toolkit.SampleApp.Maui</ApplicationTitle>

<!-- App Identifier -->
Expand Down
2 changes: 1 addition & 1 deletion src/Toolkit/Toolkit.Maui/OverviewMap/OverviewMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class OverviewMap : TemplatedView
private MapView? _overviewMapView;


[DynamicDependency(nameof(Esri.ArcGISRuntime.Mapping.Map.LoadStatus), "Esri.ArcGISRuntime.Mapping.Map", "Esri.ArcGISRuntime")]
[DynamicDependency(nameof(Esri.ArcGISRuntime.Mapping.GeoModel.LoadStatus), "Esri.ArcGISRuntime.Mapping.GeoModel", "Esri.ArcGISRuntime")]
static OverviewMap()
{
DefaultControlTemplate = new ControlTemplate(() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ private static object BuildDefaultTemplate()
}


[DynamicDependency(nameof(AttachmentViewModel.Thumbnail), "Esri.ArcGISRuntime.Toolkit.Maui.Primitives.AttachmentViewModel","Esri.ArcGISRuntime")]
[DynamicDependency(nameof(AttachmentViewModel.Name), "Esri.ArcGISRuntime.Toolkit.Maui.Primitives.AttachmentViewModel", "Esri.ArcGISRuntime")]
[DynamicDependency(nameof(AttachmentViewModel.Size), "Esri.ArcGISRuntime.Toolkit.Maui.Primitives.AttachmentViewModel", "Esri.ArcGISRuntime")]
[DynamicDependency(nameof(AttachmentViewModel.IsDownloadButtonVisible), "Esri.ArcGISRuntime.Toolkit.Maui.Primitives.AttachmentViewModel", "Esri.ArcGISRuntime")]
[DynamicDependency(nameof(AttachmentViewModel.IsDownloading), "Esri.ArcGISRuntime.Toolkit.Maui.Primitives.AttachmentViewModel", "Esri.ArcGISRuntime")]
[DynamicDependency(nameof(AttachmentViewModel.Thumbnail), "Esri.ArcGISRuntime.Toolkit.Maui.Primitives.AttachmentsPopupElementView.AttachmentViewModel", "Esri.ArcGISRuntime.Toolkit.Maui")]
[DynamicDependency(nameof(AttachmentViewModel.Name), "Esri.ArcGISRuntime.Toolkit.Maui.Primitives.AttachmentsPopupElementView.AttachmentViewModel", "Esri.ArcGISRuntime.Toolkit.Maui")]
[DynamicDependency(nameof(AttachmentViewModel.Size), "Esri.ArcGISRuntime.Toolkit.Maui.Primitives.AttachmentsPopupElementView.AttachmentViewModel", "Esri.ArcGISRuntime.Toolkit.Maui")]
[DynamicDependency(nameof(AttachmentViewModel.IsDownloadButtonVisible), "Esri.ArcGISRuntime.Toolkit.Maui.Primitives.AttachmentsPopupElementView.AttachmentViewModel", "Esri.ArcGISRuntime.Toolkit.Maui")]
[DynamicDependency(nameof(AttachmentViewModel.IsDownloading), "Esri.ArcGISRuntime.Toolkit.Maui.Primitives.AttachmentsPopupElementView.AttachmentViewModel", "Esri.ArcGISRuntime.Toolkit.Maui")]
private static object BuildDefaultItemTemplate()
{
Grid layout = new Grid();
Expand All @@ -95,7 +95,7 @@ private static object BuildDefaultItemTemplate()
layout.Add(image);
image.SetBinding(Image.SourceProperty, new Binding(nameof(AttachmentViewModel.Thumbnail)));
Grid.SetRowSpan(image, 2);

Label name = new Label() { VerticalOptions = LayoutOptions.End };
name.SetBinding(Label.TextProperty, nameof(AttachmentViewModel.Name));
Grid.SetColumn(name, 1);
Expand All @@ -113,7 +113,7 @@ private static object BuildDefaultItemTemplate()
Grid.SetColumn(image2, 2);
Grid.SetRowSpan(image2, 2);
layout.Add(image2);

ActivityIndicator indicator = new ActivityIndicator() { WidthRequest = 24, HeightRequest = 24, IsRunning = true };
indicator.SetBinding(ActivityIndicator.IsRunningProperty, new Binding(nameof(AttachmentViewModel.IsDownloading)));
Grid.SetColumn(indicator, 2);
Expand Down Expand Up @@ -210,7 +210,7 @@ public string Size
else
return $"{Math.Round(size / 1024d / 1024d, 1)} MB";
}
}
}

private void Attachment_PropertyChanged(object? sender, PropertyChangedEventArgs e)
{
Expand Down Expand Up @@ -241,9 +241,9 @@ public ImageSource? Thumbnail
return _thumbnail;
}
}

public bool IsDownloadButtonVisible => !Attachment.IsLocal && Attachment.LoadStatus != LoadStatus.Loaded && Attachment.LoadStatus != LoadStatus.Loading;

public bool IsDownloading => !Attachment.IsLocal && Attachment.LoadStatus == LoadStatus.Loading;

private void CreateThumbnail()
Expand Down
Loading