Book Image

Windows Presentation Foundation Development Cookbook

Book Image

Windows Presentation Foundation Development Cookbook

Overview of this book

Windows Presentation Foundation (WPF) is Microsoft's development tool for building rich Windows client user experiences that incorporate UIs, media, and documents. With the updates in .NET 4.7, Visual Studio 2017, C# 7, and .NET Standard 2.0, WPF has taken giant strides and is now easier than ever for developers to use. If you want to get an in-depth view of WPF mechanics and capabilities, then this book is for you. The book begins by teaching you about the fundamentals of WPF and then quickly shows you the standard controls and the layout options. It teaches you about data bindings and how to utilize resources and the MVVM pattern to maintain a clean and reusable structure in your code. After this, you will explore the animation capabilities of WPF and see how they integrate with other mechanisms. Towards the end of the book, you will learn about WCF services and explore WPF's support for debugging and asynchronous operations. By the end of the book, you will have a deep understanding of WPF and will know how to build resilient applications.
Table of Contents (13 chapters)
2
Using WPF Standard Controls

There's more...

You can also enable the tick display in a slider control, to provide a better indication of the thumb placement. Use the TickPlacement property to turn on the tick markers. It has four values None, TopLeft, BottomRight, and Both. Let's add TickPlacement="BottomRight" in our previous slider control.

The TickFrequency property is used to set the range of possible values between 0 and 100. Let's add TickFrequency="20" to our code and then run the application again. You will see the following screen:

As shown in the preceding screenshot, you can see that some dots are added to the bottom of the slider. They represent the tick. As we have added TickFrequency as 20, it divided the entire slider range to 100/20 = 5 sections.

In general, moving the slider will not snap to the tick. Thus, you will observe the thumb placed between ticks. Use the IsSnapToTickEnabled property and set it to True, to make sure that the thumb always stays on the tick...