Jump to content

I made some slight updates to the podcatcher main window If you want to see what I did, you can...


G+_Joe Maruschek
 Share

Recommended Posts

I made some slight updates to the podcatcher main window.  If you want to see what I did, you can download the code below. The zip file that is linked below just has the MainWindow.xaml and its code-behind file.  You should be able to just drop those in to get my changes. What I did was to clean up the Data Template by getting rid of some of the empty space and left-justifying the text to make it look neater.   Since all the elements were stacked vertically in the window, I went ahead and used the StackPanel element to have everything neatly stacked together.  It hasn't been talked about in the show, but there are a bunch of these "panel" elements that can hold other elements and arrange them in different ways.  I also added some buttons below the video window for stop, play, and pause.  There is also a slider that shows you the progress of the video clip, but unfortunately I couldn't get it to allow you to seek back and forth in the video clip.  Perhaps one of you can make it work.

http://joemaruschek.com/test/MainWindow.xaml.zip

Link to comment
Share on other sites

Darryl Medley Let's take it a little at a time.  First, he is declaring a class that implements the INotifyPropertyChanged interface.  That means he is promising that his class will be able to "notify" any interested objects that any of this class's properties have been updated. 

Next, he has the constructor of his class which is called whenever an object of this type of class is created.  He sets the FeedItems property to a new ObservableCollection of SyndicationItems.  In other words, he is making space for the items in the podcast feed.

Next is the declaration of the FeedItems property he just initialized above.  He's using ObservableCollection because you can use data binding with that type of collection.

Next he declares a private field called podCastUri which is going to store the address of the currently playing video.

He then makes a public property that exposes the private field he just declared.  They haven't really talked about the difference between fields and properties, but very simply, properties act like simple data fields, but you get to run some code when the property is read or written to.  In this case, when the PodCastVideoUri is written to (that is, changed) he runs some code to raise an "event" that he declares next.

He finally makes good on the promise made at the top by declaring an event on the last lines of the class, along with code to call any handlers that have attached themselves.  They haven't talked about events on the show yet. You can read the gory details about events here: http://msdn.microsoft.com/en-us/library/w369ty8x.aspx

Link to comment
Share on other sites

 Share

×
×
  • Create New...