C# MVC Windows application - c#

for developing a application in C# windows application which one is better MVC or creating class file for each form

Right now the suggested direction for a Windows application would be WPF using the MVVM patern (Model, View, View Model). There seems to be a good match between WPF and use of a View Model by way of declarative binding and other nice stuff.
There are articles here: http://karlshifflett.wordpress.com/mvvm/ that should point you in the right direction plus stuff on Channel9 and elsewhere.

If you are using WPF, ModeL View Presenter (variation of mvc) is the best choice. In case of Windows Forms MVC is unnatural but still you can emulate it partially with this technology.

Related

MVVM WPF - Implement current_user like Ruby on Rails

I'm creating a new WPF application with (my first WPF app):
.Net 4.0
MVVM Light
C#
MahApps Metro
I've started with the Login View (Hehe, obvious right?). Well, I'd like to preserve information of the current user logged into the app so I can hide/show elements based on the profile and some other similar tasks.
I'm familiar with Ruby on Rails/MVC and Devise. In Devise you have the current_user object along all the project and you can use it for several purposes.
I know that MVC and MVVM are somewhat different concepts so, I don't know for sure if the same approach is valid for MVVM/WPF.
Is it valid? If so, how can I do it with MVVM Light?

Windows Form based application layout/template

I am very new to Windows form based application. I have Visual studio 2012 and want to create a windows application.
This question might be asked before but I was not able to find any clear answer, so I decided to post the question here..
I want to know that if there is a way to create a master form (or a kind of template) for my application having common controls and rest of the forms can inherit that, likewise we do in web-applications.
I found somewhere that instead of going with Windows Forms application, I should go with WPF application, if that is the case can somebody point me to a good article where I can find some info about it....
I really advise you to work with WPF, windows forms is dead since years. WPF is very flexible and you can do far more things than windows forms.
Here is how to implement Master-Page like behavior using WPF: Link.
Here are some WPF tutorial to start your journey:
http://www.wpftutorial.net/
http://www.tutorialspoint.com/wpf/
Learning WPF and XAML is great as it is very similar to most new technologies like Android (layouts), Xamarin (Forms), etc... So it is good technology to learn.

using playbackagent for windows phone 8.1 in MVVM Pattern

I'm trying to play audio in background, I have made a project using MVVM light Desing pattern. After some research I found this sample that helped to implement playbackagent in windows phone 8.1!
My goal is to implement the Agent in my solution with MVVM Pattern.
Could someone help me with that?
I can provide some general rules:
Put business logic / condictional code into the ViewModel.
Your View (.xaml.cs) files should only have minimum and necessary code for UI
Use the service locator to always have one instance of the music player (which can be warped inside a controller).
Use Messenger service to send data / notify the player from difference view models

Is there any designer to declare View in ASP.NET MVC in drag and drop way like in WinForms, WPF or Windows Phone applications?

I learn ASP .NET MVC using this tutorial: http://www.asp.net/mvc/tutorials/mvc-music-store
There are few problems and one is creating View in not comfortable way as it would be in desktop WPF, WindForms, Windows Phone applications. Does Visual Studio or Blend or any Microsoft's IDE provides more drag and drop way to declare view in ASP.NET MVC?
The main problem here is that the drag&drop designers manipulate components, and ASP.NET MVC is not component-based. You have a couple HTML helpers here and there, but there are no components to manipulate in the first place. Plus, the ASP.NET MVC framework is terse, there are only a very few helpers and templates provided out of the box. It relies heavily on code for things like lists (#foreach(...)), whereas ASP.NET WebForms relies on components like Repeater, and you pretty much have to write a lot of stuff yourself, which in the end is a good thing because you are not bound by the many limitations of the components ASP.NET WebForms provides.
Perhaps my little explanation can make it more clear why there are no drag&drop editors for ASP.NET MVC.
Yoda, maybe you're attempting to learn too many things at once?
MVC isn't a technology you will learn overnight I promise you, and looking for drag and drop designers means you're trying to cut corners, and MVC is not a framework you want to do that with as it will come back to bite you.
Instead, I recommend the Pluralsight videos which are available free of charge.
Start with MVC 4 videos
After you feel competent there, move to the MVC 5 videos
The videos on MVC 5 assume that you already have knowledge on MVC 4, so as I said, start with 4.
(The videos are free of charge thanks to Microsoft footing the bill)
There is a graphical designer for creating views in drag and drop way, it's a visual studio extension named MVC Visual Designer, you can search it by using Visual Studio menu: TOOL\Extensions and Updates.
Disclaimer: I'm the author.

UI for a trading application in C# WPF

I have created a trading application in WPF, for which I am ashamed of it's shabby look since it is far from being impressive.
I would now like to redesign the user interface for my application, and make it similar to an example screen shot of a trading application
Can someone please advice tips on what path I should follow to make a UI of similar nature? eg., if there is an open source C# WPF application which has a similar look and feel, that would be great. or if there is a library which has cool listview, scrollbar and progress bars, ..
PS: I do not have microsoft blend
You should follow the MVVM pattern for creating UI's for wpf application
http://msdn.microsoft.com/en-us/magazine/dd419663.aspx#id0090025
Refer the josh smith blog for WPF MVVM
http://joshsmithonwpf.wordpress.com/a-guided-tour-of-wpf/
Hopefully you would have completed your application by now. If not:
Try understanding the sample Stock Trader Reference Implementation application by MSDN built using WPF, MVVM, and Prism and you would get a head start for creating your kind of UI and implementation.
You can call it as a suggestion not an answer exactly. But posting for those who are new to WPF and learning screen designing or patterns. According to my experience with WPF I can say first get you hands dirty learn how binding works because that is the base of WPF.Simpler way to learn how binding works is learning how to bind controls with other controls. Then use simple classes and learn MVVM. Next go for command binding within MVVM perimeter. Keep the prism to the last, because you need good understanding of binding mechanisms, commands, MVVM and more to understand PRISM. After this you will have idea of how these things work together and will help you figure out how to play with data and screen together and design nice screens. Again, Not an answer to the above question. Just suggestions to those who are learning WPF and landed here looking for WPF UI designing.

Categories

Resources