Add SF User Control as PanelManagerPage


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Is there any way that I can use an existing set of user controls as my pages collection of a panel manager?  I see where you can add an existing PanelManagerPage, but this only allows you to add pages that are already included in another PanelManager right?  Is there any way I can add a page as an existing user control??
Replies
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Also, the main thing I'd like to be able to do is use the BO Translations collection for keeping all of my BOs in sync for all of the different panels.  I would like to dynamically load each panel as I click the menu selection for it, but this would mean I basically have a bunch of blank pages. 

I am right now doing something like the following...is there a way to use the BO Translations outside of the panelmanager to translate between the main form and each user control??  This would solve my problem.

Public Overrides Sub PanelManager_PageActivated(ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.PanelPageEventArgs)
 
MyBase.PanelManager_PageActivated(e)
 
If PanelManager.CurrentPage.Controls.Count = 0 Then ActivateUserControl()
End Sub

Private Sub ActivateUserControl()
 
Dim control As UserControl = GetPageControlInstance()
  Control.Dock = Windows.Forms.DockStyle.Fill
 
PanelManager.CurrentPage.Controls.Add(control)
End Sub


StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
If you're adding the pages manually, then you can translate the business objects manually as well...

MicroFour.StrataFrame.UI.Windows.Forms.BusinessObjectTranslator.TranslateBusinessObjects(MyFormBO, MyUserControlBO, "MyUserControlBO", Me, Me.UserControl1)

You can also call it from within the user control if you want...

However, there is no "untranslate" for this method, so the business objects are translated until the form is disposed.

You can also create a BusinessObjectTranslationCollection and pass it to the BusinessObjectTranslator to perform all of the translations within the collection.  This method also has an Untranslate, so you can reverse the operation if necessary before you dispose of the form.  The first method is easier (since you don't have to create and manage the collection) and you generally don't ever need to untranslate a business object... you just want it to stay the same until you close and dispose of the form.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search