You can customize the PageGroup's advanced settings in the designer's 'Content Containers' page. For instance you can change the PageGroup's caption and animation effects that occur when switching between Documents. To do so, go to the mentioned designer's section and set the IDocumentSelectorDefaultProperties.SwitchDocumentAnimationMode property to the desired value. Additionally, you can specify the IDocumentSelectorDefaultProperties.SwitchDocumentAnimationFrameInterval and IDocumentSelectorDefaultProperties.SwitchDocumentAnimationFramesCount properties to set the desired animation quality and duration.
You can also set appearance options in the designer's 'Appearance' page.
This section demonstrates how to create the example in code. Because of automatic Tiles and TileContainer generation (see step 6), we have to use the WindowsUIView.QueryStartupContentContainer to set an application start-up container.
C# |
private void windowsUIView1_QueryStartupContentContainer(object sender, DevExpress.XtraBars.Docking2010.Views.WindowsUI.QueryContentContainerEventArgs e) {
WindowsUIView view = sender as WindowsUIView;
DevExpress.XtraBars.Docking2010.Views.WindowsUI.Document doc1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.Document() { Caption = "Document 1" };
DevExpress.XtraBars.Docking2010.Views.WindowsUI.Document doc2 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.Document() { Caption = "Document 2" };
view.Documents.AddRange(new DevExpress.XtraBars.Docking2010.Views.WindowsUI.Document[] { doc1, doc2 });
DevExpress.XtraBars.Docking2010.Views.WindowsUI.PageGroup pageGroup1 = new DevExpress.XtraBars.Docking2010.Views.WindowsUI.PageGroup();
pageGroup1.Items.AddRange(new DevExpress.XtraBars.Docking2010.Views.WindowsUI.Document[] { doc1, doc2 });
view.ContentContainers.Add(pageGroup1);
pageGroup1.Caption = "Page Group";
pageGroup1.Properties.SwitchDocumentAnimationMode = TransitionAnimation.VerticalSlide;
view.AppearanceCaption.ForeColor = System.Drawing.Color.OrangeRed;
e.ContentContainer = pageGroup1;
}
private void windowsUIView1_QueryControl(object sender, DevExpress.XtraBars.Docking2010.Views.QueryControlEventArgs e) {
WindowsUIView view = sender as WindowsUIView;
if (e.Document == view.Documents[0]) {
e.Control = new RichEditControl() { Text = "Text 1" };
}
else e.Control = new RichEditControl() { Text = "Text 2" };
}
|
VB |
Private Sub windowsUIView1_QueryStartupContentContainer(ByVal sender As Object, ByVal e As DevExpress.XtraBars.Docking2010.Views.WindowsUI.QueryContentContainerEventArgs)
Dim view As WindowsUIView = TryCast(sender, WindowsUIView)
Dim doc1 As New DevExpress.XtraBars.Docking2010.Views.WindowsUI.Document() With {.Caption = "Document 1"}
Dim doc2 As New DevExpress.XtraBars.Docking2010.Views.WindowsUI.Document() With {.Caption = "Document 2"}
view.Documents.AddRange(New DevExpress.XtraBars.Docking2010.Views.WindowsUI.Document() { doc1, doc2 })
Dim pageGroup1 As New DevExpress.XtraBars.Docking2010.Views.WindowsUI.PageGroup()
pageGroup1.Items.AddRange(New DevExpress.XtraBars.Docking2010.Views.WindowsUI.Document() { doc1, doc2 })
view.ContentContainers.Add(pageGroup1)
pageGroup1.Caption = "Page Group"
pageGroup1.Properties.SwitchDocumentAnimationMode = TransitionAnimation.VerticalSlide
view.AppearanceCaption.ForeColor = System.Drawing.Color.OrangeRed
e.ContentContainer = pageGroup1
End Sub
Private Sub windowsUIView1_QueryControl(ByVal sender As Object, ByVal e As DevExpress.XtraBars.Docking2010.Views.QueryControlEventArgs)
Dim view As WindowsUIView = TryCast(sender, WindowsUIView)
If e.Document = view.Documents(0) Then
e.Control = New RichEditControl() With {.Text = "Text 1"}
Else
e.Control = New RichEditControl() With {.Text = "Text 2"}
End If
End Sub
|