在后面的代码中设置RadPane的PaneGroup

在后面的代码中设置RadPane的PaneGroup

本文介绍了在后面的代码中设置RadPane的PaneGroup?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在XAML中创建了一个带有rad窗格的窗格组,如下所示:

I had created a pane group with rad panes in my XAML as follows :

       <telerik:RadSplitContainer InitialPosition="DockedBottom" telerik:RadDocking.SerializationTag="RaddySplit">
              <telerik:RadPaneGroup telerik:RadDocking.SerializationTag="PaneGroup">
                 <telerik:RadPane Header="WW2 Adventure" telerik:RadDocking.SerializationTag="WW2">
                        <vws:ww2gamegrid  />
                 </telerik:RadPane>
                <telerik:RadPane Header="WW1 Adventure" telerik:RadDocking.SerializationTag="WW1">
                           <vws:ww1gamegrid  />
                </telerik:RadPane>
             </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>

这有一个问题,但是telerik RadDocking序列化中存在一个错误,例如,在部署时一个带有附加标签的网站,标签的数量将保存在客户端浏览器的隔离存储中。

This has a problem however, there is a bug in the telerik RadDocking Serialization, such that when you deploy a site with an additional tab, the number of tabs is maintained in the client's browsers isolated storage.

因此,当我尝试部署新的Silverlight页面时,请使用 WW3gamegrid (另一个 RadPane )中添加的用户仍然返回与上面相同的代码。

So, when I try and deploy my new Silverlight page, with "WW3gamegrid" added in (another RadPane) the user is still returned the same code as above.

在Google上进行了一下搜索,似乎在后面的代码中添加它可以解决我的问题。考虑到这一点,我如何在 .xaml中向此 RadPaneGroup 添加 RadPane .cs 后面有代码吗?

Having googled this a bit, it seems as if adding this in the code behind could solve my problem. With that in mind, how can I add a RadPane to this RadPaneGroup in my .xaml.cs code behind?

当然,任何其他解决该问题的方法都会很高兴:)

Any other solutions to the problem would of course, be gladly listened to :)

非常感谢。

我在后面的代码中的代码是从另一个网站上窃取的,因为我没有完全实现明白它。我已将其放入xaml.cs文件的构造函数中

The code I have in the code behind is stolen from another website, and not fully implemented as I don't understand it. I have put it in the constructor for the xaml.cs file

InitializeComponent();

 RadPane pane = new RadPane();
 pane.Title = "Pane2";
 pane.Header = "Pane2";
 pane.CanUserClose = false;
 pane.CanDockInDocumentHost = false;
 pane.Content = new Button() { Content = "button2" };
 pane.Tag = "tag";
 pane.PaneGroup();
 RadDocking.SetSerializationTag(pane, "abc");

从本质上讲,我该如何使其等同于我的xaml?

How can I make this equivalent to my xaml above, essentially?

推荐答案

要将RadPane添加到RadPaneGroup,只需使用 AddItem 方法(请参见)。

To add a RadPane to a RadPaneGroup just use the AddItem method (see Telerik documentation).

RadPaneGroup paneGroup = new RadPaneGroup();

RadPane pane = new RadPane();
pane.Header = "WW1 Adventure";
pane.Content = new ww1gamegrid();
paneGroup.AddItem(pane, Telerik.Windows.Controls.Docking.DockPosition.Center);

这篇关于在后面的代码中设置RadPane的PaneGroup?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 00:48