Rob Relyea

xaml:Blog

November 2005 - Posts

  • IronPython and WPF

    Filed under:

    Glad to find a nice link to a great demo of IronPython from Jim Hugunin.

    In version 1 of WPF, we chose to not enable scripting scenarios, but instead require you to compile any code.  At least that is what we thought...the demo shows:

    "interactive exploration and GUI building from a command prompt as well as simple embedding as a scripting language in an existing Windows Presentation Foundation application."

    It even shows loading some UI using XAML from IronPython code.

    Love it!

    -Rob

    PostTypeIcon
    4,511 Views
  • Does WPF focus too much on markup scenarios?

    Filed under: ,

    Charles Petzold asks if we are deliberately or accidentally making code-based scenarios difficult.  He sums it up well with the title of the piece: "XAML Rules (but Code Suffers)".

    Thanks Charles for raising this issue.  I'll make sure the right dev team sees the feedback.

     

    Please let us know other scenarios that are difficult from code.  We haven't found them all, but want to hear...many of these decisions are not deliberate.


    We still have some constructs that the XAML parser uses that don't help us make sure we build well designed objects.

    As I said back in October 2004:

    For a long time, we've relied on IAddChild and let component authors decide what their ContentProperty was.  We're hoping to decorate types with that information and remove IAddChild from Avalon.

    We are now finally in the middle of trying to do that change.  We are making the parser stop calling IAddChild.  An example of fixes that we need to do to help make this possible:

    1. Make Grid stop supporting RowDefinition/ColumnDefinition as direct children of Grid.
    2. Make sure we decorate the appropriate ContentPropertyAttribute for all classes.  For example, Panel will have [ContentProperty("Children")]
    3. Make sure collections support IList.  For example, UIElementCollection will get an IList mechanism.

    So instead of having IAddChild implemented on Panel, we added the ContentProperty attribute to that class.  We then make sure the collection that is returned by that property supports IList.

    We are finding and fixing a bunch of issues including incompletely designed classes where problems where hidden by the reliance on IAddChild...

    In the public builds you may not be able to wean yourself from IAddChild yet...perhaps due to blocking bugs...but you should try.  I'll eventually publish more details in this area...let me know if you are blocked by any lack of info here...

    PostTypeIcon
    12,876 Views
  • November 2005 CTP of WinFX is released. Works on Final .Net Framework 2.0 and with Final VS 2005!

    Filed under:

    The much anticipated release of our November 2005 CTP of WinFX is here.
    See Tom Archer's announcement with pointers to the installs.
    Karsten also posts some good information about the release.

    This is the last time you'll need to uninstall/clean your machine of  .Net Framework 2.0 and VS 2005 betas.

    Woo Hoo!

    PostTypeIcon
    3,940 Views
  • WPF and Rich Content Model

    Filed under:

    Doing my feedster search for WPF, I found a post where Aaron was excited about embedding a combo box inside a textbox.  He has a picture of it in action.

    One key developer benefit of WPF is that you can easily embed almost any control inside of another.  Checkbox inside of a Menu, yep.  ComboBox inside of a RichTextBox, yep.  etc...

    How substantial a capability is this for you?  What scenarios does it enable that you are excited about?

     

     

    (I'm trying a new setting for this post...syndicating an excerpt...)

    PostTypeIcon
    4,153 Views
  • Databinding + Datavisualization Demo with WPF/XAML/VB

    Filed under: , ,

    Many people say that Databinding is one of the more impactful of the features in WPF.
    Namita wrote a great set of demos for her PDC talk about Databinding with WPF.

    As part of a few talks (some VB customers, a Vista + WPF talk, a talk at the Borland Developer Conference), I used that demo.

    I've finally gotten around to posting my version of it.

    Here is a screen shot of the auction window:

    If you click on the Map button in bottom left of that, a nice data visualization example is shown using a custom tree map control that I believe Kevin Moore wrote:

     

    The app has a good separation between the data and the UI...

    The items on the left of the auction window are just renderings for each AuctionItem in a listbox.

    From Window1.xaml:

    <ListBox ItemsSource="{Binding Path=.}"
         LayoutTransform="scale .7 .7"
         Grid.Column="0"
         Name="itemDisplay"
         />

    The rendering for each auction item is controlled by a data template that was specified in myapp.xaml declaratively.

    <DataTemplate DataType="{x:Type local:AuctionItem}" >
       <Viewbox>
        <Grid  Margin="0" Width="250" Height="200">
         <Grid.LayoutTransform>
          <ScaleTransform ScaleX="1.5" ScaleY="1.5"/>
         </Grid.LayoutTransform>
         <!-- image element -->
         <Ellipse
          Width="200"
          HorizontalAlignment="Right"
             Margin="10"
             >
          <Ellipse.Fill>
           <Binding Path="RemainingSeconds">
            <Binding.Converter>
             <local:ColorDateConverter/>
            </Binding.Converter>
           </Binding>
          </Ellipse.Fill>
         </Ellipse>
         
         <Border HorizontalAlignment="Center" VerticalAlignment="Center"             
          Padding="4" Margin="30" BorderBrush="#D2CFCF"
          BorderThickness="1" Background="White">
          <Image>
           <Image.Source>
            <Binding Path="Image"/>
           </Image.Source>

          </Image>
         </Border>


         <Viewbox Height="80" Width="80" Margin="10"
            HorizontalAlignment="Right"
            VerticalAlignment="Center"
            >
          <!-- clock background -->
          <Grid>
           <Ellipse Width="100" Height="100" Margin="4"
            HorizontalAlignment="right"
            VerticalAlignment="bottom">
            <Ellipse.Fill>
             <Binding Path="RemainingSeconds">
              <Binding.Converter>
               <local:ColorDateConverter/>
              </Binding.Converter>
             </Binding>
            </Ellipse.Fill>
           </Ellipse>

     


           <!-- time remaining Days text -->

           <TextBlock
            FontSize="40px"
            TextAlignment="Center"
            Width="100"
            HorizontalAlignment="right"
            FontFamily="Segoe"
            Foreground="#5B5C59"  
            VerticalAlignment="Bottom"
            Height="80" 
            Text="{Binding Path=RemainingSeconds}"/>


           <TextBlock FontSize="10px" Foreground="#AAFFFFFF" Height="36"
            HorizontalAlignment="right" FontFamily="Segoe"
            VerticalAlignment="Bottom"
             TextAlignment="Center" Width="100"   Text="SECONDS" />

     

           <!-- hour hand -->
           <Canvas  HorizontalAlignment="Right"
            VerticalAlignment="Bottom" Height="100" Width="100">


            <Line StrokeThickness="3pt"  Stroke="#6FFFFFFF"
           X1="50" Y1="50" >
             <Line.Y2>
              <MultiBinding>
               <MultiBinding.Converter>
                <local:PosYConverter/>
               </MultiBinding.Converter>
               <Binding Path="RemainingSeconds"/>
               <Binding Path="StartDate"/>
              </MultiBinding>
             </Line.Y2>
             <Line.X2>
              <MultiBinding>
               <MultiBinding.Converter>
                <local:PosXConverter/>
               </MultiBinding.Converter>
               <Binding Path="RemainingSeconds"/>
               <Binding Path="StartDate"/>
              </MultiBinding>
             </Line.X2>
            </Line>

            <Ellipse Width="10" Height="10"
                Canvas.Top="45" Canvas.Left="45"
                Fill="#6FFFFFFF" />


           </Canvas>

     

           <!-- Clock chrome -->

           <Ellipse Width="100" Height="100" HorizontalAlignment="right" Margin="4"
            VerticalAlignment="bottom"
            RenderTransform="scale 1 -1 translate 0 57" >
            <Ellipse.Fill>
             <RadialGradientBrush Center="0.5,0.1" RadiusX="1.5" >
              <RadialGradientBrush.GradientStops>
               <GradientStopCollection>
                <GradientStop Offset="0" Color="#AAFFFFFF" />
                <GradientStop Offset="0.18" Color="Transparent" />
               </GradientStopCollection>
              </RadialGradientBrush.GradientStops>
             </RadialGradientBrush>
            </Ellipse.Fill>
           </Ellipse>

           <Ellipse Width="100" Height="100"
            HorizontalAlignment="right"  Margin="4"
            VerticalAlignment="bottom" RenderTransform="scale 1 -1 translate 0 120" >
            <Ellipse.Fill>
             <RadialGradientBrush Center="0.5,0.2" RadiusX="1.2" >
              <RadialGradientBrush.GradientStops>
               <GradientStopCollection>
                <GradientStop Offset="0" Color="#66FFFFFF" />
                <GradientStop Offset="0.35" Color="Transparent" />
               </GradientStopCollection>
              </RadialGradientBrush.GradientStops>
             </RadialGradientBrush>
            </Ellipse.Fill>
           </Ellipse>
           <Ellipse Width="100" Height="100"
            HorizontalAlignment="right"
            VerticalAlignment="bottom"  Margin="4"
            Stroke="VerticalGradient #66FFFFFF #44FFFFFF" StrokeThickness="1.5" />
           <Ellipse Width="102" Height="102"
            HorizontalAlignment="Right"
            VerticalAlignment="Bottom"  Margin="4"
            Stroke="VerticalGradient #11000000 #33000000"  StrokeThickness="1.5"  RenderTransform="translate 1 1" />
          </Grid>
         </Viewbox>


         </Grid>
       </Viewbox>
      </DataTemplate>

    Dig into the demo and go watch Namita's pdc talk!

    Please let us know what you think.

    PostTypeIcon
    24,508 Views
  • Job search brought me to Microsoft R+D

    I ran across a blog post complaining about the http://microsoft.com/jobs site.  I found it because my feedster search for WinFX found it.

    I commented on his blog, he used my Contact link to email me, and I just fired off an email that might be useful by others?  (of course, now that I start to post it, I spend more time on it...)

    Todd said that he was thinking more about the advice I had left in my comment of his original blog:

    "My tip: figure out the set of products or problems that you are passionate about and look for jobs on those teams. (As you mention, it isn’t always easy to map from a product to the job listings…)"

    He said:

    "...when your passion is developing any and all software and you're relatively open minded around what you want to work on, you're bound to get a lot of results. I was just hoping that there was an easier way to narrow down my search results."

    I replied:

    Groups are going to think you are more attractive if you have more background, expertise or passion in their area. You know about their product, you have ideas on what they do well and what they can do better, etc...

    I had similar problems when I got my first Redmond based job at Microsoft...

    After college (B.S. '93 Computer Science at Michigan) I started off as a Systems Engineer in the Microsoft field (worked in the Chicago Office.) I was lucky to be in the first round of hiring that Microsoft had ever done out of college for that position. That position is now called Technical Specialist. I worked with a variety of customers and on a variety of technologies. I built a great set of skills dealing with customers, public speaking, and learning many technologies.

    Although I knew a good amount about a lot of things, I wanted to get closer to product development.  I had a bunch of exposure to Program Managers...and I yearned for a role like that.  I wanted to be the absolute expert in an area.  I wanted to help build great products. I didn't exactly know which group to go after.  I decided to start with Visual Studio as I was very interested in developer technologies.

    2 interviews in the Visual Studio group didn't pan out - the product manager interview said I was too technical...the program manager interview said I was too marketing.  :-)

    I realized I had to do some more preparation.  My coding skills were 5 years rusty, so I went online, did a few C++ projects from a Computer Science class at some school, and re-read a few books about COM/OLE2.  That preparation sharpened my skills for the next job I would go after.

    I understand Todd's frustration with the job site.  Back in 1998, I wrote a tool to keep track of jobs posted in an access database, because the internal online system was inadequate.

    I rolled up my sleeves and continue my search for a great role for me.  I found two great jobs where I had strong knowledge and passion:

    • program manager in the COM group
    • program manager in the IE group

    In my Systems Engineer role, I had become an Internet Specialist.  At the time, I was giving 3 hour training sessions to midwest developers about DHTML, IIS programming, MTS and more.  Both areas excited me...and I was fairly deep in both areas.

    I pursued both of those jobs and ended up getting an offer from both groups.

    I chose the IE job...and spent 1998-2001 working on DHTML in IE5 - IE6.  I've been working on the Windows Presentation Foundation ("Avalon") ever since then.  I love buidling software.  I love working with a bunch of hard working, brilliant people.  I love working at Microsoft.

    Some lessons I took away:

    • Do soul searching as part of any job search.  What do you want out of your job?  What are you passionate about?
    • Learn from failures, don't give up.
    • If you don't have all the right skills, go find roles where you can grow in that area.  Or go polish your skills on the side.
    • Follow your passion.

    Good Luck!

    PostTypeIcon
    8,224 Views
  • Many manifestos about URLs since 1999

    As part of my thinking about Urls, I dug a bit more into Url Rewriting as a way to have nice URLs.

    More Details on Good Urls

    I found a good summary of the issues and solutions here: next generation urls.

    It included a list of other articles on the subject dating back to 1999:

    Numerous articles have been written about the need for clean URLs. A few of the more prominent ones are cited here.

    It summarizes:

    At this point, the main thing standing in the way of the adoption of next generation URLs is the simple fact that so few developers know they are possible, while some who do are too comfortable with the status quo to explore them in earnest. This is a pity, because while these improved URLs may not be the mythical URN-style keyword always promised to be just around the corner, they can substantially improve the Web experience for both users and developers alike in the long run.

    Searched for the term Url Rewriting and found this: Ryan Farley about Url rewriting in ASP.NET
    Url Rewriting is possible in several ways with ASP.NET, but should it be that hard??

    Ryan points to Scott Watermasysk's comments about Url Rewriting not being that important.  Some of his blog comments don't agree with him.

     

    Will another Url Manifesto help?

    Given all this writing about this topic for the past 6 years, how come it hasn't gotten easier in that time?  If you use normal authoring tools and normal web servers, you still have to do a bunch of work to make this work.  Unless we make it the default experience, users won't get good urls.

    I need to think if adding another manifesto to this space will even have an impact.  Lots of people have been writing about what should be done, about how to go do it.

    Or is it that URLs don't matter that much?

     

    How to make better progress?

    It appears that nobody has tried to fix this by fixing the web servers, authoring tools, etc...

    Microsoft could invest a bit across many of its products to make big improvements in this space.

    What could Authoring Tools (Frontpage, Office, VS, etc...) do better?
    What could Windows do better?
    What could Web Infrastructure (IIS, IE, etc...) do better?

    As always, there are tons of things that those teams need to focus on.  Tons of priorities.

     

    Many ways to influence teams at Microsoft

    As one voice among many, how should a Microsoft employee influence other teams at Microsoft?
    How does one of our customers influence teams at Microsoft?

    I believe it depends on the number of teams you want to influence.  This problem likely takes effort from many...

     

    Would I be more effective working internally over email and through meetings, or via a blog and manifesto?
    Are you most effective asking management to say something is important, or working individually with teams?

    Is it worth my energy?

    PostTypeIcon
    3,103 Views
  • E-Manuals could make consumers happier

    Early this morning, I'm spending a little time organizing my home office.

    There is so much paper, so much to manage.  Many things can improve this...I'm going to focus this quick post on consumer product manuals.

    This is yet another post that related to the ideas brewing in my head for a url manifesto.

    My New LCD TV
    I bought a new TV recently for use in my office.  I unpacked it a few weeks ago.
    Now, I need to figure out what to do with the manuals, warrantees, etc... that came with it.

    Documents that came with it
    Television Users Guide
    Manuel D'Instructions (french version of Users Guide, i now realize that this tv was meant for distribution in Canada...not sure how I ended up with it).
    Warranty
    Warnings sheet - warning you not to scrape your belt buckle on the screen as you unload the box.
    Product Registration Card

    Things I could see Improving
    Documents that might be worth saving should have an electronic version available on the net.
    Manuals should have their digital location url listed on the back cover.
    In my case, I'd love to see something like: Electronic Version: jvc.com/TVManual-LT-26X776
    I would generally ditch the paper version, and download the electronic version.  It is easier to store, find, etc...

    Guidelines:
    Printed documents/manuals should generally also be available on the net.
    Printed documents should indicate (in a standard way) the url of this document.
    The Url for a document should be a simple, descriptive, unique, longlasting url.

    Issues
    How do you deal with the different language versions of a manual?
    A) encode it in the URL
    B) make the URL provide links to all the language versions
    C) detect the users language at the URL and redirect to the right document

    What format do you publish the document in?
    PDF, HTML, Word, etc...
    Many choose PDF today...When Windows Vista ships, XPS (Xml Paper Specification) and WPF flow documents are 2 new options to consider.

    PostTypeIcon
    3,007 Views