or
Hi,
in my application, I'm using Telerik theme "Office_BlueTheme" and the control HeaderedContentControl doesn't seem to be affected by the theme I choose, I mean, the header of the control stay gray instead of having a kind of blue like other Telerik controls I used.
Thank's
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Media; using Telerik.Windows.Controls; using Telerik.Windows.Controls.DragDrop; using Telerik.Windows.Controls.ScheduleView; namespace WpfApplication3 { public class ListBoxDragDropBehavior : Freezable { public static readonly DependencyProperty AppointmentTemplateProperty = DependencyProperty.Register("AppointmentTemplate", typeof(DataTemplate), typeof(ListBoxDragDropBehavior), null); public static readonly DependencyProperty EffectivePixelLengthProperty = DependencyProperty.Register("EffectivePixelLength", typeof(TimeSpan), typeof(ListBoxDragDropBehavior), null); public static readonly DependencyProperty EffectiveOrientationProperty = DependencyProperty.Register("EffectiveOrientation", typeof(Orientation), typeof(ListBoxDragDropBehavior), null); public static readonly DependencyProperty BehaviorProperty = DependencyProperty.RegisterAttached("Behavior", typeof(ListBoxDragDropBehavior), typeof(ListBoxDragDropBehavior), new PropertyMetadata(new PropertyChangedCallback(OnBehaviorChanged))); public DataTemplate AppointmentTemplate { get { return (DataTemplate)GetValue(AppointmentTemplateProperty); } set { SetValue(AppointmentTemplateProperty, value); } } public TimeSpan EffectivePixelLength { get { return (TimeSpan)GetValue(EffectivePixelLengthProperty); } set { SetValue(EffectivePixelLengthProperty, value); } } public Orientation EffectiveOrientation { get { return (Orientation)GetValue(EffectiveOrientationProperty); } set { SetValue(EffectiveOrientationProperty, value); } } public static ListBoxDragDropBehavior GetBehavior(DependencyObject obj) { return (ListBoxDragDropBehavior)obj.GetValue(BehaviorProperty); } public static void SetBehavior(DependencyObject obj, ListBoxDragDropBehavior value) { obj.SetValue(BehaviorProperty, value); } protected override Freezable CreateInstanceCore() { return new ListBoxDragDropBehavior(); } private static void OnBehaviorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { System.Windows.Controls.ListBox listBox = d as System.Windows.Controls.ListBox; if (listBox == null) { return; } ListBoxDragDropBehavior behavior = (ListBoxDragDropBehavior)e.OldValue; if (behavior != null) { RadDragAndDropManager.RemoveDragQueryHandler(listBox, new EventHandler<DragDropQueryEventArgs>(behavior.OnDragQuery)); RadDragAndDropManager.RemoveDropQueryHandler(listBox, new EventHandler<DragDropQueryEventArgs>(behavior.OnDropQuery)); RadDragAndDropManager.RemoveDropInfoHandler(listBox, new EventHandler<DragDropEventArgs>(behavior.OnDropInfo)); } behavior = (ListBoxDragDropBehavior)e.NewValue; if (behavior != null) { RadDragAndDropManager.SetAllowDrop(listBox, true); RadDragAndDropManager.AddDragQueryHandler(listBox, new EventHandler<DragDropQueryEventArgs>(behavior.OnDragQuery)); RadDragAndDropManager.AddDropQueryHandler(listBox, new EventHandler<DragDropQueryEventArgs>(behavior.OnDropQuery)); RadDragAndDropManager.AddDropInfoHandler(listBox, new EventHandler<DragDropEventArgs>(behavior.OnDropInfo)); } } private void OnDragQuery(object sender, DragDropQueryEventArgs e) { if (e.Options.Status == DragStatus.DragQuery) { System.Windows.Controls.ListBox listbox = sender as System.Windows.Controls.ListBox; IList<IOccurrence> appointments = listbox.SelectedItems.OfType<IOccurrence>().ToList(); if (appointments.Count == 0) { return; } e.Options.DragCue = this.CreateDragCue(appointments); e.Options.Payload = new ScheduleViewDragDropPayload(listbox.ItemsSource, appointments); } e.QueryResult = true; } private void OnDropQuery(object sender, DragDropQueryEventArgs e) { e.QueryResult = e.Options.Payload is ScheduleViewDragDropPayload; } private void OnDropInfo(object sender, DragDropEventArgs e) { System.Windows.Controls.ListBox listBox = sender as System.Windows.Controls.ListBox; if (e.Options.Status == DragStatus.DropPossible) { RadDragAndDropManager.Options.Effects = DragDropEffects.All; RadDragAndDropManager.Options.CurrentCursor = System.Windows.Input.Cursors.Arrow; } //If the user has dropped - and the drag was made FROM the scheduleview TO the listbox if (e.Options.Status == DragStatus.DropComplete && !listBox.IsAncestorOf(e.Options.Source)) { ScheduleViewDragDropPayload payload = e.Options.Payload as ScheduleViewDragDropPayload; if (payload != null) { (payload.SourceAppointmentsSource as IList).RemoveAll((object i) => payload.DraggedAppointments.OfType<object>().Contains(i)); (listBox.ItemsSource as IList).AddRange(payload.DraggedAppointments); } } } private ContentControl CreateDragCue(IEnumerable<IOccurrence> appointments) { bool isHorizontal = this.EffectiveOrientation == Orientation.Horizontal; double ticksPerPixel = this.EffectivePixelLength.Ticks; StackPanel panel = new StackPanel(); panel.Orientation = this.EffectiveOrientation; panel.Background = new SolidColorBrush() { Color = Colors.Transparent }; foreach (IOccurrence appointment in appointments) { double lenght = appointment.Duration().Ticks / ticksPerPixel; AppointmentCueItem item = new AppointmentCueItem(); item.HorizontalContentAlignment = HorizontalAlignment.Stretch; item.VerticalContentAlignment = VerticalAlignment.Stretch; item.Height = isHorizontal ? 110 : lenght; item.Width = isHorizontal ? lenght : 110; item.Content = appointment; item.ContentTemplate = this.AppointmentTemplate; panel.Children.Add(item); } ContentControl cue = new ContentControl(); cue.Content = panel; return cue; } } }
<telerik:RadScheduleView Name="radScheduleView1" EditAppointmentDialogStyle="{StaticResource EditAppointmentDialogStyle}" Grid.Column="1" AppointmentItemContentTemplate="{StaticResource AppointmentItemContentTemplate}" GroupHeaderContentTemplateSelector="{StaticResource GroupHeaderContentTemplateSelector}"> <telerik:RadScheduleView.ViewDefinitions> <my:DayViewDefinition /> <my:WeekViewDefinition /> <my:MonthViewDefinition /> <my:TimelineViewDefinition /> </telerik:RadScheduleView.ViewDefinitions> <scheduleView:RadScheduleView.GroupDescriptionsSource> <scheduleView:GroupDescriptionCollection> <scheduleView:ResourceGroupDescription ResourceType="Operatives" /> </scheduleView:GroupDescriptionCollection> </scheduleView:RadScheduleView.GroupDescriptionsSource> </telerik:RadScheduleView> <ListBox AllowDrop="True" ItemsSource="{Binding}" Name="listBox1" ItemContainerStyle="{StaticResource ListBoxItemContainerStyle}" ItemTemplate="{StaticResource ListBoxItemTemplate}" SelectionMode="Extended" HorizontalAlignment="Left" Width="270"> <local:ListBoxDragDropBehavior.Behavior> <local:ListBoxDragDropBehavior EffectivePixelLength="{Binding EffectivePixelLength, ElementName=radScheduleView1}" EffectiveOrientation="{Binding EffectiveOrientation, ElementName=radScheduleView1}" AppointmentTemplate="{Binding DragVisualCueItemTemplate, ElementName=radScheduleView1}" /> </local:ListBoxDragDropBehavior.Behavior> <ListBox.Background> <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0"> <GradientStop Color="#FF4B4B4B" Offset="1" /> <GradientStop Color="#FF6E6E6E" /> </LinearGradientBrush> </ListBox.Background> </ListBox>
RadRibbonButton button =
new
RadRibbonButton();
ImageSource imgs = ResourceLoader.GetResourceImage(buttonModel.AssemblyViewFileName, buttonModel.ButtonIconResourceName);
button.LargeImage = imgs;
button.Size = Telerik.Windows.Controls.RibbonView.ButtonSize.Large;
button.HorizontalContentAlignment = System.Windows.HorizontalAlignment.Center;
button.VerticalContentAlignment = System.Windows.VerticalAlignment.Center;
<
telerikRibbon:RadRibbonGroup
Header
=
"Common"
>
<
telerikRibbon:RadRibbonButton
Text
=
"Home"
LargeImage
=
"/Resources/Home32.png"
Width
=
"70"
Size
=
"Large"
HorizontalContentAlignment
=
"Center"
/>
</
telerikRibbon:RadRibbonGroup
>
<
ti:RadComboBox
Name
=
"CodeComboBox"
Margin
=
"5,0,0,0"
MinWidth
=
"80"
tc:StyleManager.Theme
=
"Office_Blue"
IsEditable
=
"True"
ItemsSource
=
"{Binding DataView}"
DisplayMemberPath
=
"{Binding DisplayColumnName}"
SelectedValuePath
=
"{Binding KeyColumnName}"
SelectedItem
=
"{Binding SelectedView}">
<
ti:RadComboBox.SelectionBoxTemplate
>
<
DataTemplate
>
<
TextBox
Text
=
"Hows it going"
Background
=
"Green"
/>
</
DataTemplate
>
</
ti:RadComboBox.SelectionBoxTemplate
>
</
ti:RadComboBox
>
Am I doing something wrong?
ID Name ParentID
1 John NULL ** Top level node **
2 Chris 1 ** Parent is John **
3 Simon NULL ** Top level node **
4 Dave 1 ** parent is John **
5 Joe 3 ** parent is simon **
<
telerik:RadTreeListView
x:Name
=
"ParksTreeListView"
AutoGenerateColumns
=
"False"
IsFilteringAllowed
=
"True"
IsBusy
=
"False"
>
<
telerik:RadTreeListView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ID}"
Header
=
"ID"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Name}"
Header
=
"Name"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ParentID}"
Header
=
"Parent"
/>
</
telerik:RadTreeListView.Columns
>
</
telerik:RadTreeListView
>
'Get parks information from SQL database
Dim
parksList
As
ObservableCollection(Of ParksTree) = ParksDB.GetAllParks()
'Set Tree items source
ParksTreeListView.ItemsSource = parksList