WPF without Visual Studio?

Would it be wise to create WPF applications without affecting Visual Studio (or any other IDEs)? Like in, encoding and compiling completely inside Vim and command line? What resources would you recommend for someone trying to do this?

+7
wpf
source share
6 answers

This would be possible , since WPF is mainly based on XAML - a variant of XML - and C # or VB.NET or another .NET language as its internal language.

The question really is whether it is practical and whether it makes sense - I strongly doubt it. WPF is all about visual design, for example, completely without a visual designer (built into Visual Studio, preferably version 2010; or some other visual designer) it seems a little silly to want to program WPF ....

As for resources - well, at least a text editor is a must, and then, of course, some good books on WPF, and you can use the C # compiler or VB.NET that comes with the .NET Framework.

+9
source share

I found that I wrote XAML several times in Notepad, where I needed to create a quick user interface, but could not load the IDE. It's really pretty trivial and almost - but not quite - as fast as using an IDE. Key benefits of an IDE, such as Blend or VS.NET, quickly get things in order like colors and animations.

Another case where I often write XAML or C # in a text editor is here in Stack Overflow. I only start Visual Studio when I need to check something.

My main recommendations for building WPF applications without an IDE:

First, you must use the WPF layout system correctly, using, if possible, appropriate panels and Auto. For example, if you need a stack of buttons with some space between them, create a <StackPanel> , and on each button add Margin="4" or something else. This is a good design. Most novice WPF programmers see this as WinForms without the ability to build, which is a shame. WPF has a very powerful linking mechanism and should be used. If so, there will never be need for graphic paper or measurements. In addition, your user interface will automatically adjust its layout if you change the font size or objects more than expected.

Secondly, you should use msbuild for your project if it is not ultra-simple. msbuild is installed with the .NET Framework, so it is always available. The file format is very easy to edit using a text editor, and it is much better than a batch file with the corresponding "csc" command, because it allows you to use code and is less prone to errors when adding new source files.

Third, save the PowerShell command prompt window, open separately from your editor, with a command that launches "msbuild" and then runs your application. To start the application, just press Alt-Tab in this window and press up, Enter. Some text editors have the ability to execute user commands directly from the editor and see the output, in which case this second window is not required.

Fourth, save a copy of the cordbg or mdbg file. Although the IDE is the perfect place for your debugging, any debugger is better than no one. You will find your problems much faster if you stop at breakpoints and examine variables than if you continued to edit the code and run it again.

Fifth, use β€œColorPad” or a similar application to select the colors to use. Just guessing and entering your best guess in hex is simply not very good.

For resources, I recommend you get the WPF Unleashed book and work with examples. I would also read many other XAML people, for example, which can be found in CodePlex.

+8
source share

Probably yes. Practical number.

For production work, I would consider Microsoft Expression Blend 3. Then copy the XAML and paste it into the editor of your choice and compile from the command line.

You can download KAXAML . This is a free, lightweight editor. I was good at learning about XAML and seeing how minor changes and tweaks could affect the overall design.

XAML is plain old text, so find a free editor (KAXAML), use it and, if necessary, paste it into your editor.

+5
source share

If you really want to go down this route, I would recommend getting some kind of graphic (square) paper and a sharp pencil.

Draw your projects on this, read the positions and enter them into your editor.

One of the advantages of this is that you will have a prototype paper to show people;)

As James Kesey points out in his comment on marc_s answer, your edit-compile cycle will be painful.

+3
source share

It is definitely possible. I would say that this is not practical.

Honestly, I am engaged in the professional development of WPF, and I am doing this with a closed visual designer. I’m much more comfortable editing the XAML manually, just like writing HTML. However, the benefits of the IDE go far beyond the visual designer. There IntelliSense , debugging, and a host of other invaluable features.

In fact, I must question your motives. What are you trying to get? Visual Studio Express Edition fully supports WPF development, so it cannot or should not be a cost problem.

+2
source share

The latest version (3.0) now supports the wpf template.

Just download it from: https://dotnet.microsoft.com/

Just type in the console:

dotnet new wpf -o wpfHello

cd wpfHello

the code.

Greetings :-)

0
source share

All Articles