Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Namespaces Binding Error 1 and 5 when using MapControl wrapper #352

Open
11 tasks
Katastroowl opened this issue Oct 27, 2022 · 10 comments
Open
11 tasks

Namespaces Binding Error 1 and 5 when using MapControl wrapper #352

Katastroowl opened this issue Oct 27, 2022 · 10 comments
Labels
bug 🐛 Something isn't working

Comments

@Katastroowl
Copy link

Katastroowl commented Oct 27, 2022

Describe the bug

I believe that https://github.com/CommunityToolkit/Microsoft.Toolkit.Win32/blob/master/Microsoft.Toolkit.Wpf.UI.Controls/MapControl/MapControl.cs has wrong namespaces and that might be the reason why binding doesn't work??:
Example: Bind(nameof(Style), StyleProperty, windows.UI.Xaml.Controls.Maps.MapControl.StyleProperty);

The "w" from windows.UI... should be "W" capital.

I don't know if that has anything to do with the primal issue, but further I cannot trace it...

Toolkit version: 6.1.2

Steps to Reproduce

There are no steps to reproduce. Except of maybe: #205

Expected behavior

That this does not show up:
System.Windows.Data Error: 1 : Cannot create default converter to perform 'one-way' conversions between types 'Windows.UI.Xaml.Controls.Maps.MapStyle' and 'Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.MapStyle'. Consider using Converter property of Binding. BindingExpression:Path=Style; DataItem='MapControl' (HashCode=53182860); target element is 'MapControl' (Name=''); target property is 'Style' (type 'MapStyle')
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='Road' BindingExpression:Path=Style; DataItem='MapControl' (HashCode=53182860); target element is 'MapControl' (Name=''); target property is 'Style' (type 'MapStyle')

And that the MapControl actually changes its Style, because it doesn't.

Screenshots

Screenshot in Issue 205.

Environment

NuGet Package(s):

Package Version(s):

Project .NET Version:

  • [x ] .NET Framework (version: 4.8.2 )
  • .NET Core 3
  • .NET Core 3.1 Preview (version: )

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • [x ] Build (build number: 19043.2130)

Device form factor:

  • [x ] Desktop
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • 2017 (version: )
  • [x ] 2019 (version: 16.11.19 Pro)
  • 2019 Preview (version: )

Additional context

I tried to access Inner object via reflection, but also that did not change the Map Style, thou, it was shown for a Microsecond, but immediatelly turned to normal again.
Code here:

MapControl ActualMap = new MapControl();
ActualMap.Loaded += ActualMapLoaded;
ActualMap.MapServiceToken = MapToken;
ActualMap.Style = MapStyle.Aerial;
PropertyInfo propertyInfo = ActualMap.GetUwpInternalObject().GetType().GetProperty(nameof(ActualMap.Style), BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly);
if (propertyInfo != null)
{
Debug.WriteLine("PROPERTY FOUND: " + propertyInfo.Name);
propertyInfo.SetValue(ActualMap.GetUwpInternalObject(), Convert.ChangeType(Windows.UI.Xaml.Controls.Maps.MapStyle.Aerial, propertyInfo.PropertyType), null);
}
Debug.WriteLine("MAPSTYLE: " + ActualMap.Style.ToString());
Debug.WriteLine("INTERNAL OBJECT: " + ActualMap.GetUwpInternalObject());
//= Windows.UI.Xaml.Controls.Maps.MapControl
Debug.WriteLine("MAPSTYLE of INTERNAL: " + ((Windows.UI.Xaml.Controls.Maps.MapControl)ActualMap.GetUwpInternalObject()).Style.ToString());
Debug.WriteLine("LAYERS: " + ActualMap.Layers.Count());
MapGrid.Children.Add(ActualMap);

You can see on the results, that both objects/ properties accept the new value, but the Map still not show with changes.

@Katastroowl Katastroowl added the bug 🐛 Something isn't working label Oct 27, 2022
@ghost ghost added the needs triage 🔍 label Oct 27, 2022
@ghost
Copy link

ghost commented Oct 27, 2022

Hello Katastroowl, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

@ghost ghost added the needs attention 👋 label Nov 11, 2022
@ghost
Copy link

ghost commented Nov 11, 2022

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

8 similar comments
@ghost
Copy link

ghost commented Nov 26, 2022

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

@ghost
Copy link

ghost commented Dec 12, 2022

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

@ghost
Copy link

ghost commented Dec 27, 2022

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

@ghost
Copy link

ghost commented Jan 11, 2023

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

@ghost
Copy link

ghost commented Jan 26, 2023

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

@ghost
Copy link

ghost commented Feb 10, 2023

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

@ghost
Copy link

ghost commented Feb 25, 2023

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

@ghost
Copy link

ghost commented Mar 12, 2023

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants