Spaghetti Code: Becoming an Entrepreneur with Scott Davis and Jeff Pesek

6/1/2010 9:01:39 AM

Spaghetti Code talks with Scott Davis and Jeff Pesek about becoming your own business person.  We cover everything for the types of businesses you can establish, what you can “sell”, how to get started, and much more.

  • Direct Download - click here
  • Subscribe - click here
  • iTunes - click here

  • Tags:

    SpaghettiCode

    Windows Phone 7 April CTP and TransitioningContentControl

    5/20/2010 1:50:00 PM

    In my original screencast (read here or on Channel 9), I showed you how to use the Silverlight Toolkit’s TransitioningContentControl to add automatic transitions between pages of your Windows Phone 7 Silverlight application.  A few days after recording and posting that screencast, Microsoft released an updated version of the tools and the emulator.  Soon after, I started to get reports from folks watching my screencast that the TransitioningContentControl not only didn’t work with the April CTP release, but it prevented their entire application from running.

    Bummer! ;-)  I started to dig into it, and it “appears” that the TransitioningContentControl is suffering from the bug talked about here.  I say it “appears” to be related to that because the symptoms are the same, but unfortunately, the provided fix does not work on the System.Windows.Controls.Layout.Toolkit assembly that is created by building the Silverlight Toolkit.  I think it has something to do with the fact that the System.Windows.Controls.Layout.Toolkit project uses the output of several other projects, which are probably signed as well.  I am not sure how that propagates into the final assembly, but the Powershell script does not fix things.

    To solve the problem, I just went “brute force” and added the necessary source files from the TransitioningContentControl project to my own project and called it good.  A better step would have been to break that source out into its own project and create an unsigned assembly containing just the TCC that I could then reuse between Windows Phone projects, but I am assuming at this point that whatever the bug is (signed assembly or other), will be fixed in a future release.  In the interim, this get the job done.

    Watch the short video (5 minutes) to see how to get things set up.  Skip to the 2:30 mark if you want to get right to the step required to add TCC directly to your project.

    Download source here

    Tags:

    Screencasts | Windows Phone

    Spaghetti Code Podcast: Windows Phone 7 with Adam Grocholski

    5/17/2010 9:00:52 AM

    Spaghetti Code talks with Adam Grocholski about Developing on Windows Phone 7 using Silverlight.

     

  • Direct Download - click here
  • Subscribe - click here
  • iTunes - click here
  • Tags:

    SpaghettiCode | Headlines | Windows Phone

    Windows Phone 7 Presentation and Sample Code

    5/14/2010 11:18:45 AM

    I’ve been doing a lot of Windows Phone 7 presentations lately, and have finally gotten around to posting my slides and demo code.  Hit these links for your downloading pleasure…

    Tags:

    Headlines | Windows Phone

    Do You Run Your Dev Environment Using Boot to VHD

    4/27/2010 11:20:51 PM

    I am sure many of you have heard of Boot to VHD using Windows 7 and/or Windows Server 2008 R2.  If not, check out this Bing search for reference material.  The resource I have yet to stumble across is the best way to set up your environment if you want to take advantage of this great technology.  How big should my VHD be?  Should I have a base image and the diff VHDs for different environments?  Is there an optimal way to configure Windows 7 and Office to maximize performance and productivity?  What’s the best way to setup my machine if I have an SSD?  The list goes on….

    I have my own ideas, and I have solicited input from some of the local Microsoft Hyper-V wonks for their insights, but I still feel like I am walking in the woods alone.  Anyone have any insights, experiences, recommendations?  If so, drop me an email or post a comment.  I’ll collect the info and publish what we come up with.  Eventually, maybe a Wiki or something…

    Tags:

    Slick Thoughts | Azure

    Simplifying Page Transitions in Windows Phone 7 Silverlight Applications

    4/26/2010 1:33:00 PM

    Screencast of this article is available:

    Source code of sample application download here.

    If you have played around with Silverlight on Windows Phone 7, one thing you may have tried to figure out is how to add nice transitions between different pages of your application.  By default, Windows Phone page transitions really aren’t transitions at all.  The new PhoneNavigationPage is just popped into the root PhoneNavigationFrame.  Effective, yes. Cool, certainly not.  Face it, modern mobile applications need to not only be functional, but also stylish.  Simple “snap” transitions just don’t cut it.

    The most common solution to this problem is to use brute force and manage the transitions yourself.  You commonly see a “pattern” used in WP7 apps where events in your current page launch a Storyboard animation.  When that animation is complete, the actual navigation to the new page is invoked and the new page then runs its own Storyboard once it is loaded.  It looks something like this…

    // CURRENT PAGE
           private void CurrentPage_Click(object sender, EventArgs e)
           {
               SomeStoryboard.Completed += new EventHandler(SomeStoryboard_Completed);
               SomeStoryboard.Begin();                       
           }
    
           void SomeStoryboard_Completed(object sender, EventArgs e)
           {
               NavigationService.Navigate(new Uri("/Favorites", UriKind.Relative)); 
           }

    // NEWPAGE
    protected override void OnNavigatedTo(Microsoft.Phone.Navigation.PhoneNavigationEventArgs e)
    {
        base.OnNavigatedTo(e);
    
        SomeNewStoryboard.Begin();
    }

    It’s a straightforward solution, and if your app only has a few pages, it works just fine.  If you have lots of pages in your application, however, it becomes quite tedious and hard to maintain.

    A better solution can be found by turning to the Silverlight Toolkit.  The great thing about having Silverlight on WP7 is that you can leverage many existing Silverlight assets.  In this case, we will leverage the TransitioningContentControl from the Toolkit.  The TransitioningContentControl was created to solve the same problem we are facing for traditional navigation-based Silverlight application.

    To get started, download the Silverlight Toolkit from CodePlex. Once installed, you will need to add the System.Windows.Controls.Layout.Toolkit assembly to your WP7 project.

    If you are not familiar with the TransitioningContentControl, its a fairly simple control.  The TCC is comprised of two ContentPresenters – current and previous.  When you update the Content property of the TCC, it will take the content of the CurrentContentPresenter (if present) and move it to the PreviousContentPresenter.  The new content is loaded into the CurrentContentPresenter.  The TCC, however, manages the visibility of the previous and Current ContentPresenters so that the “old” content is visible and the “new” content is hidden.  It then uses a Storyboard that is defined as part of the TCC’s VisualStateManager to transition from the “old” content to the “new” content.  If you are not familiar with Storyboards, the Visual State Manager, or other designer-type topics, have no fear.  The TCC comes with a set of standard transitions that you can use out of the box.

    Getting the TCC to work with our WP7 app is a simple process.  First, we need to modify the ControlTemplate for our PhoneNavigationFrame to use the TCC.  By doing so, we automatically enable transitions between any PhoneNavigationPages we add to our app.  To change the PhoneNavigationFrame, open the App.xaml file.  First, add a couple of namespaces to our xaml:

        xmlns:layout="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
        xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    

    Now, modify the PhoneNavigationFrame as shown below:

            <phoneNavigation:PhoneApplicationFrame x:Name="RootFrame" Source="/MainPage.xaml">
                <phoneNavigation:PhoneApplicationFrame.Template>
                    <ControlTemplate>
                        <layout:TransitioningContentControl Content="{TemplateBinding Content}" Style="{StaticResource TransitioningStyle}"/>
                    </ControlTemplate>
                </phoneNavigation:PhoneApplicationFrame.Template>
            </phoneNavigation:PhoneApplicationFrame>
    

     

    The TCC has its Style property set to a StaticResource.  This Style provides the default transitions and is also where you would add your own VisualStates and Storyboards if you would like to add custom transitions.  This Style can be found in the Silverlight Toolkit in the TCC Sample Application, or you can get it from the sample WP7 application linked to this article.  The Style is long so I won’t show the entire thing here, but the first parts of the Style are below to give an idea of what the Style contains and how it is used by the TCC.

      <Style x:Key="TransitioningStyle" TargetType="layout:TransitioningContentControl">
                <Setter Property="Transition" Value="DefaultTransition" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="layout:TransitioningContentControl">
                            <Border Background="{TemplateBinding Background}" 
                                    BorderBrush="{TemplateBinding BorderBrush}" 
                                    BorderThickness="{TemplateBinding BorderThickness}" 
                                    CornerRadius="2">
                                <vsm:VisualStateManager.VisualStateGroups>
                                    <vsm:VisualStateGroup x:Name="PresentationStates">
                                        <vsm:VisualState x:Name="DefaultTransition">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                                                               Storyboard.TargetName="CurrentContentPresentationSite" 
                                                                               Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                                    <SplineDoubleKeyFrame KeyTime="00:00:02.300" Value="1" />
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                                                               Storyboard.TargetName="PreviousContentPresentationSite" 
                                                                               Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                                    <SplineDoubleKeyFrame KeyTime="00:00:02.300" Value="0" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
                                        <vsm:VisualState x:Name="Normal">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" 
                                                                               Storyboard.TargetName="PreviousContentPresentationSite" 
                                                                               Storyboard.TargetProperty="(UIElement.Visibility)">
                                                    <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <Visibility>
                                                                Collapsed
                                                            </Visibility>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
    

     

    I won’t break the Style down in detail, but I’ll point a couple of highlights.  First, the Transition property is set to the VisualState that you would like to use as the transition between pages.  Every transition will use this VisualState storyboard.  The DefaultTransition VisualState is an example of how Storyboards are constructed for use in a transition.  As you can see, each Storyboard must target both the CurrentContentPresentationSite and the PreviousContentPresentationSite (these are the ContentPresenters discussed earlier).  You can target more than one property if you like.  Below is a custom transition that can be found in my sample app that both rotates the projection plane and the opacity of the ContentPresenters.

    <vsm:VisualState x:Name="SwingTransition">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" 
                                                                               Storyboard.TargetName="PreviousContentPresentationSite">
                                                    <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="90"/>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" 
                                                                               Storyboard.TargetName="PreviousContentPresentationSite">
                                                    <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0"/>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimation Duration="0" To="0" 
                                                                 Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" 
                                                                 Storyboard.TargetName="PreviousContentPresentationSite" />
                                                <DoubleAnimation Duration="0" To="1" 
                                                                 Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" 
                                                                 Storyboard.TargetName="CurrentContentPresentationSite" />
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" 
                                                                               Storyboard.TargetName="CurrentContentPresentationSite">
                                                    <EasingDoubleKeyFrame KeyTime="0" Value="90"/>
                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0"/>
                                                </DoubleAnimationUsingKeyFrames>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" 
                                                                               Storyboard.TargetName="CurrentContentPresentationSite">
                                                    <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="1"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </vsm:VisualState>
    

     

    That’s it.  You now have transitions any time you Navigate to a new PhoneNavigationPage

    Tags:

    Screencasts | Windows Phone

    Spaghetti Code Podcast: Recapping the MIX Conference

    4/2/2010 11:06:00 AM

    Spaghetti Code is joined by Mike Hodnic, Jason Bock, Adam Grocholski and Chris Williams to share their thoughts and impressions from the Microsoft MIX

    Conference and their thoughts on Windows Phone, Silverlight 4, and more.

  • Direct Download - click here
  • Subscribe - click here
  • iTunes - click here

     

  • Tags:

    eReader Fence Sitting…

    3/8/2010 12:47:13 PM

    I have been tempted to go the eReader route lately, but have found myself unable to pull the trigger.  Between the Kindle, Nook, and Sony eReader you would think I would be able to settle on a device and join the rest of the happy tech masses in the eBook revolution. I just can’t, however.  Each device has a limitation.

    I think the Kindle is the leader of all the devices right now. In my limited research, it appears to have the best online selection of books, and Amazon beats B&N on eBook pricing in a lot of cases.  So why not the Kindle? No WiFi in the device.  I just can’t bring myself to buy a device that does not have WiFi built-in.  I know it has free 3G, but you KNOW at some point there will be a version of Kindle with WiFi, and I don’t want to be suffering from buyer’s remorse later for a feature I think is a no-brainer today.  I’m pretty sure it doesn’t support some of the open ePub formats either.

    The Nook is a nice device.  It seems a bit slower than the Kindle, but not a lot.  It feels a lot heavier, but it only an ounce heavier so not sure what my deal is there.  But, B&N has a smaller selection of eBooks right now (I have found several titles on Amazon but not on B&N) and they do charge more often enough that I am left wondering WTF.  I thought the color screen was a nice touch, but its input is just slow enough that I know it would drive me nuts.

    Lastly, there is  the Sony eReader.  Whatever…. it is a very nice device.  In some ways, I like it better than the other devices, but it has a limited book catalog as well and it just feels like an “outlier” device.  That could be a very bad perception on my part, but this whole thing is about perception so it is what it is.  Impulse buys like this are often made or broken on perceptions. Throw in the fact that it is the least connected of the three devices and that is uses those God awful Sony memory sticks (get on board with microSD, morons!) and its a non-starter.

    I’m left feeling that I will have to just sit on the sidelines for another 12 months or so and see what the next generation of devices yields.  It would be nice to have a true “all in one” reader and web browsing device. That would be awesome.  I still worry about the comfort of the form factor.  Books just seem to be a fit for reading anywhere.  Hard for me to picture holding a thin eReader in my dimly lit bedroom while propped up by a pillow reading one of these devices.  But I do like not lugging multiple books around on trips and being able to change the font type and size.

    Oh well… T-minus 12 months and counting…

    Tags:

    Slick Thoughts

    Next Generation Testing with Visual Studio 2010 Road Show

    3/3/2010 9:28:50 AM

    Get a sneak peek at some of the new capabilities in Microsoft® Visual Studio® 2010, a landmark release of the premier development and testing toolset for Windows®, Web and Cloud development. 
    Microsoft has made significant investments to improve the Testing/QA tools in Visual Studio 2010.  The Next Generation Testing Event is your exclusive opportunity to experience the incredible power and capabilities these new tools bring to the QA and testing process.  At this event, you’ll get a comprehensive overview, as well as a deep dive, into the range of new tools and how they can enable you to improve the way you develop and test software on the Microsoft platform. 
    This will be an invaluable opportunity to learn how to take software development to the next level with Visual Studio 2010’s new testing features

    Event Agenda

    Topic

    Registration, Welcome, Food Served

    30 min.

    The QA Challenge

    30 min.

    Taking Testing to a New Level

    3 hours

    Making it Real

    30 min.

    Prize Drawing

    15 min.


    clip_image001Date

    clip_image001[1]Location

    Event ID

    3/3

    Nashville

    1032441936

    3/3

    Houston

    1032441938

    3/4

    Cincinnati

    1032441934

    3/12

    Bloomington

    1032442187

    3/12

    Southfield

    1032441932

    3/15

    Milwaukee

    1032441929

    3/15

    St. Louis

    1032441930

    3/15

    Columbus

    1032442186

    3/16

    Kansas City

    1032441931

    3/16

    Cleveland

    1032441933

    3/18

    Indianapolis

    1032441928

    4/13

    Chicago

    1032442250

    Tags:

    Headlines

    Spaghetti Code Podcast: The State of IronPython and IronRuby with Jimmy Schementi

    3/1/2010 8:25:00 AM

    Spaghetti Code is joined by Microsoft’s own Jimmy Schementi.  Jimmy is the Program Manager for the various Iron languages being worked on by Microsoft.  In this episode, Jimmy walks us through the history of the Dynamic Language Runtime and the Iron languages, along with numerous insights into both languages.  We also talk about where the languages are going as we approach some major milestones in each languages development. 

  • Direct Download - click here
  • Subscribe - click here
  • iTunes - click here
  • Tags:

    SpaghettiCode

    Powered by BlogEngine.NET 1.6.0.0
    Theme by Mads Kristensen

    About the author

    Jeff Brand Jeff Brand

    This is the personal web site of Jeff Brand, self-proclaimed .NET Sex Symbol and All-Around Good guy. Content from my presentations, blog, and links to other useful .NET information can all be found here.

    E-mail me Send mail


    Calendar

    <<  September 2010  >>
    MoTuWeThFrSaSu
    303112345
    6789101112
    13141516171819
    20212223242526
    27282930123
    45678910

    View posts in large calendar

    My Twitter Updates

    XBOX
    Live

    Recent comments

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2010

    Sign in