or
<
RadSlider
Minimum
=
"-10"
Maximum
=
"50"
SelectionStart
=
"{Binding Path=CappedMinBitrate, Mode=TwoWay}"
SelectionEnd
=
"{Binding Path=CappedMaxBitrate, Mode=TwoWay}"
IsSelectionRangeEnabled
=
"True"
/>
I was not able to find any sample. I am wondering if there is any good sample. I want to be able to update frame.source based on selected items of the treeview. I generate all content with XMLDataprovider. Thank you in advance!
XAML:
<
Window
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
x:Class
=
"TwoListboxes_2.MainWindow"
xmlns:local
=
"clr-namespace:TwoListboxes_2"
Title
=
"MainWindow"
Width
=
"1000"
Height
=
"700"
>
<
Window.Resources
>
<
local:UriConverter
x:Key
=
"UriConverter"
/>
<
XmlDataProvider
x:Key
=
"PageData"
XPath
=
"/Pages"
Source
=
"Data/data.xml"
/>
<
HierarchicalDataTemplate
DataType
=
"Page"
ItemsSource
=
"{Binding XPath=Level2}"
>
<
TextBlock
FontWeight
=
"Bold"
Text
=
"{Binding XPath=@Name}"
/>
</
HierarchicalDataTemplate
>
<
HierarchicalDataTemplate
DataType
=
"Level2"
ItemsSource
=
"{Binding XPath=Level3}"
>
<
TextBlock
Foreground
=
"Red"
Text
=
"{Binding XPath=@Name}"
/>
</
HierarchicalDataTemplate
>
<
DataTemplate
DataType
=
"Level3"
>
<
TextBlock
FontStyle
=
"Italic"
Text
=
"{Binding XPath=@Name}"
/>
</
DataTemplate
>
</
Window.Resources
>
<
Grid
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Top"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"215"
/>
<
ColumnDefinition
Width
=
"1"
/>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
Grid
>
<
Border
HorizontalAlignment
=
"Left"
>
<
telerik:RadTreeView
x:Name
=
"Nav_ListBox"
ItemsSource
=
"{Binding Source={StaticResource PageData}, XPath=Page}"
SelectedValuePath
=
"@UriSource"
/>
</
Border
>
</
Grid
>
<
Frame
Grid.Column
=
"2"
x:Name
=
"ContentFrame"
JournalOwnership
=
"OwnsJournal"
NavigationUIVisibility
=
"Visible"
Width
=
"Auto"
Source
=
"{Binding SelectedValuePath, Converter={StaticResourXML:ce UriConverter}, ElementName=Nav_ListBox, Mode=TwoWay}"
/>
</
Grid
>
</
Window
>
XML:
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<
Pages
>
<
Page
Name
=
"Name 1"
UriSource
=
"Pages/Name1.xaml"
/>
<
Page
Name
=
"Name 2"
UriSource
=
"Pages/Name2.xaml"
>
<
Level2
Name
=
"ALL1"
UriSource
=
"Pages/All1.xaml"
/>
<
Level2
Name
=
"ALL2"
UriSource
=
"Pages/All2.xaml"
/>
<
Level2
Name
=
"ALL3"
UriSource
=
"Pages/All3.xaml"
/>
</
Page
>
<
Page
Name
=
"Name 3"
UriSource
=
"Pages/Name3.xaml"
>
<
Level2
Name
=
"ALL4"
UriSource
=
"Pages/All1.xaml"
>
<
Level3
Name
=
"ALL3_1"
UriSource
=
"Pages/All1.xaml"
/>
<
Level3
Name
=
"ALL3_2"
UriSource
=
"Pages/All2.xaml"
/>
<
Level3
Name
=
"ALL3_3"
UriSource
=
"Pages/All3.xaml"
/>
</
Level2
>
<
Level2
Name
=
"ALL5"
UriSource
=
"Pages/All2.xaml"
/>
<
Level2
Name
=
"ALL6"
UriSource
=
"Pages/All3.xaml"
/>
</
Page
>
<
Page
Name
=
"Name 4"
UriSource
=
"Pages/Name4.xaml"
/>
</
Pages
>
<
local:CardControl
>
<
Button
Content
=
"Hello"
/>
<
Button
Content
=
"Hello"
/>
</
local:CardControl
>
[ContentProperty(
"Items"
)]
[ContentWrapper(
typeof
(Collection<UIElement>))]
public
class
CardControl : RadTransitionControl
{
public
static
readonly
DependencyProperty ItemsProperty =
DependencyProperty.Register(
"Items"
,
typeof
(Collection<UIElement>),
typeof
(CardControl),
new
FrameworkPropertyMetadata(
new
Collection<UIElement>(),
FrameworkPropertyMetadataOptions.AffectsRender
, OnItemsChanged));
public
Collection<UIElement> Items
{
get
{
return
(Collection<UIElement>)GetValue(ItemsProperty); }
set
{
SetValue(ItemsProperty, value);
}
}
public
CardControl()
{
}
private
static
void
OnItemsChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs eventArgs)
{
(dependencyObject
as
CardControl).Content = (eventArgs.NewValue
as
Collection<UIElement>)[0];
}
}
at Telerik.Windows.Controls.RadTickBar.LoadTemplate(Double tickValue)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP1\Sources\Development\Core\Controls\Slider\RadTickBar.cs:line 402
at Telerik.Windows.Controls.RadTickBar.CreateTick(Double tickValue)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP1\Sources\Development\Core\Controls\Slider\RadTickBar.cs:line 352
at Telerik.Windows.Controls.RadTickBar.DrawTicks()
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP1\Sources\Development\Core\Controls\Slider\RadTickBar.cs:line 231
at Telerik.Windows.Controls.RadTickBar.OnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP1\Sources\Development\Core\Controls\Slider\RadTickBar.cs:line 315
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
at System.Windows.StyleHelper.InvalidatePropertiesOnTemplateNode(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, Boolean isDetach, FrameworkElementFactory templateRoot)
at System.Windows.StyleHelper.ClearTemplateChain(HybridDictionary[] instanceData, FrameworkElement feContainer, FrameworkContentElement fceContainer, List`1 templateChain, FrameworkTemplate oldFrameworkTemplate)
at System.Windows.StyleHelper.ClearGeneratedSubTree(HybridDictionary[] instanceData, FrameworkElement feContainer, FrameworkContentElement fceContainer, FrameworkTemplate oldFrameworkTemplate)
at System.Windows.StyleHelper.DoTemplateInvalidations(FrameworkElement feContainer, FrameworkTemplate oldFrameworkTemplate)
at System.Windows.StyleHelper.UpdateTemplateCache(FrameworkElement fe, FrameworkTemplate oldTemplate, FrameworkTemplate newTemplate, DependencyProperty templateProperty)
at System.Windows.Controls.Control.OnTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
at System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject container, FrugalStructList`1& exclusionContainerDependents, FrugalStructList`1& oldContainerDependents, FrugalStructList`1& newContainerDependents)
at System.Windows.StyleHelper.DoStyleInvalidations(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle)
at System.Windows.StyleHelper.UpdateStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle, Style& styleCache)
at System.Windows.FrameworkElement.OnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
at System.Windows.FrameworkElement.UpdateStyleProperty()
at System.Windows.FrameworkElement.InvalidateTreeDependentProperties(TreeChangeInfo parentTreeState, Boolean isSelfInheritanceParent)
at System.Windows.FrameworkElement.OnAncestorChangedInternal(TreeChangeInfo parentTreeState)
at System.Windows.TreeWalkHelper.OnAncestorChanged(FrameworkElement fe, FrameworkContentElement fce, TreeChangeInfo info)
at System.Windows.TreeWalkHelper.OnAncestorChanged(DependencyObject d, TreeChangeInfo info)
at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d)
at MS.Internal.PrePostDescendentsWalker`1._VisitNode(DependencyObject d)
at System.Windows.DescendentsWalker`1.VisitNode(FrameworkElement fe)
at System.Windows.DescendentsWalker`1.VisitNode(DependencyObject d)
at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d)
at MS.Internal.PrePostDescendentsWalker`1._VisitNode(DependencyObject d)
at System.Windows.DescendentsWalker`1.VisitNode(FrameworkElement fe)
at System.Windows.DescendentsWalker`1.VisitNode(DependencyObject d)
at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d)
at MS.Internal.PrePostDescendentsWalker`1._VisitNode(DependencyObject d)
at System.Windows.DescendentsWalker`1.VisitNode(FrameworkElement fe)
at System.Windows.DescendentsWalker`1.VisitNode(DependencyObject d)
at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
at System.Windows.DescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)
at MS.Internal.PrePostDescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)
at System.Windows.TreeWalkHelper.InvalidateOnTreeChange(FrameworkElement fe, FrameworkContentElement fce, DependencyObject parent, Boolean isAddOperation)
at System.Windows.FrameworkElement.OnVisualParentChanged(DependencyObject oldParent)
at System.Windows.Media.Visual.FireOnVisualParentChanged(DependencyObject oldParent)
at System.Windows.Media.Visual.RemoveVisualChild(Visual child)
at System.Windows.Media.VisualCollection.DisconnectChild(Int32 index)
at System.Windows.Media.VisualCollection.RemoveRange(Int32 index, Int32 count)
at System.Windows.Controls.UIElementCollection.RemoveRangeInternal(Int32 index, Int32 count)
at System.Windows.Controls.Panel.removeChildren(GeneratorPosition pos, Int32 containerCount)
at System.Windows.Controls.Panel.OnItemsChangedInternal(Object sender, ItemsChangedEventArgs args)
at System.Windows.Controls.Panel.OnItemsChanged(Object sender, ItemsChangedEventArgs args)
at System.Windows.Controls.ItemContainerGenerator.OnItemRemoved(Object item, Int32 itemIndex)
at System.Windows.Controls.ItemContainerGenerator.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
at System.Windows.Controls.ItemContainerGenerator.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
at System.Windows.Controls.ItemCollection.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
at MS.Internal.Controls.InnerItemCollectionView._RemoveAt(Int32 index, Int32 indexR, Object item)
at MS.Internal.Controls.InnerItemCollectionView.RemoveAt(Int32 index)
at System.Windows.Controls.ItemCollection.RemoveAt(Int32 removeIndex)
at Telerik.Windows.Controls.RadTickBar.LoadTemplate(Double tickValue) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP1\Sources\Development\Core\Controls\Slider\RadTickBar.cs:line 402
at Telerik.Windows.Controls.RadTickBar.CreateTick(Double tickValue) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP1\Sources\Development\Core\Controls\Slider\RadTickBar.cs:line 352
at Telerik.Windows.Controls.RadTickBar.DrawTicks() in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP1\Sources\Development\Core\Controls\Slider\RadTickBar.cs:line 231
at Telerik.Windows.Controls.RadSlider.RedrawTicks() in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP1\Sources\Development\Core\Controls\Slider\RadSlider.cs:line 2904
at Telerik.Windows.Controls.RadSlider.OnMaximumChanged(Double oldMaximum, Double newMaximum) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP1\Sources\Development\Core\Controls\Slider\RadSlider.cs:line 1448
at System.Windows.Controls.Primitives.RangeBase.OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
at System.Windows.Data.BindingExpression.Invalidate(Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.Activate(Object item)
at System.Windows.Data.BindingExpression.OnDataContextChanged(DependencyObject contextElement)
at System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
at System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
at System.Windows.TreeWalkHelper.OnInheritablePropertyChanged(DependencyObject d, InheritablePropertyChangeInfo info)
at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d)
at System.Windows.DescendentsWalker`1.VisitNode(FrameworkElement fe)
at System.Windows.DescendentsWalker`1.VisitNode(DependencyObject d)
at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d)
at System.Windows.DescendentsWalker`1.VisitNode(FrameworkElement fe)
at System.Windows.DescendentsWalker`1.VisitNode(DependencyObject d)
at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
at System.Windows.DescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)
at System.Windows.TreeWalkHelper.InvalidateOnInheritablePropertyChange(FrameworkElement fe, FrameworkContentElement fce, InheritablePropertyChangeInfo info, Boolean skipStartNode)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at System.Windows.FrameworkElement.set_DataContext(Object value)