27

A WPF Journey to the Visual Studio 2019's Lavender Valley

 4 years ago
source link: https://www.tuicool.com/articles/In2Uvir
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Do you share the Microsoft team’s eagerness to deliver the best possible user experience that we encounter every day using Visual Studio? We do and with the latest official release of Visual Studio a new theme was born. Greet the latest addition to Telerik UI for WPF’s Theme Suite - the Visual Studio 2019 theme.


TheR3 2019 releaseof Telerik UI for WPF components is live and comes with the new theme so you can bring the Visual Studio 2019 appearance to your desktop applications. Let’s dive into the theme’s features and specifications and explore the variety of advantages that come with it.

Steal a Glance at It

The feeling that I got when I heard about the new refreshed look of Visual Studio was excitement. I really loved the colors. All those blue and purple shades are somehow softer, calmer and relaxing. Oh, and the yellow shades – so cheerful and energetic.

Just look at some of the most used controls from the Telerik UI for WPF’s controls:
fqU7bem.png!web
Yzu67ji.png!web
FbA7vyy.png!web

You saw it. You liked it? You want it? Now let me show you how to get it.

Add the Visual Studio 2019 Theme to Your WPF App

One of my most favorite phrases is, “always leave room for dessert.” But I don’t want to offend those that are fans of starting with dessert either :blush:. So, let’s start with it this time.

Oh, yes. The dessert is this quick tutorial on getting started with the theme.

For implicit styles lovers:

Drag a Telerik control from the toolbox, click on it in the Design View and choose Visual Studio 2019 from the available themes:
M3eieaq.png!web

For StyleManager lovers:

You have two secret (or not) weapons - code-behind and StyleManager’s Theme attached property. The first one is easy:

public MainWindow()

{

   StyleManager.ApplicationTheme = new VisualStudio2019Theme();

   InitializeComponent();

}

The second one is even easier:

ZNbaAbQ.png!web

P.S. You can achieve this in XAML as well:

< telerik:RadButton telerik:StyleManager.Theme = "VisualStudio2019" />

Congrats, masters! See? It’s a piece of cake.

ziiquuU.jpg!web

That's from me – you deserved it.

If you’re ready for your Visual Studio 2019 journey, don’t wait to step in the lavender valley to explore the theme’s documentation here.

Benefit from EEE Customization

I love customizations. Especially when they are Efficient , Effortless and Exquisite at the same time. Happily, these three can absolutely be put together in one sentence with the Visual Studio 2019 theme. The theme uses a ThemePalette like the previous members of the UI for WPF’sThemes Suite. All the colors that it provides are accessible to use in your applications – don’t be scared to dip your brush in these soothing palette colors and change them depending on your design needs!

JzyYjmm.png!web

You do remember that the magic of color adjusting is already brought to the next level with our Color Theme Generator , don’t you? No need to setup separate theme projects, search for color tokens and group them by categories to find the one that you’re looking for, import and export several times to try out the results. Two directions only – color adjustments on the right and an instant real preview on the left :

3EJ7V3j.gif

Wait a minute! What if you need to change the ‘special states’ brushes for a particular control without predefining the whole theme palette or extracting the ControlTemplate? Well, I’ve got a little surprise for you.

With theR3 2019 release, we introduced theTheme Helper class. It exposes a powerful set of attached properties that you can benefit from. How to use it? Let’s take a RadToggleButton as an audience volunteer and see what will happen.

< telerik:RadToggleButton  Content = "RadButton" Margin = "10"

   xmlns:helpers = "clr-namespace:Telerik.Windows.Controls.Theming.Helpers;assembly=Telerik.Windows.Controls"

   helpers:ThemeHelper.MouseOverBrush = "LightGoldenrodYellow"

   helpers:ThemeHelper.PressedBrush = "{telerik:VisualStudio2019Resource ResourceKey=ValidationBrush}"

   helpers:ThemeHelper.CheckedBrush = "{StaticResource MyCheckedBrush}" />

euaquyu.gif


P.S. The magic does not end here. There are a lot more "R3" wonders to explore which you can find in thisawesome blog post.

Try it Out and Share Your Feedback

Be the first to get the latest version and try out the new Visual Studio 2019 theme inTelerik UI for WPF. For existing users, you can get the latest bits inyour account. And if you are new to Telerik UI for WPF, you can get a free 30 day trial here .
We’d love to hear your honest feedback! Send us your comments and feedback by using the comment section below or theFeedback Portal.

Download a trial today: 


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK