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.
Launch Visual Studio 2012. Open the solution named
WpfMediaPlayer
.Open
MainWindow.xaml
.Remove the
Load
,Play
,Pause
, andStop
buttons.Move
MediaElement
to the bottom. Once done, the UI will look as shown in the following screenshot:Switch to the XAML view. Add the
Ribbon
control to the mainGrid
so that it is placed on the top of the window, aboveMediaElement
. The markup will be as follows:<Ribbon HorizontalAlignment="Left" Margin="10,0,0,0...