or
| <telerik:RadGridView x:Name="SettingsGrid" ItemsSource="{Binding ElementName=UC, Path=CurrentSettingList}" ScrollMode="RealTime" |
| AutoGenerateColumns="False" ShowGroupPanel="False" IsFilteringAllowed="False" ColumnsWidthMode="Fill" ShowColumnHeaders="False" |
| CanUserFreezeColumns="False" CanUserReorderColumns="False" CanUserSortColumns="False" VerticalGridlinesVisibility="Hidden" |
| Margin="4,2,4,2" Loaded="SettingsGrid_Loaded"> |
| public Example() |
| { |
| InitializeComponent(); |
| this.sampleRadCarousel.ItemsSource = DAL.GetCustomers(); |
| this.sampleRadCarousel.Loaded += new RoutedEventHandler(sampleRadCarousel_Loaded); |
| } |
| void sampleRadCarousel_Loaded(object sender, RoutedEventArgs e) |
| { |
| Path path = CreateLinePath(); |
| Telerik.Windows.Controls.RadCarouselPanel panel = this.sampleRadCarousel.FindCarouselPanel(); |
| panel.ItemsPerPage = 7; |
| panel.Path = path; |
| } |

| <UserControl x:Class="WpfTest_Telerik.UserControl1" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
| Width="300" Height="300"> |
| <UserControl.Resources> |
| <Style x:Key="MajorTickStyle" TargetType="{x:Type telerik:TickProperties}"> |
| <Setter Property="Background" Value="White" /> |
| <Style.Triggers> |
| <Trigger Property="IsEnabled" Value="False"> |
| <Setter Property="Background" Value="Black" /> |
| </Trigger> |
| </Style.Triggers> |
| </Style> |
| <Style x:Key="LabelProperties" TargetType="{x:Type telerik:LabelProperties}"> |
| <Setter Property="Foreground" Value="White" /> |
| <Style.Triggers> |
| <Trigger Property="IsEnabled" Value="False"> |
| <Setter Property="Foreground" Value="Black" /> |
| </Trigger> |
| </Style.Triggers> |
| </Style> |
| </UserControl.Resources> |
| <Grid> |
| <telerik:RadGauge> |
| <telerik:RadialGauge> |
| <telerik:RadialScale> |
| <telerik:RadialScale.MajorTick> |
| <telerik:TickProperties IsEnabled="{Binding Path=IsActive}" Style="{StaticResource MajorTickStyle}"/> |
| </telerik:RadialScale.MajorTick> |
| <telerik:RadialScale.Label > |
| <telerik:LabelProperties IsEnabled="{Binding Path=IsActive}" Style="{StaticResource LabelProperties}" /> |
| </telerik:RadialScale.Label> |
| </telerik:RadialScale> |
| </telerik:RadialGauge> |
| </telerik:RadGauge> |
| </Grid> |
| </UserControl> |
| using System.Windows.Controls; |
| namespace WpfTest_Telerik |
| { |
| /// <summary> |
| /// Interaction logic for UserControl1.xaml |
| /// </summary> |
| public partial class UserControl1 : UserControl |
| { |
| public UserControl1() |
| { |
| // will work |
| //DataContext = new UserControl1ViewModel(); |
| InitializeComponent(); |
| // will not work |
| DataContext = new UserControl1ViewModel(); |
| } |
| } |
| } |
| using System; |
| using System.Windows; |
| using System.Timers; |
| using System.Windows.Threading; |
| namespace WpfTest_Telerik |
| { |
| public class UserControl1ViewModel : DependencyObject |
| { |
| private readonly Dispatcher _currentDispatcher; |
| public UserControl1ViewModel() |
| { |
| _currentDispatcher = Dispatcher.CurrentDispatcher; |
| var timer = new Timer(2000); |
| timer.Elapsed += TimerElapsed; |
| timer.Start(); |
| } |
| void TimerElapsed(object sender, ElapsedEventArgs e) |
| { |
| Action x = () => IsActive = !IsActive; |
| _currentDispatcher.BeginInvoke(x); |
| } |
| public bool IsActive |
| { |
| get { return (bool)GetValue(IsActiveProperty); } |
| set { SetValue(IsActiveProperty, value); } |
| } |
| // Using a DependencyProperty as the backing store for IsActive. This enables animation, styling, binding, etc... |
| public static readonly DependencyProperty IsActiveProperty = |
| DependencyProperty.Register("IsActive", typeof(bool), typeof(UserControl1ViewModel), new UIPropertyMetadata(false)); |
| } |
| } |