viernes, noviembre 28, 2008

Windows and TimeZones

People from IT and DB guys have told me they can't rely on Windows when it comes to TimeZones and when time zone adjustments are necessary. I've seen systems re-implementing this feature again just to have have more control. At first this seemed unnecessary for me, but I just noticed today, talking with my sister in law that I had the wrong time of Argentina.

image
The main clock is Sydney in the image is Sydney.

I thought the cause was that Argentina was an additional clock and not my "main clock", so I change that and noticed that according to windows Buenos Aires start's the Daylight Savings beings on December. How hard is for windows to get this right?

image

According to the first page I found in Google (http://www.timeanddate.com/worldclock/) Argentina moved to Daylight Saving and the time is 8:29 not 7:29.

image

How disappointed. Well, let's give it another try and manually update it.

image

Wait for a while

image

Doesn't work :(

 image

Let's try another server

image

Same with all their servers. Failed. Why do they need so many servers only for time? If there were a valid reason, why would the user have to select a different one? Is it like Microsoft saying, "probably we will get it wrong, so we will give you more options just in case (which by the way might also fail)" or "probably you need to create your own time server in case you want to run an anarchy and don't want to go to daylight saving periods". This Internet Server's won't fix our Daylight Saving, they care about time not time zones, so they actually have an other purpose and could bring new problems for systems where seconds or milliseconds are important.

I remember that Microsoft distributed a patch for Windows and Windows Mobile to be able to adjust properly for the Daylight Saving in Sydney. Probably I need a patch for my recently configured Time Zone that went to summer time two months ago. Windows Update? Nothing

Well this isn't not that bad, Microsoft, has this Server product that works fantastic. But they still got it wrong (also in windows seven).

image

Now a typical discussion would go like this:

Customer: We need to adjust the {Enter Feature Heare} based on the time zones of our new markets.  
NET Guy: Microsoft is super cool. We can just rely on them for this time zone thingy and we don't care about it. When we do datetime comparisons it takes into account the TimeZone and when saving it or sending it over the wire that information is also considered and we can easily adjust it to UTC, transport or Local time.
IT Guy 1: That doesn't work. (Because .NET relys on the OS info)
IT Guy 2: All we need to do is keep patching the system for all our servers and client machines on time for all our different markets
IT Guy 1: That's a pain.
IT Guy 3: We better move the time manually and disable the auto adjust for daylight saving.
IT Guy 1: That's a pain in the !@$%!@(~. 
IT Guy 4: .NET Guy, could you do it for us?
NET Guy: I can't it's too complex. If MS didn't got it right it's because it's super dupper complex and we better not code it ourselves, it's going to be more painful. It's better to install that patches, that's why MS provides it.
IT Guy 4 (taking advantage of the super hero pride of the dev): Com'on you're better than Microsoft, you can do everything (sarcastically smiling)
Customer: Uses the puppy face look
NET Guy (all full in drunk in pride and self-steem): I am going to do it.

This is a code that should work on DotNet, but it doesn't.

// Buenos Aires at 19:45 (UTC -3 +1 For Daylight Saving) == UTC 21:45
var argentinianDate = new DateTime(2008, 11, 29, 19, 45, 0, DateTimeKind.Local);
Console.WriteLine(argentinianDate.ToUniversalTime());

// UTC 21:45 == 19:45 Buenos Aires
var utcDate = new DateTime(2008,11,29,21,45,0,DateTimeKind.Utc);
Console.WriteLine(utcDate.ToLocalTime());

Console.ReadLine();


image 


So if the OS gets it wrong, you will get it wrong also in .NET.




  1. There're other options hacks.


    According to this blog post. You can use this tool called "tzedit" to create a custom time zone and decide when you want to start your Daylight Savings. That way you and your family can start saving at a different time of the year, you will be probably late for work, but saving light.


  2. A blog from Microsoft even mentions as Option 1 to move your TZ to GMT-2.


  3. There other option is to install a patch, that isn't supported on Windows Vista and Server 2008 systems and it's only targeted to enterprise suers. What? By the way, this post was published one day before the daylight saving started.

sábado, octubre 25, 2008

Reflector Add-In's Save the Day

Recently my brother had a problem with an old winforms application we developed to help him upload images and product information. The issue was really simple, once I had a chance to run and debug the application the issue was evident. The app was using FTP to upload pictures to the website and the credentials were invalid.

image

Easy I thought, go to the config file and change it, it'll probably be encrypted and might give me a hard time to hack. I opened it and didn't find anything. Let's open reflector and see what's happening I have a Stack Trace to start with, but that wasn't the best place. I remembered the name of the user, so the Reflector Add-in Code Search quickly pointed me to the right place:

image

From there a double click sent me to the method

image

Great. Someone thought it was safer to hard code it instead of using the web.config.

Then the question remains, how can we change it? The proper solution would be to open Visual Studio, connect to TFS, get the sources, edit recompile and sent back the new version. However I don't think the latest version is stable, so I would need to search for a label to get the latest deployed version. I'm running on a really slow connection now and that would probably take a while, beside it's sunday and I'm ready to go surfing (or at least try to).

Option 2. In that same screen just open Reflexil (another Reflector-Addin) locate the IL line that sets the password (this is not as hard as it sounds) and edit the string.

image

Then we simply save the assembly. This was probably the hardest part, this was the first time I used Reflexil and I was expecting the Save As option to be right next to the place where I do the edit, in the Tools menu or a toolbar, I finally found the option when clicking file in Reflector.

image

After that, just save the file e-mail it and ready to go, but then I had the brilliant idea of write this post and it took me more time than the fix.

You can find this an other reflector add-ins in http://www.codeplex.com/reflectoraddins

lunes, octubre 06, 2008

Learning with Tests (MessageBroker in NInject)

A great way to learn a few coding practices is to get an open source project (one good, don't get the first thing you see en codeplex) and trying to understand the code, how they apply patterns, use certain classes or reuse code through the project. The best way to start (with most of the good projects) is with the tests.

I have been playing lately with Ninject, a Dependency Injection Framework,  it's well designed, auto-documented and documented (probably too much documentation at the code level), the downside is that the wiki, the blog posts and tutorials barely cover the basics. However, the tests do a good job to describe the project at a higher level. As an example an example we can see one of the tests for the MessageBrokerModule.

        [Test]
public void OnePublisherOneSubscriber()
{
using (var kernel = new StandardKernel(new MessageBrokerModule()))
{
PublisherMock pub = kernel.Get<PublisherMock>();
Assert.That(pub, Is.Not.Null);

SubscriberMock sub = kernel.Get<SubscriberMock>();
Assert.That(sub, Is.Not.Null);

Assert.That(pub.HasListeners);
Assert.That(sub.LastMessage, Is.Null);

pub.SendMessage("Hello, world!");

Assert.That(sub.LastMessage, Is.EqualTo("Hello, world!"));
}
}


The code is really easy to follow, first he asserts that the kernel can create instances of the publisher and subscriber, then the publisher should have a listener, the subscriber doesn't have any message and finally he sends a message than the subscriber should receive. The other tests like OnePublisherTwoSubscribers and ManyPubsManySubscribiers are similar.

sábado, octubre 04, 2008

Task Board for Scrum for Team System

 

I have been using Scrum for Team System since beta 1 and I quickly fell in love with that template. It reflects the way we were working, however, there was a big gap in the process, specially when planning for a sprint, we usually did all the prioritizations, sizing, assigning and breakdown of Product Backlog Items using other tools like Mindmanager, Excel or sticky notes.

Recently the guys from Conchango, creators of the template, released a beta of a tool that will help use fill that gap. It's a cool WPF tool that will interact with TFS and allow us to create and edit sprint backlog items.

I don't think the tool will replace Mindmanager and the whiteboard still will be an indispensable resource, but I don't think I would like to go back to Excel to edit my items (well lets see how it goes after a couple of sprints of working with it).

When I was looking at the tool I was thinking, mmm yes, you can move a task from In Progress to Done, that's cool, but excel can do much more specially with pivot tables and reports, but then I saw the rest of the features, like changing to Planning Mode to start adding Product Backlog Items, automatically doing the binding between product backlogs and sprint backlog items, searching, filtering and reporting and I have to say, this tool is something worth to try. So in two weeks I'll let you know more about this.

I'm still not sure about the pricing scheme and I'm a bit concern. At the moment is beta, and you can simply request a license, but it doesn't seem something that will remain free. I will need to consider if this is a tool that every developer on the team will be able to use.

Crispin Parker from Conchango published some useful webcasts and a post with more info on the product.

By the way, it would be great to get a surface to use this tool.

lunes, septiembre 15, 2008

Sydney ALT.NET Group

The newest user group in Sydney will have it's first meeting on September 30 at the Thoughtworks offices. Richard Banks published the agenda and details in the group's blog, but what exactly is an ALT.NET Group? Why do we need another one if we have generic groups like Sydeny's DNUG and RDN or technology specific groups like OzTFS and OzSilverlight? 

ALT for Alternative has caused a lot of controversy that lead to misunderstanding, so let's better start for what it's NOT, it's not the anti-microsoft group, its not the open source community tired of Java wanting to use something better (altough some of them might be part of the group), its not a group that loves NHibernate and hates Entity Framework.

Simply is a group of developers that like to look for better ways to do their work, keeping a "get things done" approach and commonly identified with agile practices, continuous improvement and the pragmatic thinking, people who "use what works while keeping an eye out for a better way".

If you feel identified with these ideas, come and join us or if you're not in Sydney, find an ALT.NET User Group or create a new one.

In our first meeting we will have talks about Ruby and Mocking.

Recommending reading/listening:

martes, septiembre 09, 2008

C# and more dynamic features (C# 4.0?)

static void Main(string[] args)
{
    dynamic
    {
        object myDynamicObject = GetDynamicObject();
        myDynamicObject.SomeMethod();         // call a method   
        myDynamicObject.someString = "value"; // Set a field
        myDynamicObject[0] = 25;              // Access an indexer
    }
}

How cool is it? I don’t know, probably will be something dangerous if not used with care, C# depend a lot of compile time checking.

To see more about this see Charlie Calvert’s Blog

martes, agosto 19, 2008

Cool Site with great controls, components and skins - www.wpfstyles.com

Logo If you haven't you gotta check www.wpfstyles.com by Andrew den Hertog. The just released site oriented to the dev community, is quickly becoming a great resources for controls, components and skins sharing for WPF and Silverlight. Go give it a try and if you have something, share it and if you need something, probably you will find it here. If you don't check it back later, the site is new and people is starting to publish content, so don't freak out if you don't see 1,000 controls yet.

Personal Note/Public Apology: There has been a while without a post, because I have been traveling a lot and didn't have Internet connection in several of those places. I just moved to another country and I'm still getting installed, but you can expect frequent posts again.

martes, agosto 05, 2008

Using the ASP.NET Providers from Silverlight - Membership, Roles and Profile

Brad Abrams wrote an excellent post about how to set everything in the server and client to consume this services. He covers for areas:

1. Login\Logout
2. Save personalization settings
3. Enable custom UI based on a user's role (for example, manager or employee)
4. A custom log-in control to make the UI a bit cleaner

These Services are simple wrappers to the actual providers and only provider the most common functions (i.e. Membership has login/logout, but not CreateUser), but would be pretty straightforward to extend them. If your application is not 100% SL and you have parts already build in ASP.NET you can easily combine them, for example, use the Login controls to Authenticate users, but use the Role Services to restrict certain functions depending on who is who.

sábado, agosto 02, 2008

Value Converters - More Simple Samples

This is the third of several posts related to Value Converters. Reading the posts in order can be useful, but not necessary. The first post, Databinding 101, served as an intro to the problem and the second, DefaultValueConverter, introduced the basics about ValueConverters. Now we're ready to present several examples to give you more ideas of where ValueConverters can be used.

 

ImageSourceConverter

The Image control doesn't update its Source property automatically, so setting it to a path will work only the first time, but if the path in your datasource changes it won't be reflected, well the ImageSourceConverter will help you. This is really a bug that will be corrected in SL RTM, but meanwhile this is another place to use ValueConverters.

public class ImageSourceConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
string path = (string)value;
return new BitmapImage(new Uri(path, UriKind.RelativeOrAbsolute));
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}


VisibilityConverter



You might want to change the visibility of a control based on a boolean property of your objects, this is simple with the VisibiltyConverter:



public class VisibilityConverter:IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if ((bool)value)
return Visibility.Visible;
return Visibility.Collapsed;
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}


StringFormatConverter



This is one of my favorites. ASP.NET and Winforms use a StringFormat that let you display properly numeric or date objects (use these cheat sheet as reference). With this converter for example you can simply pass the ConverterParameter of C to format a numeric value as currency and will work similar to the way it does in the mentioned platforms. This is another convertar that I feel should be part of the Binding object.



public class StringFormatConverter:IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
string formatString = parameter.ToString();
return String.Format("{0:" + formatString + "}", value);
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new InvalidOperationException("This Convert supports only OneWay binding");
}
}


StringFixedLengthConverter



For some controls you might want to specify a fixedlength for the text. You can do it with the StringFixedLengthConverter setting its ConverterParameter. This is rarely useful...



public class StringFixedLengthConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return GetFixedLengthText((string)value, int.Parse((string)parameter));
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}

private string GetFixedLengthText(string originalString, int maxChars)
{
int textLength = originalString.Length;
if (textLength > maxChars)
return originalString.Substring(0, maxChars - 3) + "...";
int padding = (int)Math.Round((maxChars - textLength) / 2d);
string paddingChars = "";
for (int i = 0; i < padding; i++)
paddingChars += " ";
return paddingChars + originalString + paddingChars;
}
}


IfNullChangeColorConverter



This is not common, but we had run into cases where we need to change the color of a control in case a property is null. This could be combined with the DefaultValueConverter presented yesterday. Imagine you will display a DefaultValue of 'Not Available' if the person doesn't have a phone number, but you also want to greyout the text to emphasize the lack of data. To create this effect, specify the desired color in the ConverterParameter (if no value is specify grey will be used).



public class IfNullChangeColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null)
return new SolidColorBrush(GetColor(parameter));
return new SolidColorBrush(Color.FromArgb(255, 0, 0, 0));
}

public Color GetColor(object parameter)
{
byte[] argbColor = new byte[4];
if (parameter != null)
{
string[] argbColorStrings = parameter.ToString().Split(',');
for (int i = 0; i < 4; i++)
{
argbColor[i] = byte.Parse(argbColorStrings[i]);
}
}
else
{
//#FFC0C0C0
argbColor[0] = 255;
argbColor[1] = 192;
argbColor[2] = 192;
argbColor[3] = 192;
}
return Color.FromArgb(argbColor[0], argbColor[1], argbColor[2], argbColor[3]);
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}


Creating ValueConverters is really easy and these examples are meant to show that, rather than to try to cover every scenario. However, ValueConverters have many drawbacks. You can't combine them (e.g. use StringFormat and DefaultValue for the same property because the binding object only allows one) and won't scale easily (you will end up with lots of classes for super simple scenarios). Tomorrow I will talk about a pattern that can overcome these drawbacks.



You can download the attached code here with the last examples and the classes presented here.


I format my code using Manoli's website


Don't forget to vote for your favorite topics for this column.

viernes, agosto 01, 2008

Professional Visual Studio 2008 for Sale Now.

As I mentioned before I was invited to write the chapters of Team System in the book Professional Visual Studio 2008, well the book is finally out now and you can get it in Amazon, Barnes & Noble or your favorite bookstore. This is the Table of Contents:

Table of Contents

Part I: Integrated Development Environment

Chapter 1: A Quick Tour
Chapter 2: The Solution Explorer, Toolbox, and Properties
Chapter 3: Options and Customizations
Chapter 4: Workspace Control
Chapter 5: Find and Replace, and Help

Part II: Getting Started

Chapter 6: Solutions, Projects, and Items
Chapter 7: Source Control
Chapter 8: Forms and Controls
Chapter 9: Documentation Using Comments and Sandcastle
Chapter 10: Project and Item Templates

Part III: Languages

Chapter 11: Generics, Nullable Types, Partial Types, and Methods
Chapter 12: Anonymous Types, Extension Methods, and Lambda Expressions
Chapter 13: Language-Specific Features
Chapter 14: The My Namespace
Chapter 15: The Languages Ecosystem

Part IV: Coding

Chapter 16: IntelliSense and Bookmarks
Chapter 17: Code Snippets and Refactoring
Chapter 18: Modeling with the Class Designer
Chapter 19: Server Explorer
Chapter 20: Unit Testing

Part V: Data

Chapter 21: DataSets and Data Binding
Chapter 22: Visual Database Tools
Chapter 23: Language Integrated Queries (LINQ)
Chapter 24: LINQ to XML
Chapter 25: LINQ to SQL and Entities
Chapter 26: Synchronization Services

Part VI: Security

Chapter 27: Security in the .NET Framework
Chapter 28: Cryptography
Chapter 29: Obfuscation
Chapter 30: Client Application Services
Chapter 31: Device Security Manager

Part VII: Platforms

Chapter 32: ASP.NET Web Applications
Chapter 33: Office Applications
Chapter 34: Mobile Applications
Chapter 35: WPF Applications
Chapter 36: WCF and WF Applications
Chapter 37: Next Generation Web: Silverlight and ASP.NET MVC

Part VIII: Configuration and Internationalization

Chapter 38: Configuration Files
Chapter 39: Connection Strings
Chapter 40: Resource Files

Part IX: Debugging

Chapter 41: Using the Debugging Windows
Chapter 42: Debugging with Breakpoints
Chapter 43: Creating Debug Proxies and Visualizers
Chapter 44: Debugging Web Applications
Chapter 45: Advanced Debugging Techniques

Part X: Build and Deployment

Chapter 46: Upgrading with Visual Studio 2008
Chapter 47: Build Customization
Chapter 48: Assembly Versioning and Signing
Chapter 49: ClickOnce and MSI Deployment
Chapter 50: Web and Mobile Application Deployment

Part XI: Automation

Chapter 51: The Automation Model
Chapter 52: Add-Ins
Chapter 53: Macros

Part XII: Visual Studio Team System

Chapter 54: VSTS: Architect Edition
Chapter 55: VSTS: Developer Edition
Chapter 56: VSTS: Tester Edition
Chapter 57: VSTS: Database Edition
Chapter 58: Team Foundation Server

I also had a chance to review a couple of chapters. Writing a book was a great experience and I hope you will enjoy the results.

As Dave Gardner mentioned there are books available for instructors from the publisher and other's through the books's page. Nick Randolph mentioned later than they will have books to give away in TechEd Australia and TechEd New Zealand.

Value Converters - Default Value Converter

This is the second of several posts related to Value Converters. Reading the posts in order can be useful, but not necessary. As we saw yesterday sometimes we need to specify a DefaultValue for cases where there's no value specified by our datasource. This is a look of the application with data, then without a phone number and the third pic shows how would it look with the DefaultValueConverter.

With data:

Without data:
image
Wit DefaultValueConverter:
image
The change in XAML is really simple, this is the original line:
<TextBlock Text='{Binding Mode=OneWay, Path=PhoneNumber}'/>
 
This is the modified line:

<TextBlock Text='{Binding Mode=OneWay, Path=PhoneNumber, ConverterParameter="[Not Available]", Converter={StaticResource DefaultValueConverter}}'/>

We also need to add a Resource that holds the reference to our DefaultValueConverter

<UserControl.Resources>
<SilverlightApplication14:DefaultValueConverter x:Key="DefaultValueConverter"/>
</UserControl.Resources>

We added two attributes to the Binding object, a ConverterParameter and a resource that will hold an instance of our ValueConverter. A ValueConverter is simply a class that implements IValueConverter and consists of two methods Convert and ConvertBack. ConvertBack is used with TwoWay BindingMode, but we won't use it here. The Convert method simply checks if the value is null and if it is, it returns the parameter which will hold the object specified in the ConverterParameter.

public class DefaultValueConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null)
return parameter;
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}

In WPF the Binding object has a DefaultValue property, so there's no need to create a ValueConverter there.


You can download the attached code here
I format my code using Manoli's website
Don't forget to vote for your favorite topics for this column.

miércoles, julio 30, 2008

Value Converters - Databinding 101

This is the first of several posts related to Value Converts. Trying to minimize the length of the posts I break it in 4 deliveries, but the first one will have to be an intro to databinding before I can get into Value Converters tomorrow.

Databinding is great and probably one of the best features in WPF and SL (I know I have said that before for others), well, it's great, but somehow inflexible as we will see tomorrow and Value Converters will add a bit of flexibility.

As with winforms or ASP.NET to do databinding we will need a DataSource. We will define our person class.

public class Person
{
public string Name { get; set; }
public string LastName { get; set; }
public string PhoneNumber { get; set; }
}



In our Codebehind we will add this to the DataContext property of the control

public partial class Page : UserControl
{

public Page()
{
InitializeComponent();
DataContext = new Person {Name = "Miguel", LastName = "Madero", PhoneNumber = "+52 (871) 123-4567"};
}
}

Obviously in a real example we won't hard code the values and instead get our data from a Service. Then in XAML we will define the controls that will be bound to our object. In this case we're using only textboxes inside inside a StackPanel.

<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" TextWrapping="Wrap"/>
<TextBlock Text="{Binding LastName}" TextWrapping="Wrap"/>
<TextBlock Text="{Binding PhoneNumber}" TextWrapping="Wrap"/>
</StackPanel>

That's it, super simple. There are obviously more complex examples, but I probably won't go there since other people have already have done a great job covering them, for example binding to a List Box (read Scott's post) or a DataGrid (all Scott Morris blog), or a step by step tutorial by Jesse Liberty who explains Binding objects, change notifications implenting INotifyPropertyChanged, Binding Modes (OneTime, OneWay, TwoWay). This is not an intro to databinding, rather an intro to Value Converters and why is it needed.


After a couple of modifications (see attached code) the page will look like this:


image

Everything looks as expected, so why would we need value converters. Imagines some people won't have phone numbers, we would be displaying a blank space, that might not be the desired experience. What if we want to show a default value like "Not available". Tomorrow we will see how to show default values using ValueConverters.


You can download the attached code here
I format my code using Manoli's website
Don't forget to vote for your favorite topics.

No More Need to Change Your URIs

It's a pain having to remember to edit your ServiceReferences.ClientConfig (the file with the service proxies configuration) or editing your code to point to another path when changing between developing, testing and production environments. Well, it's time to stop the pain:

   1:              Uri uri = HtmlPage.Document.DocumentUri;
2: return String.Format("{0}://{1}:{2}/", uri.Scheme, uri.Host, uri.Port);

It would be better to encapsulate this in a class:

   1:  public static class UriHelper
2: {
3: public static string GetHost()
4: {
5: if(!HtmlPage.IsEnabled) // Get design time URI
6: return http://localhost:1650/;
7: Uri uri = HtmlPage.Document.DocumentUri;
8: return String.Format("{0}://{1}:{2}/", uri.Scheme, uri.Host, uri.Port);
9: }
10: }

I suggest you to update your proxies, so instead of using the URL defined in your ServiceReferences file it will use the URI provided by your method:


   1:  public AuthenticationServiceClient()
2: : base("BasicHttpBinding_AuthenticationService", UriHelper.GetHost() + "B2B2/Cotizador/AuthenticationService.svc"){}


It will be useful for pictures too:

   1:              string uri = String.Format("{0}/Images/{1}.jpg", UriHelper.GetHost(), productId);
2: image.ImageSource = new BitmapImage(new Uri(uri, UriKind.RelativeOrAbsolute));

Hope this helps.
Don't forget to vote for your favorite topics.
I format my code using Manoli's website

martes, julio 29, 2008

Silverlight Tip of The Day - Vote for The Future Posts

Before I started writing this column, I began writing ideas for future posts and the list seems to grow faster than the daily frequency my posts have. So this is a list of posts in the queue, you can vote for them either by e-mail of leaving a comment.

Because of time constraints I have not been able to post some of the interesting topics.

  • Debugging Tips
  • Deploying
  • Cross Domain Calls
  • Problems Debugging
  • Recommendation of cool tools (for Dependency Injection, AOP, extensions, etc)
  • Model-View-ViewModel Pattern
  • Handling Image Paths
  • Using ASP.NET Providers (Membership, Roles, Profile)
  • Styles and Templates
    • Basics
    • Controls
    • Create a Clean Style for ListBox or ItemsControl
    • Change ListItemStyle
    • Blend and Styles
    • Blend and Templates
    • Visual State Manager
    • Visual State Manager and Blend
  • Blogs I read and cool links
  • Patterns for code reuse between Silverlight and .NET or .NET Compact Framework
  • Patterns for XAML code reuse between Silverlight and WPF
  • Silverlight Unit Testing
  • Test Code reuse
  • Refactoring your ASP.NET code to Silverligtht
  • Changing patterns from ASP.NET to Silverlight
  • Dummy Data and Better Design Experience (See controls with data in Blend)
  • Services and Security
  • Interoperability (JavaScript-.NET)
  • Caching and ClientSide Persistence
  • Silverlight Disconnected Client - Designing for Occasionally Disconnected Systems

Vote for your favorite topics, but remember, they might take a while to appear, If you want to learn a topic for today's project, probably this is not the place and you would be better off in the SL Forum, another blog or reading a book that gets you from a to z, but this can be an useful resource to learn SL a step a day or find some hidden tricks.

The idea of this column is it to be something simple and a quick daily read. Something won't take you more than 5 minutes (and that probably won't take me that much time to write either). When needed I will point you to other places to get deeper info, so open your favorite RSS reader and subscribe now and remember to vote through e-mail or leave a message for the topics you would like to read soon here.

lunes, julio 28, 2008

How to Update a TextBox Binding OnPropertyChanged

When using TwoWay Binding, most properties get updated after the control's property changes, but the Text in a TextBlock is a different case, it gets updated after the TextBox lost focus. It makes sense, since the value might be incomplete and validations and other logic triggered at the Business Object level unnecessarily, but sometimes this is not the desired behavior.

WPF has an UpdateSourceTrigger as part of the Binding object and you could say something like:

      <TextBox Text={Binding Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}>

This is not available in Silverlight, but there's a quick workaround provided by Yi-Lun Luo in this thread.

        private void cantidadTextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            otherControl.Focus();
            cantidadTextBox.Focus();
        }

It's really ugly, but works.

 

viernes, julio 25, 2008

Style Inspector

Go check it out, it's a cool tool from the Delay, the name is self explanatory and the tool is really easy to use so this post is one line long. Well an a screenshot.

SilverlightDefaultStyleBrowser sample image 

jueves, julio 24, 2008

Sniffers and Silverlight

It's very useful to know what Silverlight is doing behind the scenes, what is requesting, from which URI, what it sends and what was received. My preferred sniffer is Web Development Helper by Nikhil Kothari. The important part of this tools, related to SL is that you can see exactly what is happening at the network stack, but go try it out. It's probably not a tool you will use daily, but add it to your toolbox and keep it close to your hand.

The bar integrates nicely into IE, here we can see that it got my TestPage, the XAP Package, called a Service and then get several pictures and finally called another Service. This information is important, we can determine the order in which things are hapenning, if a Service is being called to much or if we probably misspelled some address (more on this tomorrow).

image

The filter option is really useful, we might not care about images and only want to look for URLs with a svc extension.

image

We can go deeper and see the exact content of each request/response. In the following image we see the Request Headers and the XML of the Response.

image

Today I only presented the Silverlight related features, but the Web Development Helper does a lot more stuff than just a simple HTTP Logger.

Tomorrow I will talk about how to get different URIs based on the original request's address. I am running out of topics. Please suggest and I will write.

miércoles, julio 23, 2008

Visual State Manager

The Visual State Manager allows us to define different states for our controls. Most controls in Silverlight already use this technology and we can change them editing their template. The best example is the button, the next picture shows its different VisualStateGroups and its VisualStates in Blend.

image

VSM its a big topic and I will get to it in better detail in another topic, but for now consider it as the way to decouple behavior and design. The creator of the control would typically define the states and its transitions in response to certain events, for example, when the mouse is over the programmer will change the state to MouseOver. The designer can use blend to change the look of each state and define transitions (animations) between them. To start with, you would typically change the defined states of some other people's controls, once you start doing your own controls you might want to expose States, to change between them in response to events, simply use the following method:

VisualStateManager.GoToState(myControl, "myNewState", true);

It's not available for WPF yet, but it will in a next update (probably in SP1).

For a complete tutorial go to http://www.nibblestutorials.net/ and look for the new Blend 2.5 tutorials or check this webpage for an example on how to change a button style for the MouseOver state.

viernes, julio 18, 2008

Silverlight's DropDownList

SL doesn't have a DropDownList. It will in a next release, but while this happen we had to write one ourselves. I tried different options from here and here. The first is a really simple control we used as a basis, the second one is a dll with a lot of control, I only tried the ddl and have to say it had a couple of bugs, didn't worked as expected, specially with databinding.

Get the source code and tests. This is not a complete, fully functional, tested, component, it's simply an easy to use, composite control. The test suite only met what we needed and there might be a lot of uncovered scenarios. Anyway, you can either use it as it is, improve it to meet your need or simply as a rough example on how to do composite controls.

This control has a TextBlock and a Listbox. The listbox is collapsed and it contains the items of the ddl, when the TextBlock is clicked the listbox becomes visible and when the mouse leaves the listBox it's collapsed again. To use it, you can bind something to the control's DataContext and you're done. This will work for the default scenario where you just need to display text for each item and update the text in the TextBlock. The control doesnt support templates, and this is an enhancement you could easily made, simply exposing the listbox templates so you could change, for example, how each item is displayed and databound.

I left my post about the Visual State Manager for tomorrow since I have been asked for the ddl sample in this thread and by e-mail.

 

Professional Visual Studio 2008 is almost

 

In March of this year, Nick Randolph invited me as a guest author of Professional Visual Studio 2008 from Wrox. I wrote only 5 chapters, all about Team System (Server, Dev, Tester, Architect and DB Pro), it was tough, but was a great experience. I thought writing a few pages of topics I know would be easier, but being the first time I write something formal and amongst other projects, courses and all the VISA paperwork for Australia it was hard to get the time. Writing at 2:00 am was fun, more than correcting the mistakes the next morning. I'm really glad Nick invited me.

We are getting closer to its release date (July 28th). You can preorder it now on Amazon, read the table of contents or read more about this on a post from Dave Gardner or visit the book's webpage. I hope you like it. 

Use VisualTreeHelper to Navigate Through Objects Hierarchy - Part 2

Yesterday I wrote about the VisualTreeHelper class, today, I will present a class with extension methods useful to search for objects in a more convenient way. You can download the code here.

It's a static class with extension methods like GetChild, GetChildrenCount and GetParent, similar to the VisualTreeHelper methods, but cleaner to use. Compare:

VisualTreeHelper.GetChild(myControl, 0);

myControl.GetChild(0);

Ok, it's cleaner, but really doesn't add much value, but what about getting an Item by name instead of only by index (as provided by the VisualTreeHelper method):

myControl.GetChild("childrenName");

Or better yet doing recursive searches through all the object hierarchy:

myControl.GetChild("childrenName", true);

Methods like that would make scenarios like the one presented yesterday really easy to solve, for example to get an Item of a ListBox using VisualTreeHelper you would have to do something like this:

DependencyObject grid = VisualTreeHelper.GetChild(listBox, 0);
DependencyObject stack = VisualTreeHelper.GetChild(grid,0);
DependencyObject scrollViewer= VisualTreeHelper.GetChild(stack, 0);
DependencyObject scrollPresenter = VisualTreeHelper.GetChild(scrollViewer,0);
DependencyObject border= VisualTreeHelper.GetChild(scrollPresenter ,0);
DependencyObject grid2 = VisualTreeHelper.GetChild(border,0);
DependencyObject etc = VisualTreeHelper.GetChild(grid2, 0);
DependencyObject itemIReallyCareAbout = VisualTreeHelper.GetChild(etc,1);

Using extension methods you could nest calls and made it a bit simpler in one line of code, but not necessarily simpler.

//       Grid,          Stack,       ScrollViewer,ScrollPresenter,Border,Grid,etc,etc, MyItem
listBox.GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(0).GetChild(1);

Not only that looks horrible, but the worst part is than if the designer decides to change the ItesmPanel or the ListBox Template, you would probably have to change your code, with recursive searches you would simply do something like:

listBox.GetChild("innerControlName", true);

Another useful method is GetChildren wich return an IEnumerable<DependencyObject>.

Tomorrow I will talk about the Visual State Manager.

miércoles, julio 16, 2008

Use VisualTreeHelper to Navigate through Objects Hierarchy - Part 1

In many scenarios we will require to get to the inner elements of our UserControl. The first option is to define x:Name attributes in XAML or use the FindName. But in scenarios where the hierarchy is created dynamically either through code or databinding this wont work. The VisualTreeHelper will allow us to get to the Childrens of an element.

A common scenarios is how to get to the rendered elements of a ListBox. Since Silverlight is datacentric instead of control centric, the Items collection will return the actual DataSource and not the controls as the GridView would in Web. For most scenarios databinding would do the trick, but imagine if you need to change the color of a TextBox inside a ListBoxItem or if you have nested ListBoxes and you need to iterate all the ListBoxes and get the value of their InnerListBoxe's SelectedItem. Well for this and other scenarios you can use VisualTreeHelper its a static class with many straightforward methods that receive a depencency object.

public static class VisualTreeHelper
{
// Methods
public static DependencyObject GetChild(DependencyObject reference, int childIndex);
public static int GetChildrenCount(DependencyObject reference);
public static DependencyObject GetParent(DependencyObject reference);
}


Tomorrow I will talk about how I created a simpler API using extension method and a bit of LINQ.



viernes, julio 11, 2008

Download Silverlight Applications from WebServers

This is something really easy to do, but can be confusing. Keep in mind SL will be run at the client and all your server needs to do is serve the package. The .xap file generated when you compile your application is nothing but a zip file. Some servers won't allow users to download content with a XAP (or unknown) extension, so an easy trick is to simply rename it to .zip.

For more information you can check this website

Tomorrow I will post about changing URLs between different webserver/deployment scenarios.

 

miércoles, julio 09, 2008

Open in Full XAML View

The XAML designer in VS 2008 is terrible, is not even as a XAML Pad tool because its slower. There's blend doing a great job, even if it were only for previews because it interprets the attributes of the desigener Namespace (xmlns:d="http://schemas.microsoft.com/expression/blend/2008") like d:DesignWidth="800" d:DesignHeight="80"  to set a Width and Height for design time. Well to the point in VS 2008 you will mainly work in XAML View, there VS is better than blend because of the intellisense, XML formatting and event handler generation, but it takes time to open the file and then switch. To set it as the default view go to Tool/Options/TextEditor/XAML/Miscellaneous and check the option "Always open documents in full XAML view".

image

This is the first post of a series, look for the Silverlight tip of the day tag in this blog for similar articles.

 

Silverlight Tip of The Day

Silverlight tip of the day is a new 'column' I'll be writing as a part of this blog. Simply look for the tag 'Silverlight tip of the Day'. I will try to do it daily, brief and to the point. It could be an useful resource for any SL developer.

jueves, julio 03, 2008

Contribupendence Day

El día de hoy se celebra el contribupendence day. Medio irónico el nombre y el hecho de que sea un día antes del Independence Day en Estados Unidos, pero el concepto es interesante. Definido por Jeffrey Blankenburg en este post.

Consiste en escribir recomendaciones o comentarios en alguna de las redes sociales o profesionales a 5 personas con las que hayan trabajado. Yo no soy muy fan de las redes sociales, sólo uso Facebook, así que ahí es donde dejaré mis comentarios.

Si leen este post hoy, ojala alcancen a dejar sus comentarios. Si ya lo ven otro día, ya paso y tendrán que esperar al próximo anio, ya que este tipo de recomendaciones no se pueden hacer cualquier día. Bueno por ser el primer anio pueden dejarlos un poco después.

sábado, junio 28, 2008

Más de Silverlight Unit Testing - Asynchronous Tests

Ya había mencionado un post a la introducción de Jeff Wilcox a la herramienta escrita por el mismo y la actualización a SL Beta 2 y los templates tanto de proyecto como para las Clases de Prueba. Después de usarlo me he topado con varios know issues, que esperamos se arreglen para cuando liberen Silverlight 2.0, pero ningún showstopper. Todo correo muy bien y las pruebas hechas con TFS, escritas para los objetos de negocio o para WPF son fáciles de migrar.

Dada la frecuencia en que tenemos tareas Asincronas en SL, necesitamos también soporte para poder probar estas. Un ejemplo tipíco es un WebRequest. En este caso lo veremos para un Servicio Web para el cual ya previamente agregamos la referencia. Este es el code snippet que les servirá para darse una idea de como crear este tipo de pruebas.

[TestClass]
public class ServiceClientTest:SilverlightTest{
   [TestMethod]
   [Asynchronous]
   public void GetTest()
   {
      ServiceClient client = new ServiceClient();
      client.GetCompleted += client_GetCompleted;
      client.GetAsync();
   }

   void client_GetCompleted(object sender, GetCompletedEventArgs e)
   {
      // Do something with e.Result;
      // Call this when done
      this.TestComplete();
   }
}

Decoramos con TestClass y TestMethod como en todas nuestras pruebas, pero agregamos el atributo Asynchronous a nuestro TestMethod. Esto hará que el framework se quede esperando a que otros threads terminen su chamba. Así que no tendremos que detener nuestro TestMethod y esperar a que nuestro webService obtenga una respuesta y lidiar con la sincronización. En algún momento se deberá mandar llamar a nuestro metodo client_GetCompleted y ahí haremos los asserts necesarios con el resultado. Al final, para indicarle al Testing Harness que ya terminamos debemos de llamar el metodo TestComplete. Si no hacemos esto, nuestra prueba se colgara. En caso de que exista alguna excepción y nuestro handler nunca se mande llamar, el framework se dará cuenta y marcará la prueba como fallada. Justo como se espera, funciona bien y es realmente simple.

Espero y les resulte útil.

Algo adicional que quisieran tomar en cuenta es que si van a mandar llamar a un WS desde SL tendrán problemas por Cross Domain Calls. Por más que configuren su servidor correctamente con el ClienteAccessPolicy.xml correcto va a fallar ya que por default las pruebas corren directamente sobre un archivo y no sobre un WebSite. Lo recomendable es en su website agregar una referencia a su proyecto de pruebas para que corran en el mismo contexto o al menos dentro de un WebServer de tal forma que pueda hacer Cross Domain Calls.

miércoles, junio 25, 2008

Como ver el Código Generado de LINQ to SQL en el Output de Visual Studio

Justo lo que estaba buscando o pensando hacer para poder depurar fácilmente lo que está pasando detrás de LINQ ya lo escribio Kris Vandermotten. En una aplicación de consola haríamos algo como:

context.Log = Console.Out;

En una aplicación de otro tipo, no tenemos hacía donde escriba el Log de LINQ to SQL. Con el código de Kris, simplemente diríamos,

context.Log = new DebuggerWriter();

Así que vayan y bajen su clase de su blog

Por cierto, odio LINQ to SQL y no puedo esperar a LINQ to Entities para usar nuevamente un ORM de verdad. Aunque tampoco puedo usar el Beta 1 de SP1 en este proyecto, así que me quede con mi disen~o bizarro por un momento. Más de esto en un próximo post.

lunes, junio 23, 2008

Siliverlight 2.0 Beta 2

En mi último post olvide uno de los links seguramente más importantes, sobre todo si tienen ya una aplicación en Beta 1.Seguramente tendrán algunos problemas al compilar para el Beta 2. Les sugiero ver las página de las diferencias y buscar los cambios. Por ejemplo a mi me salía el error 'System.Windows.Media.Animation.Storyboard' does not contain a definition for 'GetClockState', simplemente busque en ese docucmento GetClockState y decía "Storyboard.GetClockState has been changed to GetCurrentState", cambie el metodo y listo, he seguido los mismos pasos por cada error y en cuestión de minutos tengo migrados proyectos de Beta 1 a Beta 2. Uno de los que no me aparecio es un cambio en el ResourceDictionary.Add que ahora espera un parametro más, fuera de ese todos los cambios necesarios para la migración los he podido hacer con apoyo de esa página.

Espero que la migración de Beta 2 al release sea al menos así de simple. Finalmente este producto ya tiene una licencia GoLive desde el Beta 1, lo que básicamente significa que podemos poner las aplicaciones de Beta 2 en producción y la migración para nuestros usuarios será sencilla. No necesariamente significa que no abrá cambios en el API, pero seguramente serán minímos y Microsoft proveerá un documento con guías de como migrar.

Algo de lo que se esperá para el release, entre otras tantas cosas, es un control dropdownlist/combobox. De momento no lo tenemos, pero puede ser indispensable para muchas aplicaciones que quisieramos poner en producción aprovechando el GoLive License. Yo hice un control, es algo muy básico, pero funciona bien. Posiblemente en un próximo post ponga el código. Si alguien lo necesita dejeme un mensaje.

domingo, junio 15, 2008

Silverlight 2 Beta 2, .NET 3.5 Beta SP1 y SQL Server RC0

Microsoft recien libero Silverlight 2 Beta 2, .NET 3.5 Beta SP1 y SQL Server RC 0. Aquí les dejo los links importantes para que descarguen todo y se pongan a probar el nuevo software.

Silverlight

Les sugiero visitar los links en el orden que los pongo, igual para la instalación.

  1. Anuncio de Scott Guthrie con detalles de la liberacion de SL2
  2. GetStarted con Silverlight 2
  3. SP1 Beta para VS 2008 y .NET 3.5 detalles aquí, (instalación opcional)
  4. Tools para VS 2008
  5. Blend 2.5 June 2008
  6. Deep Composer (opcional)
  7. Unit Testing para SL 2 Beta 2

Van a encontrar más en el post de Scott, pero les resumo lo que me parece más importante.

  • Integración de controles al download de SL2 (ayudando a reducir el tamaño de tus .xap).
  • Soporte en Blend para editar Templates de Controles. Esto es una gran ventaja para diseñadores, ya que antes tenían que codificar mucho XAML.
  • Visual State Manager (VSM), sirve para controlar y definir templates para los diferentes estados de los controles y realiza también transiciones entre estos estados por nosotros. Por ejemplo un botón presenta un cambio en su template entre el estado normal y mouseover o pressed. Se cuenta con gran soporte de parte de blend para diseñar o modificar cada state, similar a como hacen los objetos en flash :)
  • Incluye un nuevo Visual Tree Helper para buscar los elementos, navegar entre padres e hijos.
  • Los que tengan aplicaciones que usen video, se beneficiaran del Adaptive Streaming, que en base al hardware y bandwidth del cliente descargará un contenido distinto.
  • Diferentes mejoras en el área de red, harán de SL un ambiente de programación más flexible. Por ejemplo, Duplex Communication permitirá que el servidor envíe información al cliente. Por otro lado el soportte para crear Proxies, obtener recursos de REST URIs o consumir servicios de JSON nos darán aún mayores opciones para interactuar con servers de una manera simple.

SP1 Beta para VS 2008

Este release incluye bastantes mejoras al framework recientemente liberado. No hay que olvidar que es un beta, sin embargo, tengo que agregar que funciona muy bien y la tecnología que estan integrando en este SP1 tiene ya mucho tiempo desarrollandose, inclusive antes de liberar el .NET Framework 3.5 y ha llegado a un punto de madurez en el que ya vale la pena meterse más a fondo a lo que viene, especialmente el MVC (más de esto luego).

Para información detallada pueden leer el post de Scott Guthrie y descargarlo de aca. Algo de lo más sobresaliente a notar (al menos para mi) es:

  • C# ahora te muestra errores semanticos tan pronto como los escribas, en lugar de esperar a que compiles
  • El tan esperado EntityFramework, digamos LINQ to SQL para aplicaciones complejas, un ORM de verdad.
  • MVC Framework, el nuevo paradigma de desarrollo web para ASP.NET (más info luego).
  • ADO.NET Data Services (Astoria) es una librería que permite facilmente ofrecer y consumir servicios tipo REST, basandonos en un DataContext
  • Un Routing Engine, usado en el MVC framework y ADO.NET Data Services (Astoria) para tener links bonitos como miweb.com/products/categories/beverages en lugar de links feos como miweb.com/ListaProductos.aspx?listBy=category&category=beverages
  • Performance Improvements para VS 2008, que realmente ya estan cubiertos por este HotFix desde Febrero.
  • Client-only Framework subset, nos permite desarrollar una aplicación de escritorio que se enfoque a un subset del framework, de tal forma que nuestros usuarios no tengan que instalar el framework completo (sin ASP.NET y otras cosas que no necesitan). Las aplicaciones desarrolladas para este subset correran de la misma forma en el framework completo. Básicamente hicieron un installer más pequeño que te instala los assemblies más comunes para el escritorio y en VS 2008 restrigen tus referencias a sólo esos para garantizar que tu app pueda correr en la versión reducida.
  • Mejoras a WPF en performance, data, nuevos efectos e Interoperabilidad con Direct3d.
MVC

Es la manera en que Ruby on Rails y muchos otros frameworks trabajan actualmente. Sin caer en polemica respecto a cual será mejor, tengo que decir que a mi me gusta mucho el estilo MVC ya que creo que provee una importante separación de responsabilidades y nos deja con un diseño más limpio, sin embargo el estilo de ASP.NET de siempre, seguirá siendo una buena opción, sobre todo para aplicación más simples donde consideren que no valga el esfuerzo adicional (principalmente el capacitar a la gente). Espero en otro post poderme extender más en el tema de MVC.

SQL Server 2008 RC0

Ya liberaron el primer RC del nuevo motor de Base de Datos de Microsoft. Lo malo es que esta version (RC0) esta disponible solo para socios de Technet, puedes ver más info aquí o si eres socio ir a descargarlo, de lo contrario esperar al RC1.

martes, abril 08, 2008

Unit Testing Silverlight Applications

Jeff Wilcox publico un artículo respecto usar su Test Harness para Silverlight. Resulta bastante sencillo, pude migrar una serie de pruebas unitarias que corrían en el escritorio y correrlas desde un Silverlight Library sin problemas. Es bastante simple.

  1. Baja del código de los controles del MIX
  2. Buscar los siguientes dlls y copialos al folder del SDK  %Program Files%\Microsoft SDKs\Silverlight\v2.0\Libraries\Client
    • Microsoft.Silverlight.Testing
    • Microsoft.Silverlight.Testing.Framework
    • Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight
  3. Descarga los templates de proyecto y clase de pruebas y copialos los paths de templates de VS.
    • %userprofile%\Documents\Visual Studio 2008\Templates\ProjectTemplates
    • %userprofile%\Documents\Visual Studio 2008\Templates\ItemTemplates
  4. Agrega un Test Project a tu Silverlight Application o Library.
  5. Agrega una referencia de tu app o librería a tu proyecto de pruebas.
  6. Pon tu proyecto de pruebas como Startup Project y listo. F5 y estarás corriendo tus pruebas.

El hacer las pruebas es muy similar a las que ya conocen, mismos atributos como ExpectedException, TestMethod, etc. Hasta el momento yo sólo he probado presenters y cuestiones del modelo incluyendo conexiones a WebServices desde Silverlight, abstrayendo el uso de la interfaz de usuario, sin embargo, podemos crear pruebas para interfaz de usuario. Para más información vean el post de Jeff.

Algo que lamentamos no tener actualmente es la integración con Visual Studio y Team Foundation Server, para poder organizar nuestras pruebas en Test Lists y ver los resultados en nuestro Test Result Window y desde ahí levantar bugs o mejor aún el integrarlo con nuestro servidor de Builds. Jeff comento que pronto publicara respecto a esto ultimo.

lunes, abril 07, 2008

Zoom It para Presentaciones

Hace mucho en algun show Scott Hanselman recomendo Zoom It de SysInternals para hacer las presentaciones. Nunca la había usado, pero en la ultima platica realmente me ayudo bastante, pude mostrar cosas que antes solo mencionaba. Por más que tenía una resolución chica y VS con letra grande, había algunas áreas que no se alcanzaban a apreciar como los menús o barras de herramienta.

Con zoom-it corriendo en el background, simplemente presionas Ctrl-1, toma un screenshot y le hace zoom hacía donde tengas el mouse, luego puedes hacer zoom in/out con el scroll y te mueves con el mouse. Trae otras opciones como para dibujar, pero me parecieron medio extrañas de usar. Al principio se puede sentir medio raro, pero una vez que agarras algo de practica es muy útil. Les sugiero ensayar su uso antes de su presentación.

Links:

Zoom It

SysInternals

Les recomiendo bajar toda la Suite de SysInternals ya que trae muchas otras cosas utiles como el Process Explorer.

Hace poco Jaime Sanchez subio un articulo muy bueno respecto a como hacer Demos WOW.

domingo, marzo 09, 2008

Silverlight 1.0 for Mobile

Una gran noticia es que Silverligth estará disponible para Mobile Devices, hay un par de sesiones en MiX 08 que hablan de esto. Lamentablemente no tengo los links directos, pero los pueden buscar facilmente. Hay empresas que ya han desarrollado algunas aplicaciones con esta nueva tecnología. Una de ellas es Stimulant que desarrollaron una aplicación para redes sociales (más). La aplicación de WeatherBug es otro ejemplo.

Otra de las buenas noticias es que no esta limitado a Windows Mobile, sino que se agregará soporte para Nokia. Según algunas de las presentaciones de Mix 08 más adelante existirá soporte para otros dispositivos, posiblemente el IPhone dependiendo del esquema que Apple use para su SDK.

Para darle un espacio especial a esta versión, crearon una subsección espacial dentro del sitio de silverlight.net dedicada a Silverlight 1.0 for Mobile