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:
XAML
-
Many device-oriented apps (bluetooth, MIDI, etc.) require you to
restart the app when you want to detect a new device. I've seen
this both in Windows Store/Universal apps, and even in big desktop
apps. Instead, these apps should detect changes during runtime, and
respond gracefully.
Example:
You load up a synthesizer app. After it loads, you realize you
forgot to plug in your keyboard contro...
-
Look what just arrived at the door!
The author copies are usually in the first set to be sent out.
For folks who have pre-ordered paper copies, you should see those
really soon. The ebooks typically show up shortly afterwards.
Yes, this is Windows 8 XAML in Action. We renamed the
book to better cover its ongoing focus.
How to get your own copy
If you're at TechEd NA 2013 th...
-
.NET 4.5 quietly introduced several attributes which are useful
for debugging and error reporting: CallerMemberName, CallerFilePath
and CallerLineNumber, all collectively referred to as "Caller Information". One of those,
CallerMemberName, is also very useful for MVVM apps and other apps
using INotifyPropertyChanged for change notifications.
Getting the calling function name
The Cal...
-
In this post, I show how to have bidirectional UDP
communication: The Win8 Metro style app will send messages to the
Gadgeteer device which responds with ACKs.
This is part 3 in a series of posts about using sockets to
communicate between Windows 8 Metro apps and a microcontroller. The
rest of the series may be found here:
Part 1: Simple UDP networking test from a Metro style XA...
-
In this post, I show how to set up the UDP code on the Micro
Framework side so it can listen to messages coming from the Windows
8 app.
This is part 2 in a series of posts about using sockets to
communicate between Windows 8 Metro apps and a microcontroller. The
rest of the series may be found here:
Part 1: Simple UDP networking test from a Metro style XAML
app
Part 2: This ...
-
One of my pet projects requires using UDP sockets from a Windows
8 Metro style app to talk to a microcontroller. UDP sockets are a
pretty efficient way of communicating across wired and wireless
connections.
In this first part, we'll focus on prototyping the Metro style
XAML/C# app. The NETMF piece will be in the next post.
Test Setup
The first step is to figure out how we'll tes...
-
The next book is well underway! We released several chapters
from Windows 8 XAML in Action as part of this week's
MEAP (Manning Early Access Program) kickoff.
Through the MEAP, you get access to chapters right after my
development editor takes a look at them. You don't have to wait for
the full book to be finished and in print (which takes forever) to
be able to use it. Bonus: MEAP ch...
-
It's customary for a Manning book to be the Deal of the Day
shortly after it is released. My book, Silverlight 5 in
Action, is the Manning Deal of the Day for June 6, 2012.
Using the information and code below, you can get half off
(50% off) the retail purchase price. This deal is good
only for 24 hours, so be sure to pick it up now!
Buy it Here
http://www.manning.com/pbrown2...
-
Today we released the Windows 8 Release Preview (RP)! I haven't
been this excited about an operating system since Windows 95 first
came out, when there was no such thing as downloading an OS, and we
had to actually wait in line in a store to get our blue cloud box
full of floppies (or was it a CD? I forget).
Windows 95 was a big deal for users and developers alike. It had
a brand new ...
-
It took forever to edit and print such a huge tome, but I'm
happy to say that Silverlight 5 in Action is now in. You should see
them available from Manning this week, and from Amazon next week.
Here are my four boxes, just delivered today. The UPS man
probably hates it when he has to deliver books to my place. At 968
pages each, they're pretty heavy. That top box: 1 book. Plu...
-
Last September, I introduced the idea of Tasks in Silverlight.
One of the things I really like about .NET 4.5, and the C# compiler
that comes with it, is the ability to simplify asynchronous code by
using the async modifier and await operator. Just yesterday, I posted a bit on how these two keywords are used by
the compiler to take care of all the heavy lifting of asynchronous
code.
T...
-
This past Monday (May 14th), I officially started a new role at
Microsoft. I like to be as transparent as possible, so I thought
I'd share with you all the details of this role as well as where I
was before I moved to it.
TL;DR:
XAML. Windows. Developers. 'nuf said.
A little (optional) history
I've been working for Microsoft for a bit over two and a half
years now. In that...
-
IL DASM (The Intermediate Language Disassembly tool) is
something I haven't used in a while. When .NET 1.0 first came out
in beta over a decade ago, a much younger me went and created a
"Hello World" in IL just to see how it's done. I still have it:
//
// Hello World IL Program
// ------------------------------------
// Written by Peter M. Brown
// August 15, 2001
//
// This is ...
-
Recently, a reader asked how they should go about
setting the Typography properties from code-behind.
The original question was about Silverlight, but the approach
works in WPF, Windows 8 and more.
Given the following markup:
<StackPanel>
<TextBlock x:Name="OriginalText"
FontSize="72"
FontFamily="Gabriola"
Text="Hello ...
-
I'm working on a little WPF 4.5 sample app. As part of that, I
needed to create a drop-down list of Font Families. Here's what the
ComboBox currently looks like:
The Data Source
I wanted control over the fonts including sorting and,
potentially, filtering the results. I didn't want to use static
binding from XAML. So, in my viewmodel, I added a collection of
FontFamily objects ...
-
Over the years, I've conditioned myself to use the Uri class
when surfacing web URLs in my application. Early versions of
Silverlight couldn't bind an image source directly to an instance
of a Uri because they lacked an appropriate type converter; the
usual workaround was to change the property to a string type.
Subsequent versions Silverlight added that capability and the
converter. ...
-
At the South Florida Code Camp last week, I gave an early
morning talk titled "Getting Started with XAML". In this talk, I
covered the basics of XAML, the property system, layout, and other
things you need to know as a XAML developer for WPF, Silverlight,
or Windows 8.
Slides
Attached to this post
Demos
It was all real-time stuff in this talk. No downloadable demos.
I...
-
At the South Florida Code Camp I gave a newer version of the
REST Silverlight talk using the just released MVC 4 Beta and
ASP.NET Web API.
This talk shows how to share code between different versions of
the framework, how to use the ASP.NET Web API from Silverlight, and
how to integrate a Silverlight application into an MVC 4 site.
Powerpoint Slides
Attached to this post
...
-
At the South Florida Code Camp, I gave the "Lap Around
Silverlight 5" talk. The slides and code are all available via the
links below.
Powerpoint Slides
Attached to this post
Demos and Examples
The Big List of What's New or Improved in Silverlight 5 - Pete
Brown's 10rem.net
Threading Considerations for Binding and Change Notification in
Silverlight 5
Crea...
-
The Windows Client Developer Roundup aggregates information of
interest to Windows Client Developers, including WinRT XAML, WPF, Silverlight, Visual
C++, XNA, Expression Blend, Surface, Windows
7, Windows
Phone, Visual Studio, WCF RIA Services and
more. Sometimes I even include a little jQuery and HTML5. If you
have something interesting you've done or have run across, or you
blog regu...
Published
Wednesday, February 8, 2012 |
Tagged:
.NET, WPF, Silverlight, XNA, CPP, WindowsClient, WindowsClientRoundup, Kinect, Windows8, XAML |
-
In my post about WPF 4.5 Observable Collection
Cross-thread Change Notification, I showed the basics of how to
synchronize collection updates in WPF, and how to avoid having to
manually dispatch calls to the UI thread. In the comments, Jonathan
Allen brought up some very good points that I simply didn't know
the answers to (and a lock I was missing in the example). Thanks to
Jonathan fo...
-
WPF 4.5 is available as part of the Visual Studio 11 Developer Preview released at
the Build 2011 conference, and is part of the .NET Framework
version 4.5. WPF 4.5 addresses several important customer requests
including the ability to have cross-thread change notification for
collections - the topic of this post.
Update 1/20/2012: I have
posted a set of updates to this post with add...