This may be a silly question but I was under the impression that it was possible to use IronRuby and MS Visual Studio 2010 together to sort of build interfaces\edit XAML in one window and code ruby in the other?
Is this only possible to do with C#, Basic and C++ ?
I've browsed SO and seen some IronRuby snippets like this one:
button1.click do |sender, args|
MessageBox.show("Hello World!")
end
So it stands to reason you can create GUIs somehow, but is the visual gui creator not available for ironruby?
In order to build GUIs you should use XAML with WPF. You can create XAML with the editor in Visual Studio. Running a XAML file is possible with:
require "PresentationFramework"
include System::Windows
include System::Windows::Markup
xaml = File.Open('d:/app/window1/xaml', "r").read
#root = System::Windows::Markup::XamlReader.parse(xaml)
app = System::Windows::Application.new
app.run #root
Please refer to IronRuby Unleashed for more information
Related
Visual Studio Community 2015. Xamarin Test Project.
I have a project which have some layouts - Layout.xaml
It shows the designer - it looks like an XML editor of some sort - but what I am looking for is the Visual Xaml Designer - where you see the results of what you do.
If you open any WPF project you will and doulbe click any of its default Xaml files - you will see a nice looking Xaml Visual and Code Editor combined. How can I enable the same within my Xamarin project?
Why Xaml that is in WPF project shows that nice Visual Editor and Xamarin Project does not? Is there a way to bind it?
It has to depend on the project type I assume.
PS: I have a droid project and the iOS and a portable library where I have those XAML files.
If you have any more questions - please ask.
Update
I tried installing Microsoft.Xaml (through Nuget Package manager) - still no luck
Update 2
I create a basic WPF project and look at its references. I matched it identically with my project - but still no luck
Update 3
WPF Project has different properties (which makes sense)
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
And my XAML files have these
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Even though I knew manipulating those would not launch Xaml Visual Designer - still tried that with no luck.
What loads this XAML Visual Designer for the WPF project????
This is the answer - there is a Xamarin.Forms Previewer
Use the View > Other Windows > Xamarin.Forms Previewer menu in Visual Studio to open the preview window. Use the Window > New Vertical Tab Group menu to position it side-by-side.
There is no direct possibility for a preview of your XAML-views, but you can use Gorilla Player(http://gorillaplayer.com/) a software which allows a such function
we are trying to use an activex control from WPF to save a rewrite right now. Found this article , https://msdn.microsoft.com/en-us/library/ms742735(v=vs.100).aspx that refers to the Windows Forms Control Library Template. now I have Visual Studio 2015 Community Edition and there is no such template. Googled and just found pages with no usable content. was wondering if I could be pointed to where this exist or is there an alternative?
The Windows Forms Control Library Template is a litte bit difficult to find. In my Visual Studio 2015 implementation I have it in the directory Visual C#\Windows\Classic Desktop. If you don't have this template, at least for Windows Forms you can also choose template Class Library and later change it in in such a way that you can use the Testcontainer when debugging your class library.
For how to achieve this see the post of Arnshea (6 upvotes) in this link A project with output type of class library cannot be started directly - with a startup exe. I have used his technique when I accidently used the wrong template when starting my projects.
Regards JRB
I'm using WPFLocalizationExtension to localize my WPF application. I'm very happy with the run-time behavior, but extracting string properties manually to ResX files is very tedious.
Is there a way to automate this? I used to have a tool called Xaml Localizer Addin that did exactly this (screenshot below), but it only works with VS2008 and I couldn't find a newer version.
If you're using visual studio 2010, you may want to check out Xaml Localization Tool. It's an extension for vs2010 to localize xaml application, and generate .resx files from xaml.
Another idea is to download XAML Localize Source Code and build your own visual studio add-in or tool that is compatible with your version of .net.
When i added the silverlight dll in the wpf application , i got the following exception.
Could not load file or assembly "System.Core, Version=2.0.5.0". The located assembly's manifest definition does not match the
assembly reference.
This is happening only in VS 2010 professional Beta 2.
You cannot use Silverlight directly in a WPF application, as they do not use the same version of the .NET Framework, thus the error message
Could you give some more details on your scenario ?
If you have a WPF app, you have more than what Silverlight can give to you.
If you are building a solution with multiple products, and one is WPF for the desktop, one is Silverlight for the Web, you need to create 2 different projects in VS.
Take a look at the source tree here:
http://expressionblend.codeplex.com/
Specifically, the Expression.Samples.Interactivity.Design branch.
This shows a few examples of how to put in property editors for use with Blend. I'm not sure if the same concept is transportable to the Cider design surface, but heck, Blend is nicer for pure XAML editing anyways. :)
Almost every example of MVVM I found is coded in C#, are there any examples/tutorials coded in VB.Net? I'm having a hard time translating C# to VB.Net since I haven't really used C# in any meaningful way...
Also, does a MVVM Template/Toolkit for VB.Net exist yet?
You might want to look at the work of Karl Shifflett (program manager on the Cider team at Microsoft). He's one of the main forces in MVVM, and he deals pretty much exclusively in VB.NET, so you'll have plenty of samples to learn from. As an added bonus, he's written a framework called Ocean that should help you get started.
You can find more details on his blog here.
You can download the sample app made by Josh Smith in the MSDN article "WPF Apps With The Model-View-ViewModel Design Pattern" in VB.net form
In general, all code in MSDN mag gets translated to VB.net.
I'm in the process of porting the (MVVM Light Toolkit) C# project templates and code snippets to VB.NET.
I've finished the Silverlight 3 template, now working on the others.
The VB Silverlight 3 template for Visual Studio 2010 is here.
The VB WPF 3.5sp1 template for Visual Studio 2010 is here.
Prism now has samples in VB which you can download here.
This article gives an overview - Prism allows you to develop in either WPF or Silverlight (or do linked projects which provide UIs in both WPF and Silverlight with some code) - the article mentions Silverlight but you can ignore that and still get an overview of Prism/CAG.
On the other hand, there are C# to VB translators out there - have you tried them? I made the switch from VB to C# a while back when I found that all of the sample code for the areas I was interested in were in C#. I'm glad I switched. From your PoV, it probably looks harder to read but once you're into it, it's so much easier because there's so much less excess code to clutter up the screen.