Vince Blasberg's Blog

<a href="http://weblogs.asp.net/blogs/vblasberg/vblasberg"> <img src="http://weblogs.asp.net/blogs/vblasberg/VinceBlasberg.jpg" border="0"></a>&nbsp;<font face="Calibri" size="3" color="#FFFFCC" style="color: #FFFFFF; font-weight: bold; font-size: 14pt">SQL, WCF, WPF, TFS, CLR and other TLA's</font>

  • I Have a Blog!!!!

    Sure I have a blog, but all of my time is spent working on cool work or contributing to the Dallas XAML User Group.  I write the newsletters and maintain everything including the momentum, hopefully.

  • Windows Phone Mango Release - Finally Upgraded

    After several attempts, I finally got my Windows Phone 7 updated to the Mango release.  It kept failing and reported an error C1010007.  That error indicates that the cable is bad or not the original cable.  I finally tried again and kept touching the phone every minute or two.  The upgrade continued and finally finished.  I suspect the phone goes to sleep during the upgrade. 

  • The .Net Micro Framework Event in Dallas

    This is a mention of the event that came and went last weekend for the .Net Micro Framework here in Dallas at the Improving Enterprises offices.  Shawn Weisfeld worked on the event for the last 6 months.  Shawn pushed the moderately priced package from FEZ that proved to be an excellent product.  We all met last Saturday and went through some exercises to understand how to develop most of the basic tasks to interact with the plug and play hardware.  When the day was over, we all had a great understanding of how to create .Net application with Visual Studio 2010 and deploy to this device.  It's so much easier than the Windows CE deployments. 

  • Containing Silverlight Lists and DataGrids in the Browser Window

    In a typical Silverlight line-of-business application we have Lists, Grids, DataGrids, and StackPanels.  We populate a list and it flows down and off the browser page.  When we have a ScrollViewer, it will scroll the whole page including edit controls and graphics and not just the list that's tall and flowing off the page.  The good news is that we can easily contain the list in the viewable area with the few simple steps listed below.

    1. Remove the ScrollViewer from the page if it exists.
    2. Contain all upper area graphics and edit controls in a RowDefinitions of explicit size or Auto.
    3. Contain the lower List(s) in a final Grid RowDefinition with the Star notation to fill the remainder of the window using the outer-most Grid as a parent container.
    4. Optionally specify for the List properties,  VerticalAlignment="Top" and VerticalContentAlignment="Stretch".  Otherwise the List and its borders will stretch to the bottom of the screen even if it has no items.  Either way may be preferred. 

    The following screen shots demonstrate this with a simple GridSplitter to size either side.  Notice the List on the left is using two rows compared to the list on the right.  The list on the right isn’t flowing to the bottom and uses only one row.  Both lists flow to the bottom of the browser window and no further, regardless of the number of items.

    XAML rocks
    .
    -Vince


    Runtime:

      

    Designer:

      

     

    XAML:

        <Grid x:Name="LayoutRoot"
              Background="#FFCEA1A1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="50" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <sdk:Label Content="List 1"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       FontSize="16"
                       FontWeight="Bold" />
            <sdk:Label Grid.Column="2"
                       Content="List 2"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       FontSize="16"
                       FontWeight="Bold" />
            <ListBox Grid.Row="1"
                     Grid.RowSpan="2"
                     Name="listBox1"
                     Margin="10" />
            <sdk:GridSplitter Grid.Row="1"
                              Grid.Column="1"
                              Width="10"
                              HorizontalAlignment="Stretch"
                              Grid.RowSpan="2" />
            <ListBox Grid.Row="2"
                     Grid.Column="2"
                     Name="listBox2"
                     Margin="10"
                     VerticalAlignment="Top"
                     VerticalContentAlignment="Stretch" />
            <sdk:Label Grid.Row="1"
                       Grid.Column="2"
                       Content="(Edit Controls)"
                       FontSize="16"
                       FontWeight="Bold"
                       HorizontalAlignment="Center" />
        </Grid>
    </UserControl> 


    Code-Behind:

    private void MainPage_Loaded(object sender, RoutedEventArgs e)
    {
        listBox1.Items.Clear();
        listBox2.Items.Clear();

        for (int i = 1; i <= 100; i++)
        {
            string listItem = "List Item " + i.ToString();

            listBox1.Items.Add(listItem);
            listBox2.Items.Add(listItem);
        }
    }

     

     

  • Dallas GiveCamp 2011

    Dallas GiveCamp came and went this last weekend.  It was my second GiveCamp and was very rewarding.  Our team created a site for the Tarrant County Birth Network.  Jon and I quickly explained the resulting web site and sat down, but I forgot to present and thank the team.  So this is a very weak attempt to thank them after the event.

    Thanks to the Dallas GiveCamp team for a fun weekend.

    • Jonathan Keith - Developer
    • Nick Coombs - Developer
    • Rick Michaels – Developer
    • Sridhar – Very helpful floating developer
    • Shannon Blackwell - The very active charity representative
    • Jaime Grassi - Business Analyst
    • Vince Blasberg (myself) – Developer

    The GiveCamp weekend was very unusual, thankfully.  There were many challenges from the first moment until the last.  In the end we at least accomplished one big thing.  We enabled the charity with a CMS that will grow as their needs grow.  They now have a huge network of .Net developers around the world that can easily develop and support them.  When they switch over to the new site, there is no doubt the requirements document will grow and there will be developers like our team to help them.

    What is the Tarrant County Birth Network?
    http://tcbirthnetwork.org/
    The Tarrant County Birth Network is a community organization to provide information about, and advocacy for evidence-based, Mother-Friendly care for expectant Tarrant County families seeking a healthy, informed, and enjoyable pregnancy and birth.

    What is GiveCamp
    http://dallasgivecamp.org/
    GiveCamp is a weekend-long event where software developers, designers, and database administrators donate their time to create custom software for non-profit organizations.

    I hope to see everyone there next year.

    -Vince

  • Videos from My Past Presentations

    Shawn Weisfeld has recorded several presentations that I've been fortunate enough to present at various times.  Shawn also stalks other active community speakers with that camera of his.  Check out the complete list on the INETA Champs live site at http://newlive.ineta.org/.  That's more than enough video content to fill a Saturday night or skip the Monday night football.


    Here is a list of my presentations at http://newlive.ineta.org/Presentation/Speaker/26

     

    Nuts and Bolts in XAML Part 1 - 7/6/2010
    http://newlive.ineta.org/Presentation/ViewVideo/110


    Nuts and Bolts in XAML Part 2 - 8/3/2010
    http://newlive.ineta.org/Presentation/ViewVideo/122


    Working with Data in Silverlight - 6/18/2010
    http://newlive.ineta.org/Presentation/ViewVideo/106


    Understanding Databinding with XAML in WPF and Silverlight - 3-2-2010
    http://newlive.ineta.org/Presentation/ViewVideo/36
    http://newlive.ineta.org/Presentation/ViewVideo/37
    http://newlive.ineta.org/Presentation/ViewVideo/38

  • RIA Services - Solutions to 'The remote server returned an error: NotFound'

    Isn't it great when the answers are out there?  I finally got a Google hint and overcame this one.  So here are a few reasons that I encountered and overcame this error.  We can easily reproduce (and often fix) this error.  This occurs on the asynchronous return from a Silverlight 4 to RIA services.  It's as if for any of the few reasons it fails, the call just gets aborted and we get a head-scratching "Not Found".  We can sometimes even hit a debugger breakpoint in the Domain Service that gets the IQueryable call and wonder why the server appears to work in the debugger.

    Here are a few suggestions to help.

    1. Returning too much data for the object graph.  Solution: Edit the 'maxItemsInObjectGraph' setting in the web.config.
    2. Throwing an unhandled error on the service logic.  It can't get back to the client.  Solution: Comment out logic and see if the call succeeds.
    3. Solution: Only enable Anonymous authentication.  The request can then avoid authentication errors and possibly return successfully.  This one got me again tonight when deployed a new client’s project for the first time.  It also confused several of us at the Dallas Silverlight and WP7 DevCamp that I mentored at the other day.   The project will work great in the local development server but when deployed to IIS, we get a Not Found error.  So try disabling the Forms and Basic Authentication with only Anonymous enabled.  I'm convinced that this is the most likely reason for most people.

    Hope this helps others with this unintuitive error message....Hopefully it's "Now Found".

    -Vince