Migrate xamarin xaml page with map to MAUI razor page - dictionary

I want to migrate my xamarin application to the new MAUI project template.
In Xamarin, I have a page view (xaml) with a map control bound to the viewmodel Map property
<ContentView HeightRequest="650" Content="{Binding Map}"/>
Now in MAUI, using BlazorWebView, I am trying to create a new razor page but I do not know how to bind the MAUI Map control to the razor page.
I would appreciate any help.
Thank you in advance.
I want to bind the Map property of type Microsoft.Maui.Maps.Map to the Map.razor page

I want to bind the Map property of type Microsoft.Maui.Maps.Map to the Map.razor page.
In other words, what you mean is to use native MAUI control in Blazor. You can refer to this: How to use Native MAUI Control in .razor pages, Allow Native MAUI Controls to be placed and used from .razor pages in Blazor Hybrid App. It is controversial. The direction provided by one of them is an experimental release.
You can try to use Map directly in Blazor, or use Map in MAUI.

Related

Creating UI elements in Xamarin.Forms

I am not in Xamarin.Forms. In windows desktop apps (win forms and wpf), you can create a user UI component and you can use it in any project. Is it possible to create that kind of small UI elments in Xamarin.Forms?
I will have like a dll and will add to my project and will add to my form and I will give properties that I'll already defined in the UI element.
So, in Xamarin Forms world, we typically create User Controls through use of ContentView.
This can be done with a XAML part and code behind, but you can easily create them just in code too.
There are a series of tutorials available on the web, one that is very clear is this one https://mindofai.github.io/Creating-Custom-Controls-with-Bindable-Properties-in-Xamarin.Forms/
If needed, you can create a separate Xamarin Forms project that encapsulates your controls and reference that in your main app solution.

Example of TypedBinding in Xamarin Forms

I search a lot of page from google that I haven't found any about typedbinding example. Actually I can found this attribute in Xaml {Binding TypedBinding=}. Any body can tell me how it work and give me example.
TypedBinding in Xamarin Forms is for internal framework use only, and not meant to be used directly in Xamarin Forms applications. I suggest you just use Binding, and one of the following options on the Binding (if needed):
Mode
Converter
ConverterParameter
StringFormat
Source

ASP.net MVC fire controller event when view load

I'm using ASP.net MVC and angular js to create a web. I used angular ng-route to render a View when click a link. The moment when render the View, i want fire the Controller event in order to bind the data and display it. (Similar with ASP.net web form, when page load then can call the data binding function).
I'm new in MVC, hope can get some help. Thank you.
As you are using MVC, it would be better if you use the return View(); statement on a Controller, and it would render the view that you want.
Here's a sample:
http://www.codeproject.com/Articles/806029/Getting-started-with-AngularJS-and-ASP-NET-MVC-Par

extend the web controls in c#

I am developing the menu webpart using the asp.net Menu control in user control page for sharepoint 2010. I want to make available properties and methods of menu to developer (API). SO i need to either override all the menu control members in custom class which extends Menu. but it is not abstract control right? so how i can do this? How i can make available to developers to extend the menu control ? is i need to write extension methods for menu control ? please guide. I am using VS 2010 with 3.5 framework.
a simple google search emits this

MVC Custom Control?

I am trying to figure out how to use/create a custom control in ASP.NET MVC 2.
I created a custom control earlier and compiled it (ccontrol.dll), the control renders a div, textbox and a button + some javascript in order to post a comment on the website. It could be a static aspx page that i wanted to allow my visitors to add a comment to. I would then drag my control from the toolbar to the aspx page and run it, it would then render all the code needed on the webpage including fetching the data from a datasource and displaying that inside the div. The user could also just type in a comment and press the button to save it to the datasource.
Is this possible to convert to MVC 2? Any good tutorial that covers custom controls and MVC 2? (Ideally would be if the control could be made into a .dll file that i then could reuse on future webpages)
How do i write a custom control the mvc way? Any good tutorials on the topic?
You cannot design Custom Controls according the normal asp.net style because in Mvc there is no ViewState and there are no server side control events. Data are returned back to the server through a Model Binding process. The fact that rendering and filling data in are handled in separated pieces of code make difficult to implement complex server controls in Mvc.
However, I developed a theory, and also a toolset to make quite easily custom controls ina Mvc too in the full spirit of the Mvc paradigm i.e keeping separation of concerns between Views and Controllers. See My Codeplex project. There, you will find pointers to documentation and tutorials on my blog. If you need assistance feel free to contact me.
No it is not possible to use custom controls in ASP.NET MVC. you need to re-write in MVC way

Resources