Create a Qt View within Xamarin.iOS - c#

I'm trying to use a Qt-based library within a Xamarin.iOS project. As a first step, I'd like to
initialize a simple Qt View and
place it in an empty ViewController.
I already managed to link the iOS project with QtCore and QtGui. Now I'm struggling with binding Qt's C++ methods with corresponding C# calls.
Has anyone experience with the combination of Xamarin and Qt?
Is this the way to go at all?
(All I can find on the web is about Xamarin vs. Qt...)

Related

Visual Studio Xamarin with C# and XAML: Alternative to WPF-like Data Bindig?

I'm creating a simple App in which some view elements are generated programmatically on runtime. I want some of the properties of these views to be bound to data (text for example), but I do not know how this is done in Android.
I'm familiar with WPF, where this is achieved with Data Binding, but this is not supported in Xamarin (unless I use something 3rd party like MVVMCross, which I'd rather avoid or an approach like THIS). So my qustion is: What is the best way to bind UI elements to data in Android? What is the common practise in, say, Android Studio, and how could I implement it in Xamarin with C#?
I have something like THIS in mind, but this is Android Studio (I guess), so it won't work in Xamarin.
You would need to add your own implementation to do this if you don't want to use a third part library, Microsoft has data binding in wpf because they implemented it, Xamarin is just a wrapper around android, and android doesn't have this functionality as far as I know. It's sort of like how JavaScript doesn't support data binding but angular does, it's a third party thing most of the time. That said, to answer your question better, your options are use third party or implement your own library.

Add Objective C SDK into Xamarin

I'm working in a xamarin.forms app and I really like it! Just a problem, now I'm trying to add a sdk of ad partners called IronSource (SupersonicAds), but I don't know how to, because is code in objective C.
There is any possibility to integrate it in xamarin.forms?
My objective is integrate an Offerwall, if anyone made it would be really helpful to know how to.
Thank you!
You need to create a Xamarin binding library. This will create a C# wrapper around a native iOS Obj-C library.
https://developer.xamarin.com/guides/ios/advanced_topics/binding_objective-c/

Using WPF dll's in UWP app

I'm writing a UWP app, and for some reason I'm unable to reference PresentationFramework.dll. It contains some WPF controls I want to use (specifically, System.Windows.Controls.DataGrid, but they aren't available under Universal Windows >> Extensions in the reference manager. Why is this, and how can I fix it?
TL;DR: You can't use WPF controls in UWP.
WPF and UWP are two totally different APIs with a different .NET framework. While WPF has access to the full .NET Framework, UWP has a much more limited API. If you want to read more on the different platforms and compilers, this msdn blog post is a good entry point.
You are thus unable to add any standard dlls as a reference to an UWP app. If you want to share code between WPF and UWP, you'll have to use a Portable Class Library, in which you target the platforms you need.
And as the XAML namespaces for WPF and UWP are different as well, you won't find many portable controls. So for UWP development you'll need to use UWP controls (equivalent to their WPF counterparts). Bonus tip: if you're looking for 3rd party controls, you can also look for 'winrt' controls as winrt was used for Windows 8/8.1, but it's the same technology.
I know this is an old question. Not even going to research what came out when. There is a DataGrid for UWP as part of the community toolkit:
https://learn.microsoft.com/en-us/windows/communitytoolkit/controls/datagrid
It's really frustrating though, because it doesn't seem to do a few things that the WPF version does, and these are the few things I needed it do do.
Microsoft really needs to come up with a new naming conventions for its 114 different frameworks and platforms. Controls should be named DataGridWpf, DataGridUwp, etc.
It's super hard to search for examples of the UWP DataGrid control and find thousands of examples for the WPF version. Just my two cents. And for the record, it seems like there are about 5 active links to examples on the UWP version. Arrg.
/And for added fun, Telerik and DevExpress have UWP data grid controls, which they also call DataGrids.

Metro style apps with Html and C#

According to this slide
http://media.infragistics.com/community/general/windows8-platform-tools.jpg
Does it mean I have to use XAML view with C# if I want to develop a metro styled application?
Can I use a HTML/JS/CSS - C# combination with event handlers and all? Something like ASP.NET Webforms/MVC . I know it is not the same client server architecture, but since metro styled apps support HTML/JS, I was wondering.
I can use Win-JS. But can I rather write C# than Javascript, and use HTML rather than XAML?(I dont know XAML and I like C#)
All the C# samples I found online use XAML.
Perhaps you can write portions of your program logic in C# and package it as a library and then create a HTML5/JS app that references the C# Library. That way you should only need to use JS for the parts that are directly related to UI functions and C# for the rest.
I will point out that I haven't tried it yet, but Bill in this thread says that he got it to work.
No, you can only use XAML with C#, or HTML+CSS+JS. But XAML is great markup language, so I think you able to use it.
You can create a "WinMD" library in c# (or c++) that can be invoked from JavaScript. There are a ton of limitations that WinMD libraries have over normal .net libraries and the usage model would be would at all like ASP.NET MVC. Frankly, unless you have a lot of business logic in c# already or if you want to reuse a bunch of code in Win8 Metro apps spanning both HTML and XAML, this WinMD thing is more hassle than its worth.
According to MSDN - Dev Center - Metro style apps you can use C#/VB/C++ and XAML and JavaScript and HTML5 to develop a metro styled application (for Windows8/WindowsPhone).

How can I port my Windows Phone game to a Silverlight thing that I can use on a webpage?

I'm confused about how to port my WP7 C# game to the web using Silverlight.
I know that code written in C# using the Windows Phone (add-in? plugin? other?) for Visual Studio makes a Silverlight app. But how can I embed my finished WP7 app in a webpage?
I've seen some things such as ExEn, SilverSprite, and XnaTouch {the page redirects to MonoGame}, but I'm confused if I even need something like this in order to make my game playable on the web. I've got a feeling the capability may even be embedded in Visual Studio. Is it even possible to do this without rewriting all the code?
Shortened version: How can I port my WP7 C# game to the web using Silverlight?
Create a new project in Visual Studio targeting Silverlight beside your WP7 project. Then if your existing code is structured nicely, you should be able to re-use most of your "back-end" code (the views, viewmodels people talk of). The best way to do this for files that are common is to add them as links to the new project, so you don't have to keep them both up to date - if there are small changes between versions you can use conditional compilation to do this.
You'll want to use some completely new classes for some things, such as probably the top level view. Some XAML (eg a UserControl definition) might be usable between both with changes, though some people will favour always creating different versions. Have a look at this extensive article on cross-platform SL/WPF/WP7 development.
What have you tried?
If you create a Silverlight application in Visual Studio, you should be able to include all your existing Views, ViewModels, resources and so on. I don't know if you'll be able to make a single project that both builds into a WP7 and a Silverlight application but I personally wouldn't bother trying.
You can't directly - there are missing runtime components and features that are only available to Windows Phone applications.
You can, however, reuse lots of code, especially C# - all XAML code, I beleive, you'll have to copy/paste from WP7 XAML to Silverlight XAML.

Categories

Resources