Thursday, February 24, 2011

Basics Of MVVM in Silverlight

While I was doing a project using Silverlight, I had a requirement to cascade some combo boxes. As some might already know binding data to combo boxes in Silverlight is a real headache. So when I googling for some answers, I saw a lot of articles about a topic called data binding using MVVM. At first I had no idea what MVVM is and then I wanted to learn what MVVM is. After some reading I was amazed by the things that can be achieved with MVVM and I thought I might share some basics of MVVM with you all.

First of all MVVM(Model-View-ViewModel) is a great design pattern for Silverlight and Windows Presentation Foundation (which is commonly known as WPF). The MVVM has become a such overrated pattern is because it's powerful features. One of the best features of MVVM is it's close work with XAML based applications such as Silverlight.

To get a best idea about MVVM, I will explain the MVVM Triad (Model,View,View Model).
  • View is the user controls designed in XAML. Since I am mainly focuing on Silverlight, in Silverlight View is described in MainPage.xaml. 
  • The Model is used to access the data from a data source. 
  • The View Model is used the put all the logic behind the controls and to fill the gap between View and the Model. It actually bind or convert the information of Model to View information.
Using these three parts, MVVM provides powerful XAML binding for it's controls. If you are doing development with Silverlight or WPF I am sure some of you have already gone through the need of this nice pattern and if you have not gone through this pattern yet, very soon you will be going through. You can find more information and tutorials in the web on MVVM.

Happy Coding.

Regards,
Jaliya

Sunday, February 20, 2011

Error : Your mailbox appears to be unavailable. Try to access it again in 10 seconds - Microsoft Exchange 2010

Today for the first time in my life, I got the experience of installing Microsoft Exchange 2010 and that was really a nice one. My requirement was just simple, which was sending an Email from SharePoint to Exchange. I configured SharePoint to send Emails to my Exchange and when I checked from SharePoint my Emails were nicely sent.

But when I tried to log in to OWA (Outlook Web App) to check whether I have received my Emails, after typing the user name and password I got this nice error saying "Your mailbox appears to be unavailable. Try to access it again in 10 seconds". Since I am a beginner in Exchange I was confused and tried many things to fix it.

But after struggling for around 2 hours, at last I have managed to fix it now and I am so happy.

Solution was again, just a simple one. That is,
In services, Start the service "Microsoft Exchange Information Store". I think the problem was, without that service up and running Exchange can't map a mailbox to a user.

Now everything is fine and I have received my emails and I got the pleasure of confirming my Emails are successfully receiving from SharePoint.

Happy Coding.

Regards,
Jaliya

Monday, February 14, 2011

Silverlight UI Thread and Background Thread

One of the coolest features in Silverlight is UI threading. WPF is also provides UI threading. I got to know about this feature while I was trying to update the UI elements from my background thread. After googling around I saw a nice class that deals with threading which is the Dispatcher class. Mainly what Dispatcher class does is it provides services for managing the queue of work items for a thread.

One important thing that you should keep in your mind is that Silverlight recognizes the difference between UI threads and background threads. You just can't update controls designed in XAML through your background thread. You must invoke the UI thread by using the Dispatcher class.

We can simply do this by declaring a delegate to access the XAML DOM.

Dispatcher.BeginInvoke(delegate()
{
//update the UI
});


Happy Coding.

Regards,
Jaliya

Sunday, February 13, 2011

Geographic Information Systems(GIS) for SharePoint using Silverlight

These days Geographic Information Systems (GIS) are becoming more popular systems rather than ever before. Since currently I am working on developing a GIS, I thought I might share some things I got to know while developing.

First of all .net is a nice platform that supports developing GIS. Through SIlverlight, It seems to me that you can develop anything for your GIS. You can do all the customization per your need.

ArcGIS API for Microsoft Silverlight/WPF is one of the commonly used and one of the best free APIs that can be accessed within the Silverlight code. One of the greatest advantages of using Silverlight for your GIS is, you can attach your GIS into a SharePoint site very easily. Just add the Silverlight Application(.xap) to a document library of your SharePoint site, then add a Silverlight web part to a web page and configure the source for the Silverlight web part to the added .xap file and that's it. Your GIS will be nicely loading into your web page.

There is a mapping for SharePoint by ArcGIS for creating a GIS using SharePoint, but I don't think you will be able to do all the customizations you want by using it. Anyhow It's always good to explore that one too.

If anyone is developing or interested in Geographic Information System feels free to post your questions or comments here.

I am sharing some links for further reference.

To get some more details about ArcGIS visit,
http://www.esri.com/software/arcgis/index.html

To learn about ArcGIS API for Microsoft Silverlight/WPF visit,
http://resources.arcgis.com/content/arcgis-api-silverlightwpf/1.2/about

To learn about ArcGIS mapping for SharePoint visit,
http://www.esri.com/software/arcgis/mapping-sharepoint/index.html

Happy Coding.

Regards,
Jaliya

Monday, February 7, 2011

Basics of Client Object model in SharePoint 2010

When writing some applications for SharePoint 2010, I have noticed this nice thing called Client Object model. In here I am going to describe what Client Object model is per my understanding. Since I am a beginner for SharePoint please feel free to correct me if I am wrong.

SharePoint 2010 has introduced developers a nice concept called Client Object model which can be used to do variety of customizations in SharePoint. Previous versions of SharePoint such as SharePoint 2007 had no Client Object model available.

The main reason for Microsoft to introduce such a concept was, the developers need of different kind of Web Services that interacts with SharePoint and It’s not possible for Microsoft to Develop a Web Service per developer’s need. Even if Microsoft has provided a lot of Web Services that interacts with SharePoint, but because of the developer’s need of customized web services has made most of the out of the box web services unusable.

The most important part of using the client object model is developers can build remote clients without using the SharePoint out of the box Web services and without implementing the communication architecture.

Basically Client Object model enables developers to build solutions that consume SharePoint data and objects from applications that do not run on a SharePoint server. The best example would be a Silverlight application.
In Client Object Model Client can be in one of these type of applications.
  • Managed Client (Assembly File – Microsoft.SharePoint.Client)
  • Silverlight (Assembly File – Microsoft.SharePoint.Client.Silverlight)
  • ECMAScript (Assembly File – SP.js)
SharePoint 2010 client Object Model is written based on .Net CLR, so we can write custom code in C# or VB for SharePoint 2010 platform. For this we need following dlls , located at “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI” folder.
  • Microsoft.SharePoint.Client.dll
  • Microsoft.SharePoint.Client.Runtime.dll

Similarities of SharePoint Client Object Model


Server (Microsoft.SharePoint)
Client Object Model
SPContext
ClientContext
SPSite
Site
SPWeb
Web
SPList
List
SPListItem
ListItem
SPField
Field


Please feel free to correct me and Give me your feedback.

Happy Coding.

Regards,
Jaliya

Monday, January 31, 2011

Moving into SharePoint 2010

SharePoint 2010!!!

Two months ago I had my first step into SharePoint and I had no idea what SharePoint is and what type of solutions SharePoint can deliver. Then I started learning SharePoint and as the time pass by I was really surprised with the features of SharePoint.

My first touch and feel version of SharePoint is SharePoint 2010, which was released in the first half of year 2010. Basically SharePoint is a Software Platform which provides Collaboration, Web content management, Documents management and many other features. The most important part of SharePoint is each of these features runs under one single platform.

For more information on SharePoint 2010 visit,

Happy Coding.

Regards,
Jaliya


Oops...Broken Links

It seems the free file hosting service I have been using has expired. So all the links are broken. I am sorry for that.

These are my new links,

For Syntax Highlighting C# Editor with an Inbuilt Compiler Version 1.0.0.1,

For Compile .cs file into .exe Version 1.0.0.1,

For Send Emails Easily using Gmail,

Happy Coding.

Regards,
Jaliya

Wednesday, November 10, 2010

Syntax Highlighting C# Editor with an Inbuilt Compiler

Today I am releasing the version 1.0.0.1 of the editor which is Syntax Highlighting version of C# Editor with an Inbuilt Compiler.

You can free download the new version from the following link.



If you have not installed Microsoft .NET Framework 3.5 in your machine you can free download and install it from the following link.


This release contains the following fixes and features.
  • Proper form alignment - Done.
  • Will be able to open only .cs and .txt files - Done.
  • Will allow only .cs and .txt files to be drag and dropped on the editor area - Done.
  • Some fixes in new,open,save,exit menus and added a close - Done.
  • Validating when saving files as .cs and .exe - Done.
  • New Feature - Browse and Compile .cs Files - Done.
  • New Feature - Run (Direct Run which will compile the file first and then run the created .exe or Browse and Run an .exe) - Done
  • New Feature - C# .NET Syntax Highlighting (I had to struggle a lot to implement this feature) - Done
It's great if you can download and try this new version and give me your feedback. You are mostly welcome to point out bugs. These days i am working on implementing IntelliSense feature.

I will really appreciate your feedback and happy coding...

Regards,
jaliya


Monday, November 8, 2010

Upcoming Fixes,Enhancements in C# Editor with an Inbuilt Compiler

When doing some enhancements on the editor, faced some bugs myself. So there will be a update releasing soon. On that release there will be fixes and enhancements on following features.
  • Form alignment (Well, I want the alignment to be perfect).
  • Will be able to open only .cs and .txt files.
  • Will allow only .cs and .txt files to be drag and dropped on the editor area.
  • Some fixes in new,open,save,exit menus (Will add a close).
  • Validating when saving files as .cs and .exe.
  • New Feature - Run.
  • Syntax Highlighting and IntelliSense feature (I'm not sure whether i will be able to complete these two by next release)
feel free to send me your new ideas regarding the C# Editor.

Regards,
jaliya

Sunday, November 7, 2010

Simple C# Editor with an Inbuilt Compiler

After releasing the simple compiler for .cs files it came to my mind, that it's better to develop a simple editor that can be used to both edit and compile .cs files. So i wrote this program. This editor is simple and really easy to use and of course it is free. You will just have to wait for around 5 seconds before downloading since i am using a free file hosting service to upload my releases.
You can download this editor from the following link.

Download from Jigsaw Share version 1.0.0.0

This editor has following features.
  • Default text editor features(Undo,Redo,Cut,Copy,Paste etc)
  • Compiler


Since this is the initial release this will only have above mentioned features. Now i am working on developing Syntax Highlighting and IntelliSense feature. Actually I have wrote the Syntax Highlighting feature and unfortunately it has some little bugs. So i have not included it in this release.

It's great if you can download and try this editor and let me know your feedback. You are mostly welcome to point out any bug on this editor.

I will really appreciate your feedback.

Regards,
jaliya