Can I write a Xamarin.Forms app in F#?
I do not see a project template for this in VS2015.
There may not be a template, but you can use Xamarin.Forms in F#. Charles Petzold wrote a blog post on it that you might find useful:
http://www.charlespetzold.com/blog/2015/10/Writing-Xamarin-Forms-Apps-in-FSharp.html
I see this F# Xamarin project:
Related
I am trying to figure out how to use CameraX (https://developer.android.com/training/camerax) with Xamarin.Android, C# & Visual Studio. I have found lots of stuff for using CameraX in non-Xamarin apps, but almost nothing for Xamarin.Android, and the small amount that I have found related to Xamarin was designed for Xamarin.Forms rather than Xamarin.Android. I have not found any good Xamarin.Android tutorials for Camera2 (https://developer.android.com/training/camera2), which CameraX is based on. Can anybody recommend any good sites, tutorials or examples for using CameraX in a Xamarin.Android app?
For Camera2, check XZing (https://github.com/Redth/ZXing.Net.Maui)
For CameraX, the C# binding library does not seem to exist. You can create your own though.
Official binding lib for Camera2:
https://github.com/xamarin/AndroidX/tree/main/source/androidx.camera
Binding lib doc:
https://learn.microsoft.com/en-us/xamarin/android/platform/binding-java-library/
I have asked a related question here, and the answers I got was not to my satisfactory. Today, I ran into this tutorial and thought it may be able to help my situation.
I copy/pasted the example code to Visual Studio, and found that
Microsoft.FSharp.Quotations.Typed and
Microsoft.FSharp.Quotations.Raw
modules no longer existed.
Is there any replacement in F# 3?
Thanks a lot.
That tutorial was written in 2008, so it precedes even F# 2.0 (which shipped in April 2010 as part of VS2010).
For F# 2.0 and 3.0, you only need to open one namespace (MSDN):
open Microsoft.FSharp.Quotations
The Code Quotations (F#) article on MSDN has more information and code examples.
In the Build 2011 keynote and demos, they were always talking about C++, C#, Visual Basic and JavaScript. Can't I build Metro style Apps with F#? Or is it safe to say that if it works with C#, then it works with F# as well?
Or is it eligible to say if it works with C# then it works with F# as well?
Yes, that's how it is supposed to work. In addition to javascript and C/C++, any CLS compliant language that runs on top of the CLR will have access to the WinRT API.
Unfortunately in the VS 2011 Express edition you don't get tooling support but I guess this will be added progressively or to other editions:
Don talks about this a little around 7:40 into his talk.
http://channel9.msdn.com/Events/BUILD/BUILD2011/SAC-904T
I had the same question and created a blog post: Create a Metro App in F# (NOT)
There are a few issues:
You cannot reference ordinary .NET dll’s (even in C#). They have to
be have recompiled with a “reference” to the WinRT. Because of this
you cannot reference the F# dll. I think this will be solved when F#
3.0 get released (source: Understanding F# slide from Don Syme at
build).
The ability from F# to create Metro apps. This has to be
built by the F# team. This is an open question. This is the all-F#
approach (In WPF it is today possible but not recommended).
Tool support for creation Metro front-end projects. This will be not the case for the
F# 3.0 release. (source: Understanding F# slide from Don Syme at
build).
Using Visual Studio 11 Developer Preview (Full, not Express), I was able to reference and run F# code from a C# Metro style application with the following caveats:
You will get a build warning saying that the project can't be referenced, even though Visual Studio will still allow you to add it.
You must remove all references to all DLL's in the F# project, including FSharp.Core.
By following these steps it is possible to run F# code from a C# Metro style application, but it is nearly impossible to write any useful code in F# without references to the core language libraries. Let's hope they update the libraries to be WinRT compatible soon.
The question has been answered here:
Windows 8 and F#
Although you cannot create and design Metro apps directly in F#, you can still create so called Portable library in F# with all Models and ViewModels and use it in another Metro projects. It's not ideal, but it works.
I ported my stock chart library for .NET3.5-4.0 to Portable library,it works quite well on Metro with C# Metro application and some my Metro UI bridge.
I'm convinced that I can use F# to make Metro application in many parts.
I'm looking for the best way to localize a Prism 2 WPF app that might have several modules ported to Silverlight 3. Has anyone successfully localized a Prism 2 WPF app with several modules?
I'm solved the same problem by having a static LocalizationManager that is reachable from XAML by a custom markupextension, and that works very well.
Take a look at http://www.wpftutorial.net/LocalizeMarkupExtension.html for an example!
Yes. You have a lot of options and the gamut of them can be found in this excellent article on CodePlex:
http://wpflocalization.codeplex.com/
There is very little that is specific to Prism regarding localization.
Are there any good text editors for F#?
Instead of firing up resource-intensive Visual Studio, I would like to know if there are any text editors that can pretty-format F# code.
I am just getting started with F# and learning through FSI.exe with Notepad is giving me so much trouble...
Check this out:
F# Without Visual Studio
Not to be too much of a tease, but looking ahead, VS2010 uses a new rehostable editor component, you can hear some about it here: Hanselminutes Podcast 147 - The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev
Anyway, this means that the F# editing experience in VS can, in theory, be completely decoupled from VS and hosted in a lightweight editor. Which means it's possible F# could ship a sample or something that's 'the VS editing experience' (tooltips, squiggles, intellisense, ...) without VS.
To be clear, we on the F# team don't yet have any concrete plans to ship such a thing, but the new internal factoring of VS and the editor and MEF and whatnot should make this easy to do (we've prototyped it over a weekend, and it mostly works). So hopefully look forward to cool things in the future.
Two other options:
SharpDevelop with F# plugin from Robert Pickering.
Visual Studio 2008 Shell with F# CTP
Any editor which will handle OCaml should handle F# -okay-. Mostly you just needs tabs. I'd recommend KomodoEdit, personally.
For notepad ++ someone made a file and put it up on the wiki:
http://notepad-plus.sourceforge.net/commun/userDefinedLang/userDefineLang_Fsharp.xml
One other option:
xacc.ide, a small ide that supports a bunch of .NET languages. But frankly, I haven't use it for a while since I'm really happy with Visual Studio 2008 (IntelliSense, interactive syntax checking, fsi, etc...).
You can setup Sublime Text 2 to work with F# as described here http://blog.kulman.sk/using-sublime-text-2-as-f-repl/
You can use Ionide package to integrate with Visual Studio Code (VS Code) or Atom editors.
Here is an article "F# Support in Visual Studio Code with Ionide"