Pete Brown's Blog (POKE 53280,0)
Pete Brown writes on a variety of topics from XAML with the Windows Runtime (WinRT), .NET programming using C#, WPF, Microcontroller programming with .NET Microframework, .NET Gadgeteer, Windows on Devices, and even plain old C, to raising two children in the suburbs of Maryland, woodworking, CNC and generally "making physical stuff". Oh, and Pete loves retro technology, especially Commodore (C64 and C128). If the content interests you, please subscribe using the subscription link to the right of every page.
Archive for tag:
Tutorial-General-Silverlight
-
A reader of my Silverlight 5 book recently reached out to
me about threading and why I create some objects on the UI thread
in the examples. We discussed some of the reasons, but I felt this
would be a good topic to share with everyone. In fact, this is one
area where it would have been fun to go into great detail in my
book, but there simply wasn't the space. Threading and cross-thread
...
-
Today I got a question on twitter asking how to enumerate
printers in Silverlight, so I put together this quick blog
post.
Silverlight lacks the PrinterSettings.InstalledPrinters
collection. So, how do you go about getting a list of installed
printers in Silverlight 5? PInvoke to the Win32 API, of course.
Alexandra Rusina on the Silverlight team wrote a
great article on PInvoke....
-
MIDI (Musical Instrument Digital Interface) has been around
since the 80s. Initially, it was just a replacement for the CV
(Control Voltage) approach to getting different keyboards and sound
modules to play together. Later, it evolved as a way to sequence
entire productions, and to receive and transmit patch information.
Here's a setup I had one summer, using my HS-60 (a Juno 106) to
co...
-
This is a modified excerpt from chapter 17 "Networking Basics"
in Silverlight 5 in Action. You can thank James Manning (no
relation to the publisher) for this being in the book. Persistence
pays off :)
Shameless pimping: If you're looking for a one-stop shop for
learning Silverlight 5, consider my book Silverlight 5 in
Action, to be released in print near the end of this year. It's
...
-
One of the best improvements in WPF 4 was
fixing the text clarity issue once and for all. It may seem
trivial, but in a system that supports a vector-based scalable UI
as well as animation of text elements, it's not quite as easy to
solve it seems. Once we get
PC displays with DPI similar to that we have on hand-held
devices, snapped or unsnapped text will become a non-issue.
By ne...
-
I like fonts. I like fonts that are visibly pleasing as well as
easy to read. While not as skilled or knowledgeable as some of my
designer friends, I'm a bit of a typography geek. For that reason,
I'm very excited about all the new OpenType support built into
Silverlight 5.
Note: While I happen to be using Silverlight here, these
features are also built
into WPF 4. Check them...
-
Increasingly, consumers have more computing intelligence sitting
in their TV rooms. Many have cable or satellite boxes which are
essentially purpose-built PCs. We have game consoles like the
Playstation and Xbox 360 which are powerful computers in their own
right. Not surprisingly, many tech-savvy consumers even have
dedicated PCs attached to their TVs, often including CableCard
units t...
-
Silverlight 4 introduced bitmap-based printing to Silverlight
developers. It was great for printscreen-type single-page jobs, but
when it came down to anything more than two or three pages, it just
took too long? Why? Printing in Silverlight 4 would send a bitmap
representing the entire page to the printer - a serious amount of
data.
NOTE: This post covers features not yet released ...
-
I had the pleasure of speaking at Tech Ed Atlanta last week.
While there, I also spoke at the Atlanta Silverlight User Group.
The week prior, I also got to speak at the Hampton Roads .NET User
Group in Virginia Beach, VA. I had a great time at of them, and met
some great developers interested in Silverlight and WPF.
Here are the materials from those events
DEV331 (and DEV331-R) A La...
Published
Monday, May 23, 2011 |
Tagged:
.NET, Silverlight, Events, Expression-Blend, Windows-Forms, WindowsClient, Video, Presentations, Tutorial-General-Silverlight, Tutorial-Winforms-Modernization |
-
Silverlight 5
introduced the new ClickCount property of the MouseButtonEventArgs
class. This property tells you how many times the user has
rapidly clicked the mouse button. While this is useful for
supporting double click and triple (or even more) click scenarios,
it's not immediately obvious how you would use it to support both
in the same element. Several folks in the community, lik...
-
When looking at features in our favorite platforms, we often
forget that the tooling gets updated too. For Silverlight 5, one of
the most interesting tooling enhancements is the ability to set
breakpoints and debug bindings in XAML.
Please note that this article and the attached sample code was
written using the Silverlight 5 Beta, available at MIX11 in April
2011, and updated for t...
-
One great feature that has, until now, been exclusive to WPF is
the ability to use implicit data templates. You may be familiar
with data templates, probably having used them with content
controls or, more likely, list boxes. Data Templates make it
possible to template (typically) a non-UI item and reuse that
template in one or more places. Without templates, list boxes would
be pretty ...
-
In some applications, particularly touch-screen kiosk apps and
casual games, it is desirable to be able to play a sound
immediately upon a user action. For example, you may want to play a
"click" sound when they press a key on an on-screen keyboard, or
play a series of laser sounds when their on-screen spaceship fires
its weapons.
Please note that this article and the attached sampl...
-
In previous versions of Silverlight, we didn't have the ability
to create new operating system windows. If we wanted to pop up
content over our other application, we had to use the Popup
element, or the derived ChildWindow control. Those were great, but
didn't act as operating system windows. Specifically, they couldn't
escape the bounds of your main application.
Please note that th...
-
Double-click isn't as popular a mouse action as it once was. For
many, especially the elderly, clicking twice in the same spot
without moving the mouse in between, is actually quite challenging.
Nevertheless, double-click (and even triple click in some
specialized programs in 3d and music) is a necessary
capability.
Please note that this article and the attached sample code was
wri...
-
Silverlight 5 has made some real improvements to the text stack,
including control over character spacing, and linked and
multi-column text. In this post, we'll look at a few of those
advancements.
Please note that this article and the attached sample code was
written using the Silverlight 5 Beta, available at MIX11 in April
2011, and updated for the Silverlight 5 RC.
Character...
-
Four months ago, in December 2010, we held the Silverlight
Firestarter in Redmond - an entire event dedicated just to
Silverlight, with great speakers from inside Microsoft and from the
Silverlight community. In that event's keynote, Scott Guthrie
showed off some of the plans we have for Silverlight 5 (as well as
the secret location of his tattoo).
For information on the newer Septe...
-
The Native
Extensions for Microsoft Silverlight (NESL) is a library that
helps bridge the gap between what Silverlight can do out of the
box, and what WPF and the full .NET framework can do to integrate
with Windows.
Here's the description from the code gallery page:
While Silverlight 4 supports accessing COM automation components
from elevated trust OOB applications, many Window...
-
WPF currently, and Silverlight
in v5, enables you to create your own custom markup extensions.
Markup extensions are those little strings in XAML that are
typically (but not always) enclosed in {curly braces} which, as the
name implies, add new functionality to XAML. The most commonly used
markup extensions are the {StaticResource}, {TemplateBinding}, and
{Binding} extensions.
Creati...
-
An asynchronous network call is one in which you fire off a
method and don't block the thread while waiting for it to return.
This introduces some complexities since you have to somehow be
notified of the success or failure of the call, and need to somehow
retrieve the results.
Silverlight developers are used to making asynchronous network
calls because that's all the stack has suppor...
-
NuGet is package management system for .NET and Visual Studio.
It allows people to create simple packages that install files into
your projects, adds references etc. It makes it super simple to get
working components and even scaffolding into your application
without having to search your drive, manually find references,
resolve dependencies etc.
NuGet is a Visual Studio extension t...
-
The Silverlight and WPF binding system is extremely powerful.
With it, you can bind your UI to your viewmodels (or other backing
objects), bind control values to each other (for example, a slider
controlling an object's scale or rotation) all with little or no
code.
In order for binding to work, it requires a little cooperation
from code. The target of a binding statement (typically a...