Telerik blogs

Introduction

Telerik’s RadControls for WPF and Silverlight has over 60 fully-featured controls, it’s only natural that some gems are undiscovered. In this blog post, we will take a look at five things I bet you didn’t know about RadControls for WPF or Silverlight application.

1. You can use Implicit Styles if you want to modify our XAML to provide custom themes.

With Implicit styling you create a target type but not a key for your style and the style is implicitly applied to any object of that type that does not otherwise have an explicit style. Figure 1 and 2 shows an example of what the project configuration wizard looks like.

1

Figure 1: Project Configuration Wizard in a new RadControls for WPF or Silverlight selecting Implicit Styles.

2

Figure 2: The Second Screen to the Project Configuration Wizard in a new RadControls for WPF or Silverlight.

If this example, we selected “Copy the Xaml files to project” with the ExpressionDark theme. Now inside of Visual Studio, we can edit the style directly by navigating over to Themes | ExpressionDark | Telerik.Windows.Controls.xaml. Of course, if you wanted to edit styles found in other controls, just make sure you select them in the “Components” tab shown in Figure 1. We only selected Telerik.Windows.Controls for this example. (Which contains styling for some of our controls such as our RadButton)

3

Figure 3: Editing the Implicit Style file directly from Visual Studio.

We can now open the Telerik.Windows.Controls.xaml file and style it appropriately.

If you select the option, “Add references to theme assemblies”, a dll containing the theme will be included in your project. Since you will not be editing the styles directly through XAML files (with the previous option), it will make upgrading your project easier. If you would like further info on this topic, it can be found in our help documentation.

NOTE: In terms of future upgrading, it will be more useful to use the XAML theme assembly instead of XAML files. You can use XAML files if you want to customize our themes.

 

2. Fixing your Toolbox with just Telerik’s Toolbox configurator.

We have all experienced this before, missing items from our Toolbox as shown in Figure 4.

4

Figure 4: Missing Toolbox Items.

This can quickly be resolved by navigating to Telerik -> RadControls for WPF or Silverlight -> Launch Toolbox Configurator. You will get a warning that Visual Studio will be restarted, reloading your current solution. After pressing finish, you will now see your Toolbox items as shown in Figure 5.

5

Figure 5: Restored Toolbox items.

You can now easily drag and drop components from the Toolbox onto the designer to auto-generate the required XAML as well as the XML Namespaces.

3. Coded UI Support is available!

Coded UI tests are automated UI tests which can be created with various versions of Visual Studio to test different kinds of user interfaces. We are committed to adding this support to WPF and Silverlight as requested by our customers. With our Q3 2012 official release we have included Level 1 Coded UI test support across our controls. As of Q2 2013, we have included Level 2 and 3 support across the following controls that matter most in your Line-of-Business applications:

  • RadGridView
  • RadTreeListView
  • RadPropertyGrid
  • RadDataForm
  • RadDataPager
  • RadCarousel
  • RadDataFilter
  • RadCollectionNavigator

In case you are not aware of what each level does, let me summarize them for you:

Coded UI Levels 1 – 4:

  1. Level 1: Basic Record and Playback – This allows the recorder to record click events, identify elements, navigation and validation. This is all possible via the recorder dialog that pops up after you create a new Coded UI Test.
  2. Level 2: Rich Property Validation – This allows assertions on custom properties and the playback engine can validate properties during test run.
  3. Level 3: Code Generation – Special classes can be written for a control and the test code is more readable.
  4. Level 4: Intent Aware Actions – Recorder aggregates actions based on filter rules in Action filter, can record only intended steps based on control behavior and you can set information in table cells.

Please watch this short video for a quick introduction on how to get started using Coded UI Tests.

4. Built-in Chart Gallery with Just One-Click.

From your Visual Studio Toolbox, you can simply drag and drop a Chart onto your designer and get a SmartTag that allows you to select from a variety of pre-built charts as shown in Figure 6.

6

Figure 6: The Smart Tag that allows you to pick from a variety of Chart Types.

Upon selecting a chart type, the XAML will be auto-generated for you including design-time data support as shown in Figure 7.

7

Figure 7: The Bar Chart Type which is part of the RadControls for WPF and Silverlight.

As you can see, it is very easy to experiment with different chart types available in your WPF or Silverlight app without writing one line of code.

5. RadControls for WPF and Silverlight are Touch Friendly!

With more and more modern client apps being requested by customers with touch-screen, it only made sense for our control suites to support it. That is why we have not only invested in a brand new QSF that supports touch as shown in Figure 8, but a way to implement it very easily. 8

Figure 8: Easily switch to touch mode in our Quick Start Framework.

You can go from a Grid shown in Figure 9 to Figure 10 by using implicit styles pointed out in the beginning. Just select the Windows8Touch theme by scrolling down the project configuration wizard.

9

Figure 9: RadGridView using a non-touch friendly theme.

10

Figure 10: RadGridView using a touch friendly theme.

Notice how the header/rows are larger and the icons to filter the “First Name”, etc. can be easily touched. The font has also been adjusted to fill any empty spaces found in Figure 9.

More information on themes can be found here.

6. Bonus Feature! Tons of resources at your exposal!

  • At Telerik, we have listened to your request and have added additional resources to help your next WPF or Silverlight application.
  • XamlFlix – XAMLflix is your step-by-step guide to getting started with RadControls for Silverlight & WPF. Make your XAML development easier and more productive with this library of video tutorials covering the controls in the suite.
  • Patterns and Practices – From using Event-based setup, blend, MVVM light or Prism, we have you covered with “How-to” tutorials.
  • Localize your App with LocalizationManager! – Never limit your app to one language, see how easy it is to localize it with our LocalizationManager.
  • Consuming Data – Learn how to consume data using WCF, ADO.NET, Web Services and much more.
  • VS2013 compatibility Introduced with Q2 2013 SP1!

Conclusion

To recap the “5 Things I bet you didn’t know about RadControls for WPF and Silverlight”:

  1. Implicit Styling allows you to easily create custom themes.
  2. Easily add back Toolbox items with our toolbox configurator.
  3. Coded UI Support is available.
  4. Powerful Charts with Just one-click.
  5. Our controls are touch friendly.
  6. Bonus Feature! Resources, Resources and more Resources.

Even with that said, we have barely scratched the surface of what you get out-of-the-box with RadControls for WPF or Silverlight. I’d encourage to take a look around the product page and also check out two enterprise application dashboard that we have built with the full-source code available in your account. We’d also love to hear your feedback on what you would like to see in an upcoming release or what we can improve on. Please leave your feedback at http://www.telerik.com/feedback.aspx.

If you have any questions or comments, then please leave them below.

-Michael Crump (@mbcrump)

Get the most of XAML Download RadControls for WPF Download RadControls for Silverlight


MichaelCrump
About the Author

Michael Crump

is a Microsoft MVP, Pluralsight and MSDN author as well as an international speaker. He works at Telerik with a focus on everything mobile.  You can follow him on Twitter at @mbcrump or keep up with his various blogs by visiting his Telerik Blog or his Personal Blog.

Related Posts

Comments

Comments are disabled in preview mode.