I was working with a WPF application and I decided that the controls and graphics I wanted to display on the grid might look better if it was a silverlight component.
I thought this way because of all the cool silverlight controls that look very flash-like.
But now that I have gottem my Visual Studio 2010 set up with SIlverlight, it seems that every silverlight app I can make are ASP.NET in nature. It seems that instead of a cool GUI control to make, Silverlight is telling me that it is primarely a dataflow sort of application for the web.
What is the relationship, if any, between WPF and Silverlight. Can I or can I not put a silverlight control into my existing WPF application?
It's my understanding that Silverlight is like "WPF lite", and that in many ways they are almost the same thing but made for different purposes (desktop vs. web). If you want your wpf application to have a different look, you don't need to bring in any other controls from silverlight, because you can simply re-style or re-template them to suit your needs (which you can also do in silverlight). But you can't simply use silverlight controls in wpf because they're compiled to run on different runtimes.
Silverlight does have a number of un-official controls in the silverlight toolkit which are not included in wpf or the wpf toolkit. They are open source, and if you really want, you could port them to wpf, especially since the code is very similar to wpf.
Silverlight is essentially a subset of WPF that is used to create web-based applications.
You might be able to jump through some hoops to get a limited Silverlight application running in WPF, but I doubt it would be worth it...
I know others may point out that SL is WPF lite.
But hope you find out they are different frameworks at least right now though they share XAML, and a similar model.
Not sure if in the future they become the same, but keep the differences in mind is critical at this moment. :)
We know DevExpress is now shipping the same code base of their components for WPF and SL, but that does come after putting a lot of efforts.
http://community.devexpress.com/blogs/ctodx/archive/2010/04/20/merging-our-silverlight-and-wpf-ui-controls.aspx
Related
I am currently learning WPF framework; I have some past (not much though) experience with Winforms. One problem I've had in both is that the menubar does not look native. I've found a workaround in Winforms, but I haven't been able to find anything for WPF. I've not had this problem in other frameworks I've used, particularly Qt.
In many pics I've seen, it looks native enough in Windows 7, but not Windows 10. I included some pics.
How it currently looks:
How it should look:
Thanks in advance!
Edit
While I have not seen the possible duplicate link, I am aware of setting the foreground/background on WPF controls. That link doesn't really answer my question. I don't want to come up with my own style at this point; all I want to do is make controls look native.
If custom styling is the only way, that's fine, but if there is another way, that would be preferable.
Thanks!
I don't think there's a quick fix to get what you want. WPF renders using DirectX, allowing for much more flexibility in styling applications. A WPF app should render exactly the same way on any version of Windows - it will not automatically adopt a native look and feel (that was actually one of the main selling points of the technology in its early days).
While MS made the default styling somewhat close to Windows at the time of release (Vista, I think?), if you want WPF controls to have a particular look you're going to have to style them yourself.
I've got a simple and clean GUI to do for windows XP embedded, but I'm very new to C#.
Many topics I've found discussing WPF on XPE seem to be dating back to ~2007, so I'm here hoping for current up-to-date information.
Basically, how well supported would WPF be for this task? Are there circumstances which makes this a very bad design path? (what .net version?)
The app will be a kiosk mode gui which will contain some simple buttons, textfields and maybe a drawing canvas element.
It should at least be possible for you to get .Net Framework 3.0 installed on XPe (http://msdn.microsoft.com/en-us/library/bb417255%28WinEmbedded.5%29.aspx). However, depending on the performance you've got available and the kind of UI (if its simple enough), you might opt to choose WinForms instead of WPF.
I am writing my first vb.net application ( But I will tag c# here as well, as I am sure even a c# person can answer this with the similar .net implementation).
Short Description of my Applicaiton:
My desktop application will run on win platform only, using vb.net, it is a simple internet cafe management software, with a server gui running on server, and a client gui running on workstations, both communicating with TCP/IP to allocate time to customers, and the server storing some data in either xml files ( for human operators login info e.g) or in a small database. Nothing complicated.
What I would like to do:
I'd like to have a "sexy" look, i.e. either silverlight look or win7 phone look, yet this is a desktop application. I'd like to use CSS but its entirely optional, if there is a simple way to have my controls look like below without CSS thats fine with me.
What I have tried
I have looked into just doing a silverlight out of browser app, but as I am new to .net, and even though I have read up as many articles about using silverlight5 out of browser, I don't want to be caught down the road when I want to implement a feature and realize "Oh silverlight out of box doesnt support that".
So my question is , how do I implement one of the new looks in the picture in my desktop vb app?
You should look at using WPF for your application instead of using WinForms.
WPF (Windows Presentation Foundations) is a platform which works same way as silverlight but on desktop (as far as you need to be aware now.) Silverlight is a cut down version of WPF so WPF will give you a lot more controls and a lot more control over the program.
WPF uses XAML to draw up the UI and it holds the code in the source code file associated to the xaml file. If you have experience using Silverlight you should easily be able to make programs with WPF.
WPF is really powerful and gives you access to all the styling that is possible on Silverlight. WinForms is more so restricted which makes it harder to abandon the consistent Windows look and make your own intuitive and innovative UI.
Hope it helps!
Here are some tutorials if you are interested:
WPF Tutorials
Here is an example WPF desktop app (exact same look as achievable with Silverlight)
You can use wpf with Mahapps Metro : http://mahapps.com/MahApps.Metro/
Since WPF and Silverlight are very close to each other(in terms of syntax).
My query is , do we have any tool that can convert wpf control to silverlight control and vice versa.
I understand that everything in WPF shall not be expected to run on Silverlight, but since the come from the same code base, is aconversion possible.
In theory you could write a converter that would work in many cases but it would never work in all cases because the two implementations are not completely compatible. That being the case there would likely be so many issues it could not automatically solve at conversion it would be quicker to just port it manually instead. That is probably why there are no converters available. Not to mention that there is little demand for such a tool.
WPF controls are built on top of the full .Net.
Silverlight controls are built on top of a subset of .Net.
If the WPF controls were restricted in their use of .Net then it is feasible that a conversion would be possible, but quite frankly I think there would be too many exceptions to make it worthwhile.
Where we need to share code (not controls) between WPF & Silverlight we "link" to files from a common library (the library is only a repository and not built). The Xaml we can cut & paste.
Is there a learning curve? I want to pick up Windows Form but when reading many threads about WF vs WPF, I was totally persuaded by WPF. What should I do?
Just learn WPF and forget Windows Forms if you don't need it. Windows Forms and WPF are totally different so learning one of them does not really help with the other.
WPF - I learned windows forms first and it is difficult to switch my mind to MVVM mode now when I build UI's. I personally wish that WPF was my first love.
You do not need to know Windows Forms in order to learn WPF. If you are going to code in C# or VB.NET and are running on modern hardware, I would go with WPF.
There are no technical reasons why you'd want to learn Windows Forms before learning WPF. They are completely different technologies.
Unless you need to use Windows Forms to maintain an old application, stick with WPF.
It depends.
I assume you're working on a Windows application that must be installed on a client machine, Windows Forms and WPF would be good choices.
If you're starting an application from scratch, I would recommend WPF so focus on that.
If you have to maintain an existing application already written in Windows Forms, then you better learn Windows Forms.
Maybe it is not bad to first make a few application with Windows Form, that is classic way, and doing this you will not lose nothing because making application with Windows Form you just make classic application with standard UI. After this if you want that you application has better and nicer UI than go with WPF.
My personal opinion is the the learning curve on WPF is a lot steeper if you want to get all the benefits of using MVVM, so it could also depend on how your development team is set up, with how many people and how complex your solutions are. You can of course just use WPF with all code behind, but you might as well use WinForms if this is all you want to do.
Nope!
WPF is the latest trend. Winforms is not quite dead yet though...
If somebody wants to learn window application development. Starting from WPF will take him to the latest trend. Of course, Winform previous experience can be an advantage.