In .Net WPF, there is a method called FindResource() for getting binded source with its key. So I need it while developing my application in .Net MAUI. Unfortunately, there is no method called FindResource or anything like it. I searched about my problem but couldn’t find any answer. I actually found a post about this problem on stackoverflow but I couldn’t find my answer there.
Here is my code:
private void OnMapTapped(object sender, TappedEventArgs e)
{
var viewModel = FindResource("MapViewModel") as MapViewModel;
Point? p = e.GetPosition(MainMapView);
Point pT = p.Value;
MapPoint mp = MainMapView.ScreenToLocation(pT);
viewModel.createPoint(mp);
}
I’m currently trying to use ArcGIS maps in my application, and in this code I’m trying to put a marker on the tapped point. However, because the FindResource method is not avalible, I can’t do it. I’m following ArcGIS tutorials and MVVM pattern is used there.
This is my first time posting a question on stackoverflow, so I apologize if I did something wrong.
user25472259 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.