Welcome to witters:World     Sign in

MVVM Mini-Tutorial

Jesse Liberty has a great blog post describing the basics of the MVVM pattern and its value in Silverlight and/or WPF development.  I've been using MVVM for all my new development in the past few months--and even converting old code to use this pattern--for many of the reasons that Jesse lays out, and I found this to be a great tutorial.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by martin on Wednesday, April 28, 2010 10:43 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Zoom and PageChanged Events for FlowDocumentPageViewer

My app contains several screens that have content displayed in FlowDocuments, contained in the FlowDocumentPageViewer control.  The problem that arose is that when the user changed the Zoom level on one screen, then navigated to another screen, the content on the new screen would be displayed at the default zoom level.  And when navigating back to the original screen, the content would be revert to the default zoom there too.  My approach to solving this problem was to save the zoom level in a "preferences" class and set each viewers zoom to the saved value.  However, a problem with this approach is that there was no way to know when the zoom level changed on the out-of-the-box FlowDocumentPageViewer control.

Some quick Bing-ing led me to an extended control downloadable from this page.  The control overrides the FlowDocumentPageViewer's OnIncreaseZoomCommand and OnDecreaseZoomCommand methods.  This solution works great, but only when the user clicks the '+' or '-' to control the FlowDocument's zoom.  The commands are not executed when the user uses the slider control to adjust the zoom, and no overridable methods or events are specific to the slider.  So how can I know when the user uses the slider to adjust the zoom instead of the buttons?

For that, I had add another override to the extended control, this time OnPropertyChanged.

protected override void OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)
{
    base.OnPropertyChanged(e);
    switch (e.Property.Name)
    {
        case "Zoom":
        OnZoomChanged();
        break;
    }
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Posted by martin on Wednesday, January 13, 2010 11:08 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Fishbowl : Facebook client for Windows 7

I just read about this in a blog post by Rob Relyea.  It's a cool facebook client written to show off some of the features of Windows 7 and WPF/XAML.  I just downloaded and installed the app, and after a little poking around, I really like it.  It's clean, responsive, and easy to use.  I don't hate Facebook's web interface, but I do sometime have problems with images not loading, or screens loading half-way and never finishing.  So far nothing like that in Fishbowl, but I'll keep you posted.  Check it out here: http://www.fishbowlclient.com/

Anyone else tried this app or similar apps?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Posted by martin on Monday, November 23, 2009 3:07 PM
Permalink | Comments (0) | Post RSSRSS comment feed

XAML Power Toys

Karl Shifflett recently released the latest update to XAML Power Toys.  This is a great VS add-in that makes WPF/Silverlight development much easier and faster.  His blog has a great breakdown of all the features, including a few Silverlight tutorials covering some of the major features.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by martin on Friday, October 24, 2008 3:54 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Essential Visual Studio Tips & Tricks

I came across this great post this morning on Stephen Walther's blog.  He talks about some tips and tricks that you may not know about in Visual Studio.  I've been using a few of these, but there are some here I am glad to know about.

Currently rated 2.3 by 3 people

  • Currently 2.333333/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by martin on Friday, October 24, 2008 10:58 AM
Permalink | Comments (4) | Post RSSRSS comment feed