Posts

Seven Tips and Tricks Programming WPF

The Internet has much to offer in any topic and there is much to learn, but where to start? I realized many years ago, when I got intrigued by the Windows Presentation Foundation (WPF), short write-ups that help you acquire additional knowledge, which when combined can provide solutions to the bigger picture. This article provides a list of tips I learned a year ago, while scanning for simple solutions to big problems.  javascript:void(0) Use the list Visibility.Collapsed vs Visibility.Hidden  The collapsed value ensures that the element is not involved in the design and gives you a zero height and width. The latter causes the element to continue to participate in the design.  Reduce CPU consumption for animations to WPF   As you know, WPF animations are based on 60 frames per second. You can reduce this to a lower optimal rate, resulting in less CPU usage. Use the timeline. DesiredFrameRateProperty to change the default, set to a lower value as 15, and then ...

Bind jQuery event handlers for this object CoffeeScript

Bind jQuery event handlers for this object CoffeeScript  Friends have told me that the rich domain objects rarely does so using jQuery to improve performance in web pages. I myself have always loved dynamic JavaScript as a language rich first and something for the second DOM. So most of my client-side JavaScript is an object-oriented robust approach similar to Ruby. This is the main reason they have used Prototype.js for so long. Since both jQuery and Rails CoffeeScript announced as the default in version 3.1, I decided it was time to start learning them. I had always known that jQuery linked keyword is in the event handlers to the DOM object. Something you are totally confused and unacceptable for someone working on their own objects to encapsulate behavior. Today I found two ways to deal with my problem, one way and one way CoffeeScript jQuery. First a code example. class MyObject      constructor: ->     @myDomElement = $('#m...

Adding a Controller

Image
Adding a Controller MVC stands for  model-view-controller . MVC is a pattern for developing applications that are well architected and easy to maintain. MVC-based applications contain: Controllers: Classes that handle incoming requests to the application, retrieve model data, and then specify view templates that return a response to the client. Models: Classes that represent the data of the application and that use validation logic to enforce business rules for that data. Views: Template files that your application uses to dynamically generate HTML responses. We'll be covering all these concepts in this tutorial series and show you how to use them to build an application. Let's begin by creating a controller class. In  Solution Explorer , right-click the  Controllers  folder and then select  Add Controller . Name your new controller "HelloWorldController". Leave the default template as  Empty controller  and click Add . Notice in  Solution Exp...

ASP.NET MVC 3 Introduction

Image
This article will explain you the basics of ASP.NET MVC 3 Web application by using Microsoft Visual Web Developer 2010 Express Service Pack 1, which is a free version of Microsoft Visual Studio 2010.  Make sure you've installed the prerequisites listed below before you start. You can install all prerequisites by clicking this link:  Web Platform Installer . OR, you can individually install the prerequisites by the following links: Visual Studio Web Developer Express SP1 prerequisites ASP.NET MVC 3 Tools Update SQL Server Compact 4.0  (runtime + tools support) If you're using Visual Studio 2010 instead of Visual Web Developer 2010, install the prerequisites by clicking the following link:  Visual Studio 2010 prerequisites . A Visual Web Developer project with C# source code is available to accompany this topic.  Download the C# version . If you prefer Visual Basic, switch to the  Visual Basic version  of this tutorial. What You'll Build You'...

Introducing MVC Development w/the Razor View Engine for Visual Studio Developers

Image
The Razor View Engine is a precise, useful, light language that enables you to create views for MVC projects in ASP.NET still while keeping a separation of concerns, ability to test, and pattern based development.  ASP.NET MVC developers looking for a more concise syntax now have another option that's built-in (of course, there are many 3rd party view engines out there) with the language being a familiar light version of C#.  The Razor View engine is used to create WebMatrix sites or Visual Studio MVC applications.  When using ASP.NET MVC with either engine, you'll stick to a style of development called "convention over configuration", meaning that you'll use certain naming conventions to name files, models, views, controllers, and other key application elements rather than storing lots of metadata about these same elements in a configuration file.  When using MVC in Visual Studio 2010, it's is setup so that you'll be guided to use convention over configu...