or
I've got a listBox initialised with the following: lbxFunction.ItemsSource = Enum.GetValues(typeof(ChartAggregateFunction)); How do I disable certain ListBox items? I tried: ((RadListBoxItem)lbxFunction.Items[0]).IsEnabled = false; I get an error. Any solutions will be appreciated.
I played with the sample for the RadRibbon in MVVM.
There is an example of DataTemplate for the RadRibbonSplitButton.
However, the sample is not complete and does not show how to bind "Contextual" items of the RadRibbonSplitButton.
I tried this
<DataTemplate x:Key="MenuItemTemplate"> <TextBlock Text="{Binding Text}" /> </DataTemplate> <DataTemplate x:Key="SplitButtonTemplate"> <telerik:RadRibbonSplitButton Text="{Binding Text}" Size="{Binding Size}" SmallImage="{Binding SmallImage}" LargeImage="{Binding LargeImage}"> <telerik:RadRibbonSplitButton.DropDownContent> <telerik:RadContextMenu ItemTemplate="{StaticResource MenuItemTemplate}" ItemsSource="{Binding SplitSubButtons}" VerticalAlignment="Top"> <telerik:RadContextMenu.ItemContainerStyle> <Style TargetType="telerik:RadMenuItem"> <Setter Property="Icon"> <Setter.Value> <Image Source="{Binding Path=SmallImage}"/> </Setter.Value> </Setter> </Style> </telerik:RadContextMenu.ItemContainerStyle> </telerik:RadContextMenu> </telerik:RadRibbonSplitButton.DropDownContent> </telerik:RadRibbonSplitButton> </DataTemplate><telerik:RadRadialGauge Width="420" Height="300" telerik:StyleManager.Theme="Metro"> <telerik:RadialScale Min="0" Max="60" LabelRotationMode="None" LabelOffset="0.1" RangeLocation="Outside" MajorTickLocation="OverCenter" MajorTickBackground="#FFE7F1F6" MinorTickBackground="#FFE7F1F6" MiddleTickBackground="#FFE7F1F6" MajorTickStep="10" LabelLocation="Outside" Fill="#FFE7F1F6"> <telerik:RadialScale.Indicators> <telerik:BarIndicator x:Name="radialBar" Value="30" Background="#66bc29" telerik:ScaleObject.Location="Outside" telerik:ScaleObject.Offset="0.5" /> <telerik:Pinpoint Background="#79a9c0" BorderBrush="#FFF7F9FB" MinWidth="125" MinHeight="125" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" StrokeThickness="5" Margin="0" Padding="0" /> </telerik:RadialScale.Indicators> </telerik:RadialScale></telerik:RadRadialGauge>
<telerik:RadTimeline Height="80" PeriodStart="{Binding StartDate, Mode=TwoWay}" PeriodEnd="{Binding EndDate, Mode=TwoWay}" VisiblePeriodStart="{Binding VisibleStart, Mode=TwoWay}" VisiblePeriodEnd="{Binding VisibleEnd, Mode=TwoWay}" StartPath="Date" DurationPath="Duration" ItemsSource="{Binding Results}">private void InitTimeRange(){ StartDate = DateTime.Today; EndDate = StartDate.AddDays(1); DateTime now = DateTime.Now; VisibleStart = now.AddMinutes(-30); VisibleEnd = now.AddMinutes(30);}