MIX’09 – Reviewing – Building Microsoft Silverlight Controls

Karen Corby – Lead Program Manager on Silverlight Team – http://scorbs.com/work

“One major difference between site with a strong Brand Image … and one with weak Brand Image … is that brand positioning permeates every part of a strong site …” – Forrester, June 9, 2005

  1. Styling
    • “Property Bag” styling
    • Through the <Style> element
    • Works with Controls , UserControls, Shapes, Panels
    • App.xaml now support the MergedResourceDictionaries functionality like in WPF
      • <ResourceDictionary.MergedDictionaries>
        • <ResourceDictionary Source=”Assets.xaml”/>
      • </ResourceDictionary.MergedDictionaries>
    • Styles now support BasedOn
      • <Style x:Key=”NewStyle” BasedOn=”{StaticResource BaseStyle}”>
  2. Skinning
    • Completely replace visuals
    • Through <ControlTemplate> element
    • {TemplaceBinding} extension
    • Works with Custom Controls (not UserControls, Panels, Shapes)
    • Based on a well defined separation with: (same way as in Silverlight 2.0)
      • Control Logic
      • Control Visuals
    • Parts and States Model
      • Goals:
        • Make it easy to skin your control
        • Defined separation between logic and visuals
        • Explicit control contract
      • Parts:
        • Names element (x:Name) in Template
        • Why is it needed to be a named element? Because, code manipulates element in same way.
      • States:
        • Visual look of control in a particular state
        • Thought <VisualState> element
        • Not all ControlTemplates need a Visual State
      • StateGroups:
        • Set of mutually exclusive states
        • Different state groups are orthogonal
        • Though the <VisualStateGroup> element
      • Using States and Transitions
        • VisualStateManager.VisualStateGroups
          • Attached Properties on root visual of ControlTemplate
        • VisualStateGroup
          • Contains group of related states
        • VisualState class
          • Contains storyboard that represents visual look
        • VisualTransition class
          • Contains duration for automatic transition animations
          • Contains storyboard for explicit transition animations
          • Default, or “To/From” transitions
          • GeneratedEasingFunction that is part of Silverlight 3 and that make it easy to define how an animation will work without the need to a storyboard
  3. Data Binding
    • Validation and Binding
      • Flags we need to enable
        • NotifyOnValidationErrors
        • ValidatesOnExceptions
      • Bindings
        • RelativeSource Binding was included
          • Self & TemplatedParent as source
          • Power of full binding in Templates
            • Attached DP sources, converters, two-way, etc.
        • DependecyProperties as Sources for Bindings
          • Update based on DP changes
      • Out-of-the-Box controls with Validation enabled
        • TextBox
        • CheckBox
        • RadioButton
        • ComboBox
        • ListBox
        • PasswordBox
          • Currently isn’t bindable but it will be in the SL 3.0 RTW
    • Binding and Styles
      • ElementName binding
        • “UI to UI binding”
        • FrameworkElement can be used as a binding Source
      • The Styles can now be changed in runtime
        • the “write once” style limitation was removed in SL 3.0
    • Silverlight Styling vs WPF Styling
      • Currently not supported in SL 3.0
        • Implicit Styles
          • A workaround was used in the Silverlight Toolkit
        • Dynamic Resources
        • Triggers
          • Blend’s Behaviors
  4. Custom Controls
    • Based on Control class
    • Add the Control Contract in the Control Logic Class
      • TemplateVisualState elements
      • TemplatePart elements
    • Generic.xaml
      • Specific element and it must be placed inside a folder named themes on your project
      • Needs to be placed as a Resource on the project
    • Define the DefaultStyleKey property
      • Informs the element that it should go to the generic.xaml to get the default style
    • “Look-less” by default
    • Silverlight and WPF Skinning Model
      • Same Model
  5. From Silverlight to WPF
    • Viewbox in Silverlight is part of the Toolkit and in WPF is part of the core runtime
    • VSM in WPF is part of the WPF Toolkit and in Silverlight is in the core runtime – Will be part of the core runtime of WPF in the next version
    • EasingFunctions are part of the Silverlight core runtime and will only be part of the next version of WPF
  6. Layout
    • Custom Panels
    • In Silverlight is two pass algorithm
      • Measure
        • Check How much space do you need
      • Arrange
        • Having the space needed arrange your elements inside it

   One more very interesting talk about Silverlight in MIX’09 and that showed up some very important new features in terms of Styling, Skinning and Custom Control definition.

Topics about ”Simple Architectures for Complex Enterprises”

Based on ArCast.TV Session and the Roger Sessions Book named “Simple Architectures for Complex Enterprises”

  When I started viewing this ArCast was because this is a very interesting topic and because normally what people tend to have as Enterprise Architects are very complex Architectures and problems and so my goal was to find how can we simplify these architectures in order to best achieve our goals. And so the most interesting topics i took from this talk were the following:

  • Enterprise Architects should focus on Simplicity because this is the key characteristic that we should strive for and is more important that Security, Performance, Scalability and all others elements. And when we get simplicity the others will also happen and without it we can’t achieve any of these elements.
    • Personal Note: Ok this is right because because whenever we start to build an enterprise architecture the first thing that comes to our minds is really the Security, the Performance, the Scalability, the Reliability of the system and so on, and we tend to forget that the simplicity is important or else we’ll have a very complete architecture but that is very difficult or impossible to put in practice due to the values involved or simply because of the complexity involved, and so this is important and something we should strived to achieve.

 

  • It’s very important that the Business and the IT are aligned because otherwise we will end up with different systems from the ones that were asked, and by doing so we won’t solve our problems.
    • Personal Notes
      • This is what normally happens with IT, instead of Business looking at IT as a way to facilitate the achievement of the Business goals, they sometimes look at it the other way around and this brings huge problems to this relationship between Business and IT, that should always be aligned to achieve the proposed goals.
      • Let’s just think about SaaS – Software as a Service for a second and try to see if this shows anything about this point:
        • Who normally choose SaaS solutions? Business People
        • Why? Because they are easy and simple to use and payed-as-you-go
        • For example: SalesForce.com used a lot of these issues between Business and IT because normally the Business People would ask for a CRM for the company and a lot of complexity would come from the IT department saying that they needed to have machines, a complex architecture, a ton of things and then the Business People one day at home would start using SalesForce.com and would bring it to their teams, and after that the IT Department wouldn’t have anything more to say about the subject. Of course that the Cloud Computing part also has a high role in this possibility, but if we try to simplify things maybe this alignment between Business and IT will became easier.

 

  •   Complexity is a Key issue and is linearly increase to the TCO (Total Cost of Ownership) but not with functionality because in that issue is logarithmic increased since if we are adding twice the functionality what happens is that the complexity grows exponentially and not only in a 1-to-1 basis. In Enterprises the functionality is logarithmically related with TCO.
    • Personal Note: Normally this is true because if we double the complexity we are doubling the TCO, but if we just enter a functionality we can be making our complexity grow a lot more.

 

  • In order to make solutions simpler is not necessary to remove functionality but just reorganizing the process, because by partitioning things became easier and better manageable. But the problem is that functionality in a Business system is not easy and so this is where the partitioning of functionalities become important.
    • Personal Note: Of course this is important that’s why we hear the Metaphor about “cutting the Elephant into small pieces”. (No disrespect for the animal of course)

 

  • How to take the Simplicity approach to the Enterprise:
    • The recommended approach is SIP – Simple Iterative Partitions.

 

  • How to approach the Business with the concept of Simplicity and using SIP to implement it.
    • First sell the complexity message
    • Normally complexity doesn’t enter in discussions and should be a very important 

 

This is a very interesting approach and I highly recommend the book reading and seeing Enterprise Architectures in terms of complexity and how to eliminate it from the Architecture.

Interesting Incubation and Innovation Projects from Microsoft in the Cloud spectrum

I was looking at the Windows Azure – SQL Data Services page, and looked at some of the Incubation and Innovation projects that Microsoft is researching in this area, and found this to be very interesting and so here are the projects that I found:

  • Data Mining in the Cloud
    • This is very interesting because with this we have also SQL Server Analysis Services on the Cloud, and since Analysis Services are very important for companies to achieve the analysis of their data in order to perform better and to make better decisions, having those also on the Cloud and using the Cloud perspective of pay-as-you-go I think it will mean a that lots of more companies will start looking at their data differently, because now they can afford the costs of doing it.

mining_img1B[1]

  • Project codename “Anchorage”
    • Since the appearance of the Web that a lot of options appeared to share files, photos, movies and so on, but the problem is that along the way we reach a point that we have everything so separated along the web that we lose track of it. Live Mesh tried to address this problem and is being pretty interesting in his usage, but what about if I have photos in Flickr, PhotoBucket, SmugSmug, and others as well as in my laptop? How can they all be synced? This projects does absolutely this and uses Live Framework in order to achieve it in a very interesting way.
    • anchorage_img4[1]

huron_img56[1]

  • Reporting Services against SQL Data Services
    • Interesting, we have SQL Server in the Cloud, Data Mining in the Cloud and now Reporting Services on the Cloud. This seems very interesting because we can use the Cloud to take our solutions to the “Next Level” since we now have almost all necessary technologies available on the Cloud.
    • Try it here.

reporting_img4c[1]

 

Hope this helps you see what we can expect and what level of Cloud usage we can achieve.

MIX’09 – Reviewing – Future of Expression Blend

Douglas Olson – General Manager

Christian Schormann – Director, Program Manager

Expression Mission

  • Enable professional designers to create great UX with better productivity at lower costs.
  • Help integrate design and designers into the process of software creation

Expression Blend 3 Goals

  • Enable early-stage design & prototyping (SketchFlow)
    • Created to address issues felt at the start of the software design process:
      • Top-down & bottom-ups design lets you experiments with ideas
      • SketchFlow Player lets you try your design at any time
      • Facilitate communication of design ideas
      • Easy to gather, evaluate and use stakeholders feedback
    • Blend Elements
      • SketchFlow Application Flow
        • Important to think on pages like whiteboards to sketch, insert elements, and all what you normally do.
    • Usage of SketchStyles that will allow us to maintain the Sketchy style of the Design proposal, that is very important.
    • Export to Word
      • Dumps all the SketckFlow elements like Application Flow, Pages, Comments and so on.
  • Make visual design easier for designer
    • Embrace the Design Ecosystem
      • Adobe Photoshop & Illustrator file format import with extensive support for layers
        • Preview of Photoshop in Windows Explorer even without PhotoShop installed
        • Possibility to choose what to do with each layer
        • Blend informs if the font is default or not and gives the possibility to choose other font or even the same font by specifying the path of the font
        • All content will be fully editable
        • Layer Groups are also maintained
        • By selecting an object we can make “Make into Control”
          • We choose the type of control we want to create
          • What’s done is:
            • A style is created in order for the control to became what was defined when we selected the elements to generate the control.
            • The control created will replace the selected element and gain the same properties that the original element had.
            • The style is associates to the control
            • Note: There’s now a problem when the controls have different parts, like the Slider, and this will generate all but we need to wire-up the style to the correct parts
      • Fast and Easy Control Skinning
      • Enhanced editing of visual States
      • Richer state transitions
    • Focus On Your Art
      • Redefined artboard interaction
      • Better gradient editing
  • Design with Data (Data Generation / Sampling inside Blend)
    • In the Data Tab we will have the possibility to define the DataSource structure that we want, and then just generate the data, and there are some templates like Phone Numbers, Strings, Dates, and so on.
    • Make it easy to build a data-driven applications:
      • Sample Data:
        • Design applications without access to live data source
        • Create sample data on the fly
        • Populate with configurable random data
      • Drag and Drop Master-Detail creation
      • Better user experience for data binding
      • Design-time support for Silverlight 3 controls
    • There’s a Master and a Details Mode in the Data Tab that will make it easier to perform the Master-Details view
      • in this version of Blend we need to wire-up the Master and Detail elements, and this will not be needed in the last version of Blend
  • Build interactivity without code (Behaviors)
    • Introduction to Behaviors:
      • Production-quality interactivity applied with Drag & Drop ease
      • A design pattern for reusable interactivity
      • Example: MouseGestureBehavior
        • You can define the gesture that will be used and make changes to the elements based on that gesture
  • Enable Source Code Control (Integration with Source Safe and TFS by default) – This is available also inside Expression Web
    • Design for Developers
      • Source Control
        • Visual Studio Team Foundation Server Support
        • New editor with Intellisense for code & XAML
  • Support for Silverlight 3

Note:

The same features are available for WPF and Silverlight in Blend 3.

It’s important to avoid having final or high-definition elements in the Sketch design because customers will start looking in the direction of the rendering instead of the functionality.

Microsoft Releases Roadmap

A lot is being announced this days regarding Microsoft Products and Technologies, and so this is a little summary of all those information’s.