Content by Category
.NET 1.x
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET 4.5
.NET Assemblies
.NET Framework
.NET Getting Started
Accessibility
ADO.NET
Advertorials
Agile Development
AJAX
Amazon Web Services
Analysis Services
Android
Architecture
Arduino
ASP .NET Web API
ASP.NET
ASP.NET MVC
ASP.NET WebForms
Azure
B2B (Business Integration)
BDD
Big Data
Bing
BizTalk
Book Excerpts
Build and Deploy
Business Intelligence
C#
C++
ClickOnce
Cloud Computing
Code Contracts
CODE Framework Info - non Technical
CODE on the Road!
COM+
Community
Conferences
Continuous Integration
Crystal Reports
CSLA.NET
CSS
Data
Debugger
Design Patterns
Development Process
Display Technologies
Distributed Computing
Document Database
DotNetNuke
DSL
Dynamic Languages
Dynamic Programming
Editorials
Enterprise Services ("COM+")
Entity Framework
Events
Expression Blend
F#
Fox to Fox
Frameworks
Functional Programming
Git
Graphics
HTML 5
Internet Explorer 8.0
Interviews
IOS
iPhone
Iron Ruby
Java
Java Script
JavaScript
jQuery
JSON
Lightswitch
LINQ
Linux
LUA
Mac OS X
MDX
Messaging
Metro
Microsoft Application Blocks
Microsoft Business Rules Framework
Microsoft Dynamics
Microsoft Expression
Microsoft Office
Mobile Development
Mobile PC
Mono
MsBuild
MVVM
MySQL
Network
NHibernate
node.js
NOSQL
Nuget
Object Oriented Development
Objective C
Odata
OLAP
Open Source
Opinion
Opinions
Oracle
ORM
Other Languages
Parallel Programming
Patterns
PHP
Podcasts
Post Mortem
PowerPoint
Print/Output
Prism
Product News
Product Reviews
Project Management
Prolog
Python
Q&A
Rails
Rake
Razor
Reporting Services
REST
RIA Services
Ruby
Ruby on Rails
Scheme
Search
Security
Services
SharePoint
SignalR
Silverlight
SOA
Social Networks
Software & Law
Software Business
Source Control
Speech-Enabled Applications
SQL Server
SQL Server 2000
SQL Server 2005
SQL Server 2008
SQL Server 2012
SQL Server CE/AnyWhere/Mobile/Compact
SSIS
Subversion
Sync Framework
Tablet PC
TDD
Team System
Techniques
Testing and Quality Control
TFS
Tips
TypeScript
UI Design
UML
User Groups
VB Script
VB.NET
Version Control
VFP and .NET
VFP and SQL Server
Virtual Earth
Vista
Visual Basic
Visual Basic 6 (and older)
Visual FoxPro
Visual Studio .NET
Visual Studio 11
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio 2011
Visual Studio 2012
Visual Studio Tools for Office
VSX
WCF
Web Development (general)
Web Services
WebMatrix
WF
Whitepapers
Windows 7
Windows 8
Windows Azure
Windows Live
Windows Phone 7
Windows Phone SDK
Windows Server
Windows Vista
WinForms
WinRT
Workflow
WPF
XAML
Xiine Documentation
XML
XNA
XSLT



LearnNow


XAMALOT
 


SSWUG

Reader rating:
Article source: CoDe (2012 Jan/Feb)


Article Pages:  1  2 3 4 5 - Next >


Seven New Features in Silverlight 5 (Plus a 3D Bonus)

The next version of Silverlight should be available by the time you read this article. The Silverlight team has followed a fast pace during the last few years, producing four versions of their framework in only thirty months. Each new version of Silverlight has been full of surprises and useful features. Version 5 is no different. Let’s look as some of the best features available in SL 5.

XAML Debugging

Gather a crowd of developers together and they’ll soon be grumbling about their daily code battles. Markup languages like HTML and XML often become a target for developer angst during these gripe-fests due to their lack of debugging support.

Silverlight suffers from this problem and it’s particularly aggravating when using data binding in your XAML. I’ve seen the angry glint in my teammates’ eyes when they’re wrestling with a nasty data-binding problem.

My favorite new feature in Silverlight 5 has to be the XAML debugging supported added to Visual Studio. Finally, it’s possible to place breakpoints in my XAML, press F5 to step through the binding markup and see binding details in the Visual Studio Locals window.

To demonstrate this satisfying new feature, I’ll bind a ListBox and TextBlock to a simple data source and then add a breakpoint. First, let’s look at the data source classes.

public class Food {
    public string FoodName { getset; }
    public Int32 Calories { getset; }
    public Int32 StockCount { getset; }}
public class Foods {
  private List<Foodfoods;
  // ... constructor creates the list of Food
 public List<Food>FoodByCategory(
string category){
 var q = from in foods
       where String.Equals(f.Category, category,
       StringComparison.OrdinalIgnoreCase)
       select f;
   return q.ToList();}

Next, I’ll create the UI and bind the controls. Note the typo on the TextBlock binding.

<ListBox Height='163'
         ItemsSource='{Binding}'
         DisplayMemberPath='FoodName'
         Grid.Row='1' />

    <TextBlock Grid.Row='2'
               Text='{Binding FodName}' />

Finally, I’ll set the data context in the code behind.

 var foods = new Foods();
 this.DataContext=
  foods.FoodListByCategory("Dairy");

Because of the typo in the data-binding XAML, the bound data will not show up at runtime. This is the perfect scenario for XAML debugging.

Setting a Breakpoint in XAML

Setting a breakpoint in XAML is identical to the way you set one in the Visual Studio code editor. First, move the selection point to the line of XAML that you want to debug. Then either press F9 or click in the code selection margin on the left side of the code window. Note you cannot add a breakpoint to a line of XAML unless it has a Binding Markup Extension within that line of text. Figure 1 shows two breakpoints set in the XAML editor.

Click for a larger version of this image.

Figure 1: Two breakpoints in the XAML editor window.

With the breakpoints in place, all you need to do is run a debug session for the application. After the debugger is attached, you will see the joyful sight shown in Figure 2.

Click for a larger version of this image.

Figure 2: Waiting at breakpoint and examining the Locals window.

Once you are at the breakpoint, you can view the Locals and other debugging windows in Visual Studio. You can also step through the code files while doing XAML debugging.

You can customize the breakpoints as Microsoft ported all the normal breakpoint options to the XAML version. Just right-click the red breakpoint circle and set breakpoint conditions, filters and hit counts as shown in Figure 3.

Click for a larger version of this image.

Figure 3: Breakpoint options.

&

By: Walt Ritscher

Walt Ritscher has trained thousands of corporate developers during the last twelve years. An active speaker, his teaching schedule has taken him throughout the world providing developer training at corporations, universities, and software conferences. He has collaborated on several books and videos published for the developer market including early adopter .Net courses at Microsoft Press. Walt is currently consulting and teaching .NET and WPF classes for Wintellect. Walt's industry expertise has placed him on various national technology advisory boards. He is also deeply involved in the local developer community-founding the .NET Developers Association in Redmond, WA. Walt has accumulated plenty of experience as a developer and is currently a Microsoft MVP and a member of the Silverlight Insiders. As a Web programmer he has worked numerous projects including: EPA sites and the Microsoft Community Starter Kit.

waltonline@scandiasoft.com



Article Pages:  1  2 3 4 5 - Next Page: 'Data-binding Improvements' >>

Page 1: Seven New Features in Silverlight 5 (Plus a 3D Bonus)
Page 2: Data-binding Improvements
Page 3: Vector Printing
Page 4: PivotViewer
Page 5: True 3D Rendering

How would you rate the quality of this article?
1 2 3 4 5
Poor      Outstanding

Tell us why you rated the content this way. (optional)

Average rating:
5 out of 5

2 people have rated this article.

Instantly Search Terabytes Of Text
“Lightning Fast”
– Redmond Mag
“Covers all data
sources” – eWeek
25+ fielded & full-text search options
dtSearch’s own document filters highlight hits in popular file types
Web Spider supports static & dynamic data
APIs for .NET, Java, C++, SQL, etc.
Win / Linux (64-bit & 32-bit)
www.dtSearch.com
 

      AppsWorld Europe

 

SSWUG