This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ucDocMetro.cs
52 lines (48 loc) · 1.67 KB
/
ucDocMetro.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraBars.Docking2010.Views.WindowsUI;
using DevExpress.XtraBars.Docking2010;
using DevExpress.XtraBars.Docking2010.Views;
using DevExpress.XtraEditors;
using DevExpress.XtraWizard;
namespace WizardControlPageSwitching
{
public partial class ucDocMetro : UserControl
{
public ucDocMetro()
{
InitializeComponent();
metroUIView1.UseSplashScreen = DevExpress.Utils.DefaultBoolean.False;
this.Load += new EventHandler(DocMetro_Load);
}
internal void ActivatePage(int numPage)
{
WizardControl wizard = (Parent as ucSlideWizard).WizardControl;
wizard.Parent = (metroUIView1.Documents[numPage] as Document).Control;
wizard.SelectedPageIndex = numPage;
pageGroup1.SetSelected(metroUIView1.Documents[numPage] as Document);
metroUIView1.Controller.Activate(pageGroup1);
}
internal void PopulatePages(int count)
{
for (int i = 0; i < count; i++)
{
Size size = (Parent as ucSlideWizard).WizardControl.Size;
metroUIView1.AddDocument(new Control());
metroUIView1.Documents[i].Control.Parent.Size = size;
pageGroup1.Items.Add((Document)metroUIView1.Documents[i]);
}
}
void DocMetro_Load(object sender, EventArgs e)
{
PopulatePages((Parent as ucSlideWizard).Pages.Count);
ActivatePage(0);
}
}
}