Hi,
I am using the latest 2011 Q1 binaries and having issues with reordering my tab items on the tab control. I am using dynamic tab items (binding) within a MVVM architectural design. I have no issue with the tabs showing up and selecting between them and preserving the states between the tabs. However whenever I click and hold one tab and drag it over another tab all content is loss on all tabbed items? This did not happen in the previous 2010 Q4 binaries. Any thoughts on what may have changed their? Internally I see the observable collection is maintaining my items correctly. The header content is just fine as well.
Also last thing to note I in the previous release I used Expression Blend to edit/create the Telerik template to make some tweaks to the header. This caused the full blown recreation of all the styles inside the template for the radtab control. Should I have to "recreate" this with the new release? Could this be causing some of the issues?
Quick Update: After running this in VS 2010 in debug mode I do get the exception "Value does not fall within the expected range."
Another Update: I found out my issue. I had to update my ClearParent method to the following
private
static
void
ClearParent(FrameworkElement content)
{
if
(content !=
null
)
{
var parent = VisualTreeHelper.GetParent(content)
as
ContentPresenter;
if
(parent !=
null
)
{
parent.Content =
null
;
}
var parent2 = VisualTreeHelper.GetParent(content)
as
ContentControl;
if
(parent2 !=
null
)
{
parent2.Content =
null
;
}
}
}
Here is how I use it on my TabItem class.
public
FrameworkElement Content
{
get
{
ClearParent(_content);
return
_content;
}
set
{
_content = value;
FirePropertyChanged(
"Content"
);
}
}
This was what is was originally...
private
static
void
ClearParent(FrameworkElement content)
{
if
(content !=
null
)
{
if
(content.Parent !=
null
)
{
var contentPresenter = content.Parent
as
ContentPresenter;
if
(contentPresenter !=
null
)
{
contentPresenter.Content =
null
;
}
}
if
(content.Parent !=
null
)
{
var contentControl = content.Parent
as
ContentControl;
if
(contentControl !=
null
)
{
contentControl.Content =
null
;
}
}
}
}
Thanks and I hope this helps somebody out there.
Jake