This is a migrated thread and some comments may be shown as answers.

RadPanelBar RegionAdapter for PRISM

7 Answers 162 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Mark Shaw
Top achievements
Rank 1
Mark Shaw asked on 01 Mar 2010, 10:30 PM
Been trying to port the RadTabControlRegionAdapter to something similiar for the RadPanelBar but without luck.

If I add control directly to the RadPanelBar, all is well... just when databinding (in this case to Region.ActiveViews) the generated RadPanelBarItems are not pulling in the View content.

As you can see... nothing special in my code.

<telerikNavigation:RadPanelBar  
                DisplayMemberPath="DataContext.Report.Name" 
                Regions:RegionManager.RegionName="WorkspaceRegion"  
                ItemContainerStyle="{StaticResource RadPanelBarItemStyle1}" 
                > 
            </telerikNavigation:RadPanelBar> 

-Mark


7 Answers, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 02 Mar 2010, 01:27 PM
Hello Mark,

Without taking a look at your custom region adapter I won't be able to find the reason for the issue you have. Besides, the RadPanelBar is a bindable ItemsControl and I suspect the region adapter may not be needed at all. Can you please describe in more detail what exactly is the scenario you want to implement?

Kind regards,
Tihomir Petkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mark Shaw
Top achievements
Rank 1
answered on 02 Mar 2010, 01:57 PM
Thanks for the reply!

Similar to how PRISM regions work... I created an example containing a list of user controls of type FooUserControl. This is then bound to the RadPanelBar. The question is how does one route the user control into the contents of a RadPanelBarItem?. Also... the layout of the panels is odd. The expander buttons are being distributed across the form for some reason.

The following are the files that complete the solution.

MainPage.cs
#region 
 
using System.Collections.Generic; 
using System.Windows.Controls; 
#endregion 
 
namespace RadPanelBarTest 
    public partial class MainPage 
    { 
        public MainPage() 
        { 
            // Required to initialize variables 
            InitializeComponent(); 
 
            var list = new List<FooUserControl>(); 
 
            for (var i = 0; i < 5; i++) 
                list.Add(new FooUserControl {Name = "Panel " + i}); 
 
            RadPanelBar.ItemsSource = list; 
        } 
    } 

MainPage.xaml
<UserControl 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    x:Class="RadPanelBarTest.MainPage" 
    Width="640" Height="480"
 
    <Grid x:Name="LayoutRoot" Background="White"
        <telerikNavigation:RadPanelBar  
            DisplayMemberPath="Name" 
            x:Name="RadPanelBar"  
            VerticalAlignment="Stretch"/> 
    </Grid> 
</UserControl> 


FooUserControl.cs
#region 
 
using System.Windows; 
using System.Windows.Controls; 
#endregion 
 
namespace RadPanelBarTest 
    public partial class FooUserControl 
    { 
        public static readonly DependencyProperty NameProperty = 
            DependencyProperty.Register("Name"typeof (string), typeof (FooUserControl), null); 
 
        public FooUserControl() 
        { 
            // Required to initialize variables 
            InitializeComponent(); 
        } 
 
        public string Name 
        { 
            get { return (string) GetValue(NameProperty); } 
            set { SetValue(NameProperty, value); } 
        } 
 
         
    } 

FooUserControl.xaml
<UserControl 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" 
    x:Class="RadPanelBarTest.FooUserControl" 
    d:DesignWidth="640" d:DesignHeight="480"
 
    <Grid x:Name="LayoutRoot"
        <Ellipse Fill="White" Stroke="Black" Height="71" HorizontalAlignment="Left" Margin="174,104,0,0" VerticalAlignment="Top" Width="74"/> 
        <Ellipse Fill="White" Stroke="Black" Height="71" HorizontalAlignment="Right" Margin="0,104,225,0" VerticalAlignment="Top" Width="71"/> 
        <Ellipse Fill="White" Stroke="Black" Margin="263,168,309,0" Height="68" VerticalAlignment="Top"/> 
        <Ellipse Fill="Black" Stroke="Black" Height="27" HorizontalAlignment="Left" Margin="201,148,0,0" VerticalAlignment="Top" Width="27"/> 
        <Ellipse Fill="Black" Stroke="Black" Height="27" HorizontalAlignment="Right" Margin="0,148,251,0" VerticalAlignment="Top" Width="27"/> 
        <Path Fill="Black" Stretch="Fill" Stroke="Black" Height="36.106" Margin="142.5,0,162.5,174.394" VerticalAlignment="Bottom" UseLayoutRounding="False" Data="M109,270 C230,332 368,293 368,293 L443,273.99994"/> 
        <Path Stretch="Fill" Stroke="Black" Height="30.071" Margin="168.5,0,192.5,177.394" VerticalAlignment="Bottom" UseLayoutRounding="False" Data="M109,270 C230,332 368,293 368,293 L443,273.99994" Fill="White"/> 
    </Grid> 
</UserControl> 

0
Tihomir Petkov
Telerik team
answered on 02 Mar 2010, 04:31 PM
Hi Mark,

Thanks for the details, I now see your problem. The PanelBar is a hierarchical ItemsControl, so each item in its ItemsSource will be dynamically wrapped in a PanelBarItem. The rendering of your business objects is determined by the DataTemplate you specify. The key point here is that the content of each data item will be rendered in the header of the dynamically created PanelBarItem that wraps it. This is because the control is hierarchical in nature and its items have some content (rendered in an item's header) and a set of subitems (rendered as such below the header). From your explanation I see that you want to have the ellipses from your custom UserControl to be rendered below a PanelBarItem's header. However, keeping in mind the hierarchical nature of the control, this would require you to transform your current list of items to a hierarchical such. This can be done in several ways, but as you are probably aware by now, this would require some fiddling with the structure of your original data.

I would suggest that you take a look at our OutlookBar control which is quite similar to the PanelBar, but is not hierarchical and may be more suitable to your scenario. Please consider it and let me know if you want to use it instead of the PanelBar. In case you still want to use the PanelBar, let me know and I will create an example for you.

Best wishes,
Tihomir Petkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mark Shaw
Top achievements
Rank 1
answered on 02 Mar 2010, 04:55 PM
Hey! Thanks for the response. We may be chasing a rabbit on this one. I apologize (pushing the limits i guess).

Here is what I was trying to build... a horizontally orientated control, with multiple open panels and with the rad html place holder in each one. Imagine a whole bunch of enterprise reports (in java, html, silverlight, asp.net... ) with users sliding things in and out running comparisons. Could be super cool since our our users have up to 3 monitors.

The outlook bar is great (using it to invoke these reports) but doesn't provide the orientation or multiple selections that the panel bar provides.

The rub however is that the html host control appears to behave oddly when used in the horizontally oriented panel bars.

We could close this one out... unless you can create such a solution lol.

Big thanks either way.
0
Tihomir Petkov
Telerik team
answered on 03 Mar 2010, 09:15 AM
Hello Mark,

Actually while investigating the scenario I found that there is a bug in the HtmlPlaceholder when used in a horizontal PanelBar. I scheduled it for fixing and added 1000 Telerik points to your account. Thank you for your feedback.

Sincerely yours,
Tihomir Petkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mark Shaw
Top achievements
Rank 1
answered on 03 Mar 2010, 01:48 PM
Very Cool! Hosting HTML content in Silverlight is not much more than a glorious hack but has real world value.

I look foward to a fix for this cuz what I envision is super cool.

-mark
0
Tihomir Petkov
Telerik team
answered on 03 Mar 2010, 02:29 PM
Hi Mark,

We haven't scheduled the fix for a particular release yet, since is is a few days before our 2010 Q1 release, but we will work on it soon after that.

Greetings,
Tihomir Petkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
PanelBar
Asked by
Mark Shaw
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
Mark Shaw
Top achievements
Rank 1
Share this question
or