Book Image

.Net Framework 4.5 Expert Programming Cookbook

By : A.P. Rajshekhar
Book Image

.Net Framework 4.5 Expert Programming Cookbook

By: A.P. Rajshekhar

Overview of this book

<p>Net is an architecture neutral and programming language agnostic framework that caters to all requirements, varying from business solutions to multiplayer online 3D games. Version 4.5 added many new features to help with the development of robust and user-friendly solutions. This book will teach you the new features as well as the advanced concepts of different .Net components.<br /><br /> ".Net Framework 4.5 Expert Programming Cookbook" will teach you about the advanced concepts and new features of the core framework, Window Forms, threading, and parallel programming, ASP.Net, Silverlight, WCF, WPF, ADO.Net, and Entity Framework using a real life problem/solution approach with a hands-on style.<br /><br />This book takes a hands-on approach in teaching you how to use the new as well as advanced features of the .Net framework 4.5. Each topic will teach you how to use a specific feature of .Net to solve a real world problem or scenario. You will learn how to use metadata driven programming, creating custom events with payloads, adding parallel constructs to your applications, using strict data bound controls in ASP.Net, enabling third party authentication and embedding maps, among many other key skills.<br /><br /></p>
Table of Contents (17 chapters)
.NET Framework 4.5 Expert Programming Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using Ribbon control to display the video player controls


Until .NET 4.5, Ribbon control for WPF existed as a separate download. In Version 4.5 of .NET, Ribbon control and its corresponding child controls have been included as a part of the framework itself so that a separate download is not required. Ribbon and its child controls include RibbonButton, RibbonButtonGroup, RibbonTab, and so on.

In this recipe, we will modify the video player created in the last recipe so that the video control buttons are displayed using Ribbon control.

How to do it...

  1. Launch Visual Studio 2012. Open the solution named WpfMediaPlayer.

  2. Open MainWindow.xaml.

  3. Remove the Load, Play, Pause, and Stop buttons.

  4. Move MediaElement to the bottom. Once done, the UI will look as shown in the following screenshot:

  5. Switch to the XAML view. Add the Ribbon control to the main Grid so that it is placed on the top of the window, above MediaElement. The markup will be as follows:

    <Ribbon HorizontalAlignment="Left" Margin="10,0,0,0...