Pages

Wednesday, May 19, 2010

ScrollViewer Scroll Change Event in Silverlight

Today i was working with scrollviewer and surprisingly i did not found a scroll changed event... really got irritated and tried to find a workaround for that and would love to share with you all.
I found two workarounds and the good thing is both of them work :) and are mentioned below.

1st: Catch the scrollbar controls inside the scrollviewer control template and use the scroll event of scrollbar control.

2nd: Create a dependency property which listens the change of Offset properties of ScrollViewer

Here is the sample project created and would be straight forward and is self-explanatory.

Unable to Start Debugging. The Silverlight managed debugging package isn't installed

Recently i got this error while debugging the silverlight application. When i have googled a bit, i found most of the answers as latest developer runtime is not installed. but this was not my problem.

Problem Cause:
i have uninstalled the silverlight browser plugin and reinstalled it. So this was causing the problem


Solution:
i have re-installed the silverlight_tools.exe. this has solved the problem

Sunday, May 16, 2010

Creating a smooth sliding horizontal menu using JQuery

For this example we need the latest version of Jquery which is available at http://Jquery.com
here goes our HTML Code:
and the CSS:
#slider{
height:122px;
clear:both;
margin:30px 10px 10px;
background:#E6F1FE;}

#slider ul{
list-style-type:none;
height:122px;
overflow:hidden;}

#slider ul li{
display:inline;
float:left;
width:122px;}

#slider ul li a:hover{
cursor:pointer;}

#homeSlider ul li img{
display:block;
float:left;
border:solid 1px #2B78B0;}

#slider .current{
width:500px;}
Now here comes the magic(JQuery!!)
You are just 5 lines away from creating a smooth sliding Horizontal menu.
$(document).ready(function(){
var minWidth = 122;
var maxWidth = 500;
$(”#slider ul li”).hover(function(){
$(”#slider ul li”).animate(
{width:minWidth+”px”},{queue:false,duration:”slow” }
);
$(this).animate(
{width:maxWidth+”px”},{queue:false,duration:”slow” }
);
});

Now lets understand the JQuery code
1) $(“#slider ul li”).hover(function(){
-> this line binds hover event to all the LI elements after the DOM is loaded
2) $(“#slider ul li”).animate({width: minWidth +“px”}, { queue:false, duration:“slow” });
-> In above line we are animating the width of all the LI elements to minWidth with slow transition and making the queue false as we have to make width of the hovered LI element to maxWidth.
3) $(this).animate({width: maxWidth +“px”}, { queue:false, duration:”slow” });
-> In above line $(this) refers to the hovered element, we are animating the width of the hovered element to max width a slow transition as to create a smooth effect.

Thats it, with this you should be able to create a smooth horizontal menu with JQuery..

Bye for now… be updated to my blog as there are many more to come :)

Saturday, May 15, 2010

"Hello World" Blogger Post :)

Hello all,
By reading the title of this post you may think what non-sense is this, just to say a simple hello to this world does the author need a blog and a blog post.
But some of you(like me) may be hearing this word very frequently and love to hear that when new technologies or new versions of existing technologies emerge.

Now some of you may get an idea of what will this blog be all about. Yes this is yet another blog by Microsoft .Net developer to share his ideas, learnings and solutions on almost all of the microsoft technologies.

And coming back to "Hello World", If you are not a developer/IT guy then you need the definition of this word "Hello World". This word is used in almost all of the sample projects demonstrated by the authors of new technologies and these projects would be really helpful to the developers who are learning those technologies.

Now it's time to introduce myself to this world and say hello:).
This is Kranthi Kiran from Hyderabad, India working in software field from the past two and half years. My passion is to code and really love to fix bugs which are high priority and need a quick fix. In this blog i'll post whatever i think is interesting and worth sharing in my day-to-day development. The technologies which i work on are HTML, CSS, Javascript, JQuery, CMS Technologies, Silverlight, WPF, WCF, LINQ, SQL, SSRS and other related technologies.

Let's hope everything goes fine and love to see you back to view my blog....
Track my blog for updates... Will be back with my stuff loaded in the further postings..
Bye for now...