Embedding PowerPoint documents in WPF

Some instruction on how to embed a PowerPoint presentation within a WPF application by converting the file to a XPS format and displaying this using DocumentViewer. Step 1: Create a WPF Application Step 2. Include the necessary references Microsoft.Office.Interop.PowerPoint Office ReachFramework Step 3: Insert DocumentViewer control into MainWindow.xaml Step 4: Convert the PowerPoint file to …

Continue reading ‘Embedding PowerPoint documents in WPF’ »

Using the CefSharp Chromium Web Browser in WPF / XAML

Some brief instructions on getting started with using the Chromium Web Browser in WPF. Step 1: Create a new WPF project Step 2: Obtain the CefSharp packages using NuGet Link for the NuGet packages is here: https://www.nuget.org/packages/CefSharp.WPF/ Select Tool > NuGet Package manager > Package Manager Console. Use the Step 3: add the CefSharp dll …

Continue reading ‘Using the CefSharp Chromium Web Browser in WPF / XAML’ »

Using RelayCommand / ICommand to handle events in WPF and MVVM

A step-by-step guide to using the RelayCommand class (based on ICommand) as means of handling user-initiated events in WPF / MVVM / XAML. 1. Create a new WPF application 2. Add the View Model class Right click your project folder and select Add > New Item > Class. Name your class MainWindowViewModel.cs: The MainWindowViewModel class …

Continue reading ‘Using RelayCommand / ICommand to handle events in WPF and MVVM’ »

Switching between WPF XAML views using MVVM DataTriggers

Related post: https://www.technical-recipes.com/2016/switching-between-wpf-xaml-views-using-mvvm-datatemplate/ This post addresses the problem of being able to switch between different views based on the property of a ViewModel class. To get started in Visual Studio, create a new WPF Application: So that when we build and run the application we have a blank window like this: To demonstrate how WPF …

Continue reading ‘Switching between WPF XAML views using MVVM DataTriggers’ »