I'm trying to add those big buttons to my project.
How are they called? Are they even part of .NET Framework?
I haven't been able to find much, but I was able to find a guide on how to make a Windows Aero Style Wizard Control which suggests that this style isn't easily accessible in .NET. I think you should check it out and see if there is anything you'd want to use.
As (as far as I know) there are no resources built into the .NET Framework for creating Windows Aero style forms easily, the aim of this project was to provide access to a (or some) classes that the user can use to create themed forms easily.
Related
At a broader level, I'm converting a MFC application (MFC 6.0) into Windows Forms application (Visual Studio 2013). I read certain blogs that describes that this conversion is possible. By this conversion I can re-use code written in MFC, only I will need to create UI. However I will need to understand the previous code and may need to re-write it a bit.
I got the motivation from here and here.
I have performed following steps so far.
Opened Visual C++ 6.0 project in Visual Studio 2013.
Build it successfully.
Then added CLR support to it, and fixed errors.
Added a Windows form, and added controls to it. As mentioned here.
Added functionality and build it successfully.
Now when I run this application, then it still point to old MFC window.
I'm missing certain settings which will change the rendering window from MFC to WindowsForm. What am I missing here?
Addition to that, I see problem with this approach as described by #Roger in comments, and I understand that. So, I wanted to know for any tool/utility which may convert legacy code into C#. Does such utility available?
TIA.
The code you are referring to seems suitable for amending a MFC application with a few forms as child windows to make use of .NET features. However, the main window is another story. You wrote the application is huge, so I suppose you don't want a simple form as your main window and rather have some kind of MDI interface in mind. If you replace the CMainFrame in the legacy MFC application, it just doesn't make sense to maintain an old CWinApp class. Anyway, if you are hell-bent on going down that path, you may want to have a look at an old CodeProject articel (.NET1.x, .NET2.x) to get a better grasp at the whole concept.
But as Roger already suggested, it would be a wise choice to find a nice GUI framework, perhaps even WPF instead of WindowsForms, and do a GUI rewrite -- especially if one part of the motivation for the conversion is to move to newer UI concepts. If your C++ program logic is well separated in your MFC project, put it in a COM server and make use of interoperability.
This might be a very stupid question but from what i understand quite a substantial amount of SILVERLIGHT is a subset of WPF. I've also made a side to side comparison of the references in a new SILVERLIGHT application and WPF application. Judging by the names, many can be applied to the other.
But there's a particular reference I'm looking for to place in my 'PF app that's not present in the list of available references but is there in the SILVERLIGHT NAVIGATION APPLICATION' references.
System.Windows.Controls.Navigation
This should allow me to (In theory anyways) change a source page on the main window by button click which is (from what I've researched) only available by default in a SILVERLIGHT NAVIGATION APPLICATION'. e.g click button 1; MainWindow shows page A. Click button 2; MainWindow shows Page B.
So my question is it it possible to add this reference to WPF like so many others seem to be? Or am I misleading myself by assuming that just because they're named the same they're the same thing? Knowledge much appreciated.
Silverlight uses a different CLR than WPF. The CLR used by Silverlight is much smaller and lacks many features that WPF enjoy. Occasionally it also has some features that the main .net framework does not have.
Due to this difference any DLL cannot be directly interchangeable between Silverlight and WPF unless they are created as so. By default the following libraries are interchangeable ...
Mscorlib
System
System.Core
System.ComponentModel.Composition
Microsoft.VisualBasic
In your case it might not be possible to reference that dll from WPF
More information
As Tanmoy says, the actual assemblies to reference even for features common to both WPF and Silverlight may differ.
That being said it is my understanding that WPF and Silverlight share many of the navigation concepts and you can even write a WPF browser application that would behave and look like a Silverlight application in a similar way.
The entry point for reading on this subject for WPF is here.
I have developed a user control in WPF which draws some graphs.
Now i have to show this user control in a Silverlight application (to show on ASP.net webpage).
Is this possible to use a WPF user control in a Silverlight application?
I have searched on Google, but have not found a satisfactory answer.
No, it is not possible to show a WPF control in Silverlight. They use two different runtimes so are not directly substitutable with each other.
You have a few options though:
use XBAP to show WPF within the browser
rewrite your control so that you can compile a version for Silverlight or WPF (this is (was) quite a common way to do it)
Edit:
in response to your comment you seem to have some misunderstandings, I think you haven't understood the links I gave you. You may also have misunderstood what Silverlight is - just in case you have let me mention that Silverlight runs as a plugin within the web page, it isn't directly part of the HTML structure.
For the XBAP approach the WPF control/page is hosted inside a web page - just like a Silverlight control is. However you don't have direct access to the local filesystem or network filesystem (or databases running on the network) - Silverlight is the same, to access a database you really need to go via a WCF service.
With the second approach you have two versions (one for WPF, one for Silverlight) of your control and you use compile time targeting to dictate which control is built. You then use the appropriate control in the appropriate project.
I created another WPF project in my asp.net project solution and now want to use my WPF controls in my web application. Is it possible to use wpf control in my web projects?? I figure out on internet some says like you have to use Silverlight for web applicaitons. As far I know silverlight is subpart of WPF, so why not i can use WPF??. I have to use WPF controls because already did enough efforts to build wpf controls and now wanna to use in Web application.
Yes, you can embed WPF controls in a webpage, but you'll need the relevant plug-in enabled (much like Silverlight).
As an example the Xceed Datagrid for WPF is viewable within Internet Explorer.
Although XAML applications are disabled by default, you'll need to enable them in your Internet Explorer security settings.
As for Firefox, you'll need both the .Net Framework Assistant, and WPF Plugin as suggested by MSDN.
WPF is a really great framework, and enabling WPF/XAML based applications for intranet usage would be fine (you could inherit the security permissions through group policy), or for a set audience who don't mind the extra configuration.
The only way you can achieve that is by using Silverlight components not WPF. As you said silverlight is a subset of WFP, so not all WPF features are supported but the silverlight runner. For the most part, the visuals are fully compatible, that is user controls, so if you did not use anything that is specific to WPF then you should be grand.
maybe check here:
WPF vs Silverlight
BTW can you post your xaml, so that we get an idea?
Marco
I believe you can use the XML WPF Browser application to do this, but I'd probably not recommend it, as I think your users will have to download client-side components in order for it to run. The following link gives more info.
http://msdn.microsoft.com/en-us/library/aa970060.aspx
No you cannot use WPF in a web page. WPF is for Windows Applications and will only run on Windows machines. The internet is device agnostic and will run on Windows, Linux, Android, iOS etc. Therefore you need to use ASP .NET (or similar) for web applications and WPF for Windows.
Silverlight is a sub-set of WPF and will work on a web page... BUT not all devices support it (i.e. iOS). So if you really want to be system agnostic and true to the spirit of the web use HTML / CSS and JavaScript.
Whatever it is possible or not, the using of WPF controls embedded in a html page is just horrible.
A classic WPF control might be running (after changed browser settings), but there are many security concerns. Furthermore you have to show your users a to do list before anyone could see the real page.
Silverlight as a subset of WPF, but it is also a plugin that is not available for all platforms such as, for instance, iOS.
I recommend to use HTML 5, which is a per se standard and viewable on all other platforms. It causes more effort, but is is definitely worth it.
Although there are ways to do this (already mentioned by other users on this page), relying on your visitors to have this configured or plugins installed in their browsers means it's very risky to implement this (assuming your target is the WWW and not just local users).
I would consider building a web application UI and just reference everything via class libaries (if using N Tier design)
I'd like to get ahead of the pack and start making some custom C# controls and components for Metro (Win8), but I can't find any documentation or blog posts on how to start, or even if it's possible right now.
Are metro controls just WPF controls? I'm not yet a WPF developer; creating a custom user control looks straightforward, but that project type doesn't exist in the Windows 8 developer preview. So, are WPF custom user controls (VS2010) the project type I should use for creating my Metro controls? Beyond that, I can't find any documentation on how to create a component for use in WPF/Metro; can you create one, or would it just be a custom user control that isn't visible? (I was hoping for some type of component container like the one winforms use; are components for Metro now only class libraries, and don't include designer support anymore?)
It's ... very difficult right now. There's no way to override OnRender or the like for a control, ie to create code to render a control with a custom appearance. However, you can create a custom template. Anything you can do in the template is legal, and that's how you have to approach custom controls.
One other option is to generate your UI using either raster (Bitmap) or vector (Windows.UI.Xaml.Shape?) components directly and build up your UI like that. Bleh.
Win8 Metro is a lot like WPF, but it isn't a subset. Similar but very different. Many WPF controls didn't make the transition to Win8 Metro; the same level of rendering control isn't available; and some system features (like advanced font rendering) aren't there. All this might change in coming releases, but right now it looks like Microsoft is trying to restrain developers from creating custom UI controls.