Using WPF .NET APIs in a Windows 8.1 Universal application - c#

As I am really really new to Universal Apps and I am coming from previous experience with WPF and Silverlight I was wondering if there is an approach I could use to take advantage of the .NET 4.5 APIs in an project created as Universal App. I know this might be a stupid question but as the idea of Universal Apps is to be "universal" it bright this thought to my head "Could I create a 'class library' for WPF and use it in an Universal App".
I have been researching this on the web but with no success so decided to test my luck here. Also if anyone could point me to some good resources in getting started with Universal app (for WPF/Silverlight .NET developers) it would be awesome.

You should be using Portable Class Libraries. It will give you the option to select which platforms to target. Keep in mind that the API surface available to Universal Apps are somewhat of a subset of the API surface available to WPF. This is somewhat analogous to how Silverlight was a subset of WPF in the beginning and then branched out somewhat over later versions.

Related

C# Cross platform GUI for desktop and mobile

I have a hobby project that I wrote in C#. Library is for geomatics calculations, it has over 4000 lines of code and I have spent years developing it. Recently I completed GUI using Windows Forms and shared it for free. I got good feedback and now I want to make it cross platform.
Problem is that after days of searching the Internet I found nothing. All links are outdated. I would prefer something like JavaFX, where I could possibly create one GUI for desktop and mobile without much hassle with compiling.
GTK# is stuck (no mobile and no integration for newer versions with Xamarin studio)
QtSharp is in Alpha stage
Eto.Forms for mobile is still under development
Are there any free working alternatives with good tutorials/documentation in late 2016? Or do I have to rewrite my libraries in Java and create GUI in JavaFX?
At the moment there isn't a .Net framework that support all platform. The solution that covers most platform is Xamarin (right now support Android, iOS and MS Universal App). As this post suggest probably in the near future there will a Xamarin version also for Linux systems.
But there is an alternative: duocode. Basically it's a tool that convert c# code into javascript and once is transformed you can use the javascript code to implement a mobile interface using a cross platform framework like cordova. You will have two different application but with the same code base.

Using Universal Windows Platform (Windows 10) controls in WPF

Hopefully a simple question; I seem to recall seeing somebody at one of the recent Microsoft conferences say that some of the UWP application functionality was to be made available within WPF/Desktop. Unfortunately, I can no longer find (or remember) which of the many videos this was from (though it was probably Build or similar on Channel9).
Is it therefore possible to use UWP controls within a WPF application? Basically I want the look and feel of an "app", including some of the new controls (RelativePanel, SplitPanel) and the themed buttons etc., but I need the power of the full desktop - such as access to the full file system.
Thanks.
I think you are referring to the different Bridges to port apps to Windows 10 from for instance, IOS, Android, Web, Win32, etc. and still take advantage of Windows 10 features and APIs. Specifically, I think you are talking about the Bridge to bring in Win32 apps. You can find the bridges listed here.
https://dev.windows.com/en-us/bridges
•"Project Centennial": This toolkit will enable desktop developers to package and publish their existing .NET and Win32-based Windows applications to the Windows Store. Developers can also use Centennial to call common UWP APIs and services."

Building apps for windows tablet.

I am new to wpf. Hence, kindly co-operate with my questions.
I want to build an app that runs on windows tablets. This is not to windows store app, rather, I will be developing this app for some company to visualize the data they have. And they will use this app on tablets or other touch enabled devices.
Background:
App will have some graphs and other visualizing diagrams. And WPF MVVM pattern will be used to develop the app.
My question:
My current system is:
System: HP elite book revolve 810 g2 tablet
.NET Framework: 4.0
Visual studio 2012
Can I develop a tablet app with the above specification?
where can i find coding documents on coding for touch devices in WPF mvvm pattern?
How can I use graph or any other visualization method in wpf. I mean, do I have any library that provides API's for different graphs?
Please help me in answering above.
Thank you
This questions will lead to long answers.. I´ll try to make it short!
The elite book revolve has an I5 and Windows 8 / 8.1. You should not have problems developing Widnows apps with that.
Visual Studio 2012 is fine as well, you might want to download the windows phone toolkit (if you want multiplatform apps).
You will need to use framwork 4.5 to develop Windows 8.1 RT apps though - and this is what you want to do if you want multi device apps. If not then it`s just normal Windows applications that can olny be runn on Windows devices (not Windows phone, or RT tablets)
It seems you are a starter in developing Touch apps.
2.1 Honestly you should consider buying a book before developing. The "Windows 8.1 Apps with XAML and C# Unleashed" one is really good
one - you can even read a good share of the first chapter with example code (see links below)!
2.2 I added a few links to ressources that could help you. Consider looking at MVVM, WPF and Touch coding independently. There are tons of tutorials available!
2.3. Doing touch support is pretty straightforward, it`s just another event handler (touchdown instead of mouseleftbutton down) so all you need is to know how to best handle events in MVVM (link attached below). Another thing is gesture support (see link)
Here is the standard library of xaml controls.. pretty basic but you can do a lot with them: https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh465351.aspx
if you need better /more graphical controls you might consider using Developer Express or similar APIs
heres a list of the graphic tools they provide. Pretty neat: https://www.devexpress.com/products/net/controls/winrt/
Theres also a WinRT XAML Toolkit available: https://winrtxamltoolkit.codeplex.com/ (Tutorial and Graph Preview see below)
Additional Links:
Windows 8.1 Apps with XAML and C# Unleashed (example with code):
http://ptgmedia.pearsoncmg.com/images/9780672337086/samplepages/0672337088.pdf
MVVM General developing: https://joshsmithonwpf.wordpress.com/a-guided-tour-of-wpf/
MVVM in Windows 8: https://msdn.microsoft.com/en-us/magazine/jj651572.aspx?utm_source=rss&utm_medium=rss&utm_campaign=mvvm-using-the-mvvm-pattern-in-windows-8
WinRT XAML Toolkit Tutorial (Windows Store example):
http://eren.ws/2013/10/15/using-graphs-and-charts-in-windows-store-apps-boredom-challenge-day-11/
Best way of event Handling in MVVM (needed for Touch event handling):
What's the best way to pass event to ViewModel?

Windows 8.1 Universal apps documentation

I am trying to develop universal app for first time. This may be a silly question, but is there any comprehensive documentation for c# developing? I need to partially migrate windows 8 app to universal app, but everything I need to use is different there and nowhere I can find what to use instead. It takes hours to find something useful. Mostly here or at other forums. MSDN is not very helpful in this case. I found that universal apps do not use .net framework or silverlight. Is possible to say that universal apps uses clearly labeled standard, for example .net framework 4.5? In this time it seems to me I have to use something from Windows Runtime apps and something from Windows Store apps APIs.
The MS Virtual Academy offers free courses (mostly jumpstarts) for things you might be interested in.
Below is a link to their jumpstart course:
Developing Universal Windows Apps with HTML and JavaScript Jump Start
http://www.microsoftvirtualacademy.com/training-courses/developing-universal-windows-apps-with-html-and-javascript-jump-start
And a link to their jumpstart course:
Programming in C# Jump Start
http://www.microsoftvirtualacademy.com/training-courses/developer-training-with-programming-in-c
Hopefully, this will get you started.
What I was looking for:
Windows universal apps use Windows Runtime.
Only reliable official "MSDN like" page I found is http://msdn.microsoft.com/en-us/library/windows/apps/br211369.aspx
Good tutorials are at Channel 9.

Monogame tutorials /walkthroughs for normal Windows 7 development (not Windows 8, Android or iOS)

Can somebody point me to some good Monogame walkthroughs or tutorials?
The reason I am asking this question is because when I try to create a new project in VS2012, I get the following options
But all the tutorials or walkthroughs (like this one) have the following options and develop using xaml -
Now, I guess this is because I am using Windows 7. So can somebody give me tutorials that are actually targeted to my case.
NOTE: I am trying to develop simple and normal games for Windows 7, nothing fancy like XBox, Windows 8 or Android. Where can I find appropriate getting started walkthroughs for my situation?
There's a few MonoGame tutorials listed on the forums here:
https://monogame.codeplex.com/discussions/439595
And a related post about ideas for new MonoGame tutorials here:
https://monogame.codeplex.com/discussions/439728
As previously mentioned, the MonoGame API is syntactically compatible with XNA so most XNA tutorials will also be helpful.
There is some trickiness around dealing with content, the simplest method in my opinion is to just add it to the Content folder, set it to Content / Copy if newer in the properties window and refer to it with the file extension in code (unless it's an XNB file).
MonoGame is a great project and I highly recommend it if you want to make games for many platforms, something you may want to do sooner or later. However, it still has a few missing features compared to XNA so life may be easier in the short term, while you're learning if you stick with XNA.
Last point, your nearly there anyway, based on your first screenshot I would choose the MonoGame Windows OpenGL Project if you want to target windows 7. Learn how to render your first sprite and you may decide that proceeding with MonoGame is not so bad after all.
Most MonoGame tutorials will deal with Windows 8 or non-windows. This is because MonoGame was created as an alternative to XNA for easy porting from XNA-supported platforms (such as windows 7) to non-XNA supported platforms (such as a Windows Store App).
Note that you can still use XNA in Windows 8, but you'd be creating a desktop app, not a Windows Store App.
A great resource of example is the multi-platform sample project which contains several examples made to work on all platforms
https://github.com/Mono-Game/MonoGame.Samples
The platformer sample is on all platforms and the rest are in progress, but all show a great way to setup your project ready to tackle all the platforms out there!

Categories