Xamarin.Forms embed native controls for WPF - xaml

Following Native Views in XAML I see that it is possible to embed native views in XAML by specifying a value for targetPlatform in an appropriate xmlns attribute value.
In my sample project I have confirmed this works for UWP by using targetPlatform=Windows. This actually works fine.
However I wish to do the same thing for a WPF control and was wondering which targetPlatform value to use. I see from the article that targetPlatform should be set to one of values of the TargetPlatform enumeration. Looking at the documentation for TargetPlatform enumeration I see that it is obsolete and does not have a value for WPF. (I tried to use Other but this does not work.)
I see that Device.RuntimePlatform may be used in code, but not sure if there is a way to use it with the xmlns attribute.
How do I conditionally embed WPF native views in XAML? If this is not possible, what's the best way to do this?

At the moment WPF support is in beta and it is not possible, as you can see it is on TODO list at the moment: https://github.com/mohachouch/forms-wpf-progress/blob/master/Status.md
You can port any view using the custom renderer, but adding and binding properties even for just one control is a huge work.

Related

Avalonia UI Carousel Example

I'm rather new to Avalonia UI / XAML / .NET MVVM in general. While I really like Avalonia so far, it's still in beta and lacks extensive documentation. Hence I sometimes struggle to get specific things working or finding out how I should use them correctly.
Could somebody point me to an example using the Carousel control? Which properties should I set in the xaml, what kind of item list should be behind it etc?
Cheers.
You can find usage example in ControlCatalog project from the main repository:
https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/CarouselPage.xaml
https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/CarouselPage.xaml.cs

Can a HTML/WinJS View use a user control built in XAML/C#?

I am hesitant to develop a Windows Phone app in the HTML/WinJS Universal App space because of the difficulty of building complex user controls. Before I go the XAML/C# route, I would like to find out if it is possible to use a user control built in XAML/C# inside of an HTML/WinJS view?
My initial feeling is that it is not possible due to XAML parsing not being available in the HTML space, but I am not certain that this is the case. Any thoughts?
Also, I am not interested in 3rd party solutions such as Xamerin. I am really trying to see if this is possible from a native approach.
No. The HTML and Xaml UI stacks in the Windows Runtime are separate and cannot be mixed. You can call non-UI C# or native Windows Runtime Components from JavaScript.
You can include HTML in a Xaml WebView, but there is no reverse hosting.
--Rob

How to get started with Infragistics web controls using MVC

I have an existing web project in Visual Studio 2012 and it is MVC4. I have Infragistics installed (all components) on the machine.
Now what I want to achieve is to be able to use the web drop down control via a HTML helper.
After some reading on here I understand there may be a few steps involved in order to be able to use the HTML helper as I wish, such as adding the namespace either to the web.config or the view.
I have tried to manually add references to the libraries but after, when trying to add the namespace to my view, it is not recognised. Assuming that there are DLL dependencies I am not aware of I used the Infragistics "Create ASP.NET Toolbox Tab for CLR 4.0 2013.1" app to hopefully add my controls for me so that a drag drop onto my html page would hopefully add whatever reference is required. The app seems to complete successfully but I don't see any change to what I need. No new items in the toolbox and still I cannot add the namespace to my view.
Can someone please tell me simply as possible how to get started? I cannot believe how difficult I have found this. I don't mind what technique, I just need a technique.
Thanks
Not a complete answer but one reason why I could not use it was because adding a reference is not enough. You need to set CopyLocal=true in order for the HtmlHelpers to pick it up.
Use the jQuery combo box rather than the ASP.NET WebDropDown as the WebDropDown is dependent on the page and ASP.NET web forms which you are not using in ASP.NET MVC. You can either write your own helper or use the one that Infragistics provides.

Using Path Animation in Windows 8 using XAML

I would like to animate a UI control (an Image actually) over a Path provided.
It is looking that it is not possible to do it in Windows 8 using XAML although it was possible with .NET 4.5 as far as I could see from the below reference.
http://msdn.microsoft.com/en-us/library/ms746981.aspx
My question is whether there is a work around that I can use to achieve my goal or get closer to it.
WinRT is very similar to Silverlight, so many Silverlight solutions can work in WinRT with minimal or no changes. This sample on CodeProject should give you DoubleAnimationUsingPath with little work.
http://www.codeproject.com/Articles/30819/Animation-Along-a-Path-for-Silverlight

Metro XAML Apps - DependencyProperty.AddOwner

Im writing some custom controls in Metro XAML, and I noticed the DependencyProperty no longer has the AddOwner method. Does anyone know if there is a new way of doing this in Metro ?
Add owner API has been removed from Silverlight and metro XAML as well. There is no equivalent API for this any more.
You should be able to yield similar ability by defining a new dependency property, and data binding them. But I know it cannot fully replace add owner. If you post your underlying motivation for add owner, we might be able to help.