I want to write a little application for myself to learn C# and WPF.
The typical hello world in 2009 (twitter client) seems boring. I would like to hear your stands should I do a twitter client? Any other starters I could play around with and get used to c#? (I'm a longtime PHP programmer)
A Twitter client ends up being a good way to get started with WPF, for a few reasons:
It's got lists of data with images, which gives you practice with formatting and styling lists
There are a lot of options for styling what you're working on - partly due to the avatars, limited text blocks, etc.
A Twitter app is the kind of application where you expect to see good UI
There are some good libraries availble (I highly reccommed tweet#) so you don't need to bother with any of the plumbing
It's something you can show off and be proud of - people will understand what it does
There are plenty of complex things you can add on later if you want - skinning, drag and drop, autocomplete, spell checking, etc.
There are some open source WPF clients out there, so you can find some sample code if you get stuck
And the number 1 reason why it's good idea... you can start contributing your code to the Witty project. We'd love more help!
I recommend to write a native GUI (WPF) client for your most recent PHP project.
You can try writing a modelling tool (business processes flow/UML (classes)/execution flow i.e. scripts execution flow/etc...).
WPF Virtual Labs are a good place to start.
Only do a twitter client if that's what you're interested in. I don't see why twitter should be the new "hello world.", except maybe for making such a thing, like a twitter or facebook bot.
If you want to focus on C# and OOP, try something with many objects interacting, like a simple fighting game, poker, black-jack, etc.
If you want to learn wpf, try some fancy interface stuff, like a calculator, a video player, a photo gallery.
You're only limited to your imagination. Try to pick something fun, or something you'd like your computer to do, and code away. :D
Related
I imagine this question will not bear anything, but this is a last ditch attempt before I have to tell my PM I simply can't do it.
My colleague (usefully before leaving the project) was a yes man to everything our PM asked for, regardless of what it was, and I seem to have been volunteered to create some functionality that will generate an Organogram / Organisational Chart and present it in the view.
I have dug around and asked around, no one really seems to know how I would go about doing this. Can anyone offer any advice on anything that can help? Even if it's the most basic tutorial or obscure API ever, it will be helpful.
To put a point on it, my question is: Is it possible to generate a chart in an ASP.NET MVC C# Application, and display it on a View? (Even a yes or no would help)
Yes, everything is possible. It's just a matter of how much time you can spend on it. Not everything has a good return on investment though, but that's for your PM to decide. As long as your team can make an estimation of the complexity.
But for ASP.NET, Microsoft has a Charting library that allows you to build charts. There are also commercial libraries (the first google hit) out there that are more feature rich.
And if they don't work, you can Always build images manually using the System.Drawing namespace of .NET (that will of course take considerably more time than plotting a chart using one of the available libraries). Generated images can be sent through an ashx handler, or you can embed the image in the same page using base64 encoding.
It's not bad to say yes to your PM, but I rather say: "Yes, we will stick this feature on the feature list / back log, and make a estimate of the complexity. Once we know the complexity you can choose to select it for a future iteration." But perhaps I'm talking too Agile now ;-)
You can hand off the chart drawing to an external library, for example, Google Visualization: Organizational Chart
Have a look at this question for other suggested librairies:
What's the best library to draw organization chart using JavaScript?
This sounds like it's in a commercial scenario, so it's really worth looking at the commercially available solutions. Steven already mentioned one, but as far as I can see that one is for Windows Forms and the other one is for charts as in bar charts and provides no organigram features.
A Javascript diagramming library with the capabilities of displaying organizational charts is yFiles for HTML. It has a nice online example of an organization chart that might be exactly what you are looking for:
There is also a Video that shows the demo in action.
The library is a pure Javascript implementation that does not depend on server libraries or servers at all. Integrating it in an ASP.net environment should be easy though, as long as you know Javascript. Being a library it offers full customization capabilities. You can determine the look and the feel of all aspects of the chart. Under the hood the library is a generic graph drawing and editing tool and the organizational chart is just one possible use-case.
Full disclosure: I work for the company that created the library, but on SO I do not represent my employer. My comments, thoughts, etc. are my own.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I just started learning C#, and I want to start making some small applications that are easy, but powerful.
Does anyone have any projects ideas? I'm interested to hear what you have in mind. Most of my experience is with HTML, CSS, JS, PHP.
Thanks
What do you like doing? I find games are always a cool place to start. If you like game-development you can do stuff like pong and pacman, but you can still have a lot of fun just making board and card games without much of the graphics complexity.
Here's some to get you started:
easier: tic-tac-toe, connect-4, go fish, black-jack, candyland, various solitaire games
medium: monopoly, poker, go, checkers, Yahtzee,
harder: scrabble, boggle, chess, Magic: The Gathering
here's different levels of difficulty:
design the logic. For example, make classes and methods to represent the board, properties, and the players in monopoly.
start making a gui. Make the game actually playable!
add AI and computer controlled players. Obviously AI is a huge subject, so there's many different ways you can go.
see here for a ton more projects on various topics
Since C# can be used in multiple types of applications, I'd try to do the same task in each. Perhaps a simple app that connects to a database and performs a lookup based on user input. Maybe connect to the "pubs" database that comes with the SQL Server samples.
You could do this as:
Winforms
ASP.NET WebForms
ASP.NET MVC
Dynamic Data
WPF
A Console app
using
Standard ADO.NET
LINQ
Entity Framework
You can even create a Windows Service that uses WCF, and a WinForms or ASP.NET front-end that consumes that service.
The idea is to get as many TYPES of apps under your belt as possible, so you can see how each is similar, and how each is the same. It will also help you get a better understanding of the "religious wars" over "which is best, Web Forms vs. MVC", etc. The ultimate answers to those "holy war" questions is invariably "what you're most comfortable with". There's nothing like having actual experience with the various options than to actually write something, so a nice, simple app in all of the available flavors would be a very good start.
And finally, since I listed so many things, here are some great starting points for everything I mentioned. There are videos, walk-throughs, etc to help you on your way.
http://www.asp.net/
http://windowsclient.net/default.aspx
http://msdn.microsoft.com/en-us/beginner/default.aspx
How about a scientific calculator? It'll give you basic experience with GUI building and event handling, it shouldn't be too hard to knock one up and most of your focus will be on the language rather than complicated algorithms (which is what you want when you're just starting to pick up a language.)
I've always heard that a simple game like checkers is good place to start. It lets you handle things like:
Separation of Model from UI (possibly
with a view model).
Skinning of controls or custom controls
and is easy to understand and test.
You can try to create something likes todo list. You can to provide a lot of custom feature for it (save/open data files, import to other formats, UI)
A good place to start is something like a calendar/todo application.
You won't beat all the great programs already out there that solve this problem, but you can start with a very simple but functional program, and add a feature a day for the rest of your life without running out of things you can do.
This gives a lot of opportunities for using different UI elements, doing some custom graphics rendering, serialisation/streams/io, database access, and even synchronising with web-based calendars, etc. i.e. It's easy to find a use for many different .net technologies within an application like this, but you don't need to use them: you can write a basic "useful" application in only a few minutes and keep adding to its facilities to learn new technologies.
Personally, something I'd like right now is a program that performs batch file management operations...
Sorting files into subfolders based on date or name patterns;
Renaming files based on user-defined patterns (e.g. add or remove a prefix from all filenames)
Renaming files based on metadata, if you can figure out how to read it (e.g. mp3 ID3 tags)
Then again, maybe this is too advanced. Or boring. I always find it fun to write a game that is a clone of an existing game, but add a twist. Like 3D tic-tac-toe... bad example maybe, but you get the idea.
Write a graphical dice roller simulator. It should be one window and when I press the "Roll Dice" button it simulates a roll of the dice, showing me an image of how my dice landed. And bonus points if it makes a nice dice roll sound. Extra bonus points if you let me choose how many dice to roll.
I expect to see this by tomorrow afternoon.
Good luck.
Maybe a little more advanced, but I enjoyed creating a little cheating program for playing the bejeweled blitz game. I followed Mike Vallotton's blog to get me started. it's here
Another good one would be to count the number of words in a text file.
Add a little more functionality to it by searching for keywords and returning how many of those were found in the text.
Start with writing a simple program using Form Application using a button and when clicked: Open a MessageBox saying Hello World. Then going over to new stuff like a webbrowser and then obtaining the source code from the site
3 basic steps in learning c# by webbrowser development:
1. create a basic browser that opens up a hardcoded site (site preprogrammed, not decided by user)
2. user controlled, textbox that the user can decide webpage with.
3.pulling out source code and changing every picture on a page for example. That will combine HTML and C# and since you have experience with HTML, changing the client side of the WebPage is good practice.
Good Luck :) Look up ThenewBoston on youtube, really great tutorials on C#
got a couple ideas:
you can make a pretty basic calculator [console application or windows form application]
you can make a dice (give random number between 1-6 or a random number between two numbers selected by the user.
a magic 8 ball, this uses the dice in the previous dot point, but instead uses the randomised integer and prints out the corresponding string.
you can make a planner application (an app that saves data such as todo list on a .txt file, etc).
you can also make a desktop assistant (i made one recently), that recognises voice and speaks to the user. It can also obey simple commands.
if you want to go deeper, you can try coding using C# to create unity games, i had some experience in this, it is very easy (got pretty good at it after reading some documentation and watching some tutorials).
but if you are just starting out, then i recommend you to work your way upwards and start off with making something simple.
I'm currently working at a application that helps people understand how to do there job. You can see it as a personal coach that guides them trough all the steps they need to do that no normal person could keep remembering.
In my previous application we had the ability to show the user up to 4 pictures (what proves to be more then enough). The application would load the data and see how many pictures where in every instruction and then sort out the picture in the best fitting way without messing up the scale and resolution of the pictures. This all was done with GDI+ and worked very well.
Ofc, change is something that always happens, my bosses came up with some great ideas. So they want to be able to see movies on the screen, animated gif's, 3D models that can rotate or animate. So I think we had pushed GDI+ to it's limits and it's time to look for something different.
I have heard and readed about WPF but have no experience with it. Is it even possible to do all what I ask in WPF? And what about the old picture-merging thing I wrote, can we also get it done in wpf? I tried to make some things working but I didn't went as smooth as I hoped.
I'm also concerned about the fact that the interface needs to be dynamic, the one moment it should be showing picture with some text above it, the other moment it should be showing another text with a video under it.
I would love to hear some opinions here and if you got some other suggestions I should look into pls tell me. Thnx in advance
PS: If WPF is the choice, should I convince my boss to change to .net 4.0?
Although my answer can be termed subjective, I find WPF better than GDI+ anyday. You can do everything you can in WPF which you have done/could do in GDI+ (apart from pure games/game engines). If you can afford the steep learning curve of WPF, I think it will be better investment as this technology is not going anywhere soon.
As for .Net 4.0, WPF 4.0 does introduces some important functions in 4.0 (specially easing functions for animations) but there is nothing you cannot do without if you are using 3.5. I won't recommend 3.0 though mainly because of performance in animations.
WPF is up to the task, but you could also check other options.
You could go web based, and have either an XBAP (WPF in the browser), or Silverlight/Flash app.
Silverlight/Flash doesn't require that much from the client (to install), and is easily updatable, and both can do the job.
i am trying to research some gui technology for c# where i can display a tree view (opposed to the standard one provided.)
Essentially i want to have the gui draw a tree of data (as if you were going to draw a binary tree on a piece of paper or something) Then making each of the nodes clickable.
If this isnt available does anyone know of something where i could have a mindmap type GUI which shows links between elements and those are clickable?
I can guess people will say make one yourself, in which case i give up already ;) thats too advanced for me and as i am on a work placement i dont think i would be granted the time to make it as there are more pressing issues to get working first, like actually making the programme work!
Thank you
You can take a look at the controls in Kevin's WPF Bag-o-Tricks which has a WPF mind map style layout. Here is a nice example. If you want to use more professional components take a look at the product from Nevron Software, they have some great controls. There is also an opensource WPF graphing library - graphsharp (which I have no experience with, but I found a nice article by Sacha Barber). Since it's used in nDepend it must be pretty mature.
I hope you get some inspiration from those links :)
I also found XMind API for C#
https://xmindapi.codeplex.com/
It's free and looks easy to use.
I want to learn c# so I can do some desktop developing. I've developed command-line C# applications and wanted to expand to Desktop applications.
I was thinking of create a screenshot tool like Jing or maybe a plugin for outlook to sync contact information with a service like Google.
What are your thoughts? My past experience is with web applications built in PHP.
I would try to start with something fairly contained, which only touched a few new technologies. For instance, if you want to learn Windows Forms, write something which uses that but doesn't need to talk to Outlook, Google, or the Win32 API. Once you've got the hang of Windows Forms, try one extra technology - try displaying your Google Contacts and do offline editing, for example. Then add another technology... etc.
In my experience it's hard enough to learn one new technology at a time - but that's far quicker than trying to learn two or more in one go. You inevitably get to the stage where you don't know where the problems are, and you have no confidence in any of your code because it's all new. This is particularly important if you're still fairly new to the language as well - although I'm glad to hear you started with some console apps :)
Sorry if that sounds like I'm being a wet blanket, and I realise it sounds like you'll take far longer to get to something useful that way, but I think you're more likely to be successful in the long run.
Find something that most importantly interests and excites you. If you pick something too boring that you don't care about you'll only give up before you get anywhere, and won't benefit at all. Don't do a rubbish project for the sake of learning a language. Do a good project, and do it in a new language as a side effect.
Make a notepad clone. While being fairly simple it will give you a primer in some basic Windows Forms mechanisms such as using menus and reacting on their events, getting input from controls for storage on disk, reading from disk and updating controls, using Docking and Anchoring and so on.
Twitter clients are the new hello world.
I read that somewhere the other day. I can't personally comment on its fitness for your goal.
Do something that you did before, but in another language. Then you won't have to think about most of the architecture of the particular task again, but you'll be able to compare the languages, the frameworks and their approaches.
I bet you'll learn a lot about your previous language as well doing this excercise.
A good project would be a simple windows form. You simply have a chance to put everything together. Or at least see a bigger picture.
You can make it as complicated as you want, without sticking to one area.
Suggesting a specific project is pointless. Think of something that interests you, or an application you want/need, then start making it - searching Stackoverflow/Google/MSDN/etc whenever you can't guess how to do a specific task.
For example, I had to make kiosk application that allowed customers to signup to a companies mailing-list. I tried using the Ruby framework Shoes, but it didn't work correctly on the laptop the application was to run on. Visual C# seemed like a better fit, and would almost certainly run correctly..
So I installed Visual C# Express, added a few labels and a button. I double clicked the button, and realised I didn't know the code to create a new WinForm window.. So I searched Google for "visual C# open new dialogue" or something, and I found out I had to add a new form, then call NewForm newwindow = new NewForm(); newwindow.show(); or similar.
Then, I added the username/email fields, then searched for "how to display an alert box" and checked I could display the form values.
That all worked, so now I had to decide how to store the emails. I had heard good things about LINQ to SQL, so looked into that, decided I wanted to use SQL Server CE (so I didn't have to install/run SQL Server on the laptop). That resulted in more searching around for how to make LINQ to SQL work with SQL Server CE..
Finally, I wanted to have a configuration panel to change the title/button strings etc (accessible via a certain keyboard shortcut).. A Google search revealed how to catch keystrokes, and I asked a Stackoverflow question about representing the settings (using a PanelView or something)
..anyway, the point of that slightly long, rambling and not terribly interesting story is.. You can learn many new technologies at once, as long as you have a specific application in mind (and you're determined to finish it!)
I learned C#, WinForms, SQL Server CE, LINQ to SQL, and simple application publishing stuff in a day - creating a functioning, useful application in the process - simply with a combination of prodding around, Google searches and Stackoverflow..