Alessandro Del Sole's Blog

/* A programming space about Microsoft® .NET® */
posts - 159, comments - 0, trackbacks - 0

My Links

News

Your host

This is me! This space is about Microsoft® .NET® and Microsoft® Visual Basic development. Enjoy! :-)

These postings are provided 'AS IS' for entertainment purposes only with absolutely no warranty expressed or implied and confer no rights.

Microsoft MVP

My MVP Profile

I'm a VB!

Watch my interview in Seattle

My new book on VB 2015!

Pre-order VB 2015 Unleashed Pre-order my new book "Visual Basic 2015 Unleashed". Click for more info!

My new book on LightSwitch!

Visual Studio LightSwitch Unleashed My book "Visual Studio LightSwitch Unleashed" is available. Click the cover!

Your visits

Follow me on Twitter!

CodePlex download Download my open-source projects from CodePlex!

Article Categories

Archives

Post Categories

.NET Framework

Blogroll

Help Authoring

Microsoft & MSDN

Setup & Deployment

Visual Basic 2005/2008/2010

Windows Presentation Foundation

Playing media contents in loop with the MediaElement control

The MediaElement control is used to play media contents in Technologies like WPF, Silverlight, WinRT and Windows Phone. You might have the need to play a content forever, with a loop. A very easy way to accomplish this is Handling the MediaEnded and restart from there. For example, we declare a boolean variable to store the loop state (enabled/disabled): Private isLoop As Boolean = False This can be useful if we associate the state of the loop to a button, which is just responsible to change its value:     Private Sub LoopButton_Click(sender As Object, e As EventArgs)         isLoop = Not isLoop     End Sub Somewhere else we'll start playing the content; the important thing is how we handle the event, like in the following example:     Private Sub Media1_MediaEnded(sender As Object, e As RoutedEventArgs) Handles Media1.MediaEnded         If isLoop = True Then             Me.Media1.Position = New TimeSpan(0)             Me.Media1.Play()         End If     End Sub Basically the code...

posted @ giovedì 14 marzo 2013 10:04 | Feedback (0) | Filed Under [ Silverlight/Windows Phone Windows Presentation Foundation Windows 8 & WinRT ]

My first eBook: "Hidden WPF"

A few days ago, we have released my first eBook called "Hidden WPF: Secrets for creating great applications in WPF": Published by InformIT (the online division of my publisher SAMS/Pearson), this is a different publication. It's a very small book, 99 pages, produced and thought for mobile devices. Here you will find tons of tips & tricks, suggestions, and real world implementations that I collected in my daily work, building applications with Windows Presentation Foundation. Price is $ 7,99. You will find many info about working with PDF and XPS documents, suggestions to get the most out of the Visual Studio IDE with WPF, enhancing...

posted @ giovedì 14 marzo 2013 09:58 | Feedback (0) | Filed Under [ Windows Presentation Foundation ]

My new book "Visual Basic 2012 Unleashed" is available

I'm pleased and proud to announce that my new book "Visual Basic 2012 Unleashed" is available, both paperback and digital edition! This time I had the honor of featuring Lucian Wischik, the VB Specification Lead at Microsoft, as the author of a great foreword. As usual, it has really been a hard work, but fortunately working with a great team (including Matthew Kleinwaks as the tech editor) makes things easier. The book has been fully updated to target the .NET Framework 4.5 and the new features in the Visual Basic programming Language, such as the Async/Await pattern, new tools in the...

posted @ lunedì 28 gennaio 2013 22:43 | Feedback (0) | Filed Under [ Visual Basic Silverlight/Windows Phone Windows Presentation Foundation Windows Communication Foundation LINQ/EF/OData Misc .NET Framework Help Authoring Setup & Deployment Visual Studio Extensibility Visual Studio Express Editions Windows Azure Windows 8 & WinRT Visual Studio 2012 ]

Announcing Azure Blob Studio 2011 on CodePlex: a new blob storage manager written in Visual Basic 2010

I just released onto CodePlex a new tool called Azure Blob Studio 2011. This tool provides an easy way to manage files on your Windows Azure's blob storage, including both the online and developer accounts; it is available in two editions: stand-alone WPF client extension for Visual Studio 2010 (precisely a tool window) The stand-alone client is available via a ClickOnce installer, whereas the extension is available as a VSIX package from the Visual Studio Gallery (and the Extension Manager tool in VS). With this approach you can receive updates easily. The application has...

posted @ martedì 28 dicembre 2010 12:42 | Feedback (0) | Filed Under [ Visual Studio 2010 Visual Basic Windows Presentation Foundation Windows Azure ]

WPF: text wrapping inside DataGrid cells

When working with the DataGrid in WPF, you generally use the DataGridTextColumn object for displaying or editing text. Such an object has a limitation: there is no property for specifying that the text should be automatically wrapped according to the column width, similarly to what you can do in Microsoft Excel. Fortunately the solution is pretty easy. In fact you can use the DataGridTemplateColumn element (a generic object which allows deep customizations for cell templates) and inside it you implement one TextBox for text editing and one TextBlock for displaying text; such controls expose the TextWrapping property that we can use for wrapping the text. Here's the...

posted @ giovedì 14 ottobre 2010 18:08 | Feedback (0) | Filed Under [ Visual Studio 2010 Visual Basic Windows Presentation Foundation ]

WPF: Introducing the Model-View-ViewModel pattern for Visual Basic 2010 developers - full series summary

Following the last part of the blog post introductory series on MVVM in WPF 4 applications with Visual Basic 2010, I think that you can find useful the full list of 10 posts for easier reading. Here they are: "WPF: Introducing the Model-View-ViewModel pattern for Visual Basic 2010 developers" Part 1 (introduction) Part 2 (command logic) Part 3 (details view + generic RelayCommand) Part 4 (data validation) (From part 5 on, MVVM is against the ADO.NET Entity Framework) Part 5 (Entity Data Model creation + data validation) Part 6 (Message Broker and commanding) Part 7 (service layer) Part 8 (creating ViewModels) Part 9 (refactoring + unit testing) Part 10 (Views definition, UI and code download) I'm planning some further blog posts...

posted @ venerdì 13 agosto 2010 17:01 | Feedback (0) | Filed Under [ Visual Studio 2010 Visual Basic Windows Presentation Foundation ]

WPF: Introducing the Model-View-ViewModel pattern for Visual Basic 2010 developers - part 10 (and last!)

This is definitely the last blog post of the introductory series about the Model-View-ViewModel in WPF with Visual Basic 2010, particularly against the ADO.NET Entity Framework. I will explain how to build the user interface and how to bind it to ViewModels. Although this is the last blog post of the series, this does not mean that I will no longer discuss MVVM with VB 2010. On the contrary this will be an important topic for this blog, but for the sake of clarity I will distinguish topics in different blog posts and today we will complete the sample application. You can find...

posted @ venerdì 13 agosto 2010 16:52 | Feedback (0) | Filed Under [ Visual Studio 2010 Visual Basic Windows Presentation Foundation ]

WPF: Introducing the Model-View-ViewModel pattern for Visual Basic 2010 developers - part 9

So far we wrote a lot of code, in this blog post series related to MVVM in WPF with Visual Basic 2010. Of course there are a lot of things to improve before heading to the last part. This will also allow us discovering a great benefit from using MVVM, which is writing unit tests against the ViewModel. Let's start by refactoring some code. Refactoring time! Refactoring the code is something that is mainly about both ViewModels. OrdersViewModel is the one requiring more attention. The first thing we want to improve is how the code uses the RelayCommand class: since we also wrote a...

posted @ giovedì 12 agosto 2010 15:46 | Feedback (46) | Filed Under [ Visual Studio 2010 Visual Basic Windows Presentation Foundation ]

WPF: Introducing the Model-View-ViewModel pattern for Visual Basic 2010 developers - part 8

Let's go ahead with our discussion about the MVVM pattern in WPF applications with VB 2010. Last time I explained how to implement a service layer; in this post I will focus on ViewModels. Particularly I will show where to place an instance of the Messenger class and then I will show all the required ViewModels. Because of this it will be a quite long work, especially in terms of lines of code since concepts have all been explained in this previous post. Send me a message! In all tutorials I found (and studied) declaring an instance of the Messenger class...

posted @ giovedì 12 agosto 2010 14:51 | Feedback (34) | Filed Under [ Visual Studio 2010 Visual Basic Windows Presentation Foundation ]

WPF: Introducing the Model-View-ViewModel pattern for Visual Basic 2010 developers - part 7

Let's retake our journey through the MVVM pattern in WPF 4, with Visual Basic 2010, against ADO.NET Entity Framework. Last time we saw how to implement a Messenger class, describing what it is for although we'll see such a class in action in my next post. In this article we will write some code for data access which is important to understand how complex can be building applications based on the MVVM but also how many benefits it can bring into your developer life. Problem of the day: does the ViewModel know what's the data source? I confessed that I had to delay the...

posted @ lunedì 2 agosto 2010 23:42 | Feedback (0) | Filed Under [ Visual Studio 2010 Visual Basic Windows Presentation Foundation ]

Full Windows Presentation Foundation Archive

Powered by:
Powered By Subtext Powered By ASP.NET