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
/
MyWizardViewInfo.cs
37 lines (30 loc) · 1.6 KB
/
MyWizardViewInfo.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
using DevExpress.XtraWizard;
using System.Drawing;
using DevExpress.XtraNavBar;
using System.Windows.Forms;
using DevExpress.XtraEditors;
namespace DXSample {
public class MyWizard97Model : DevExpress.XtraWizard.WizardViewInfo.Wizard97Model {
public MyWizard97Model(WizardViewInfo viewInfo) : base(viewInfo) { }
public void UpdateNavBarPosition() {
Rectangle pageBounds = GetExteriorPageBounds(((MyWizardViewInfo)ViewInfo).Owner.SelectedPage);
((MyWizardViewInfo)ViewInfo).NavBarControl.Width = pageBounds.X - 10;
((MyWizardViewInfo)ViewInfo).NavBarControl.Dock = DockStyle.Left;
}
public override Rectangle GetInteriorPageBounds(BaseWizardPage page) { return GetExteriorPageBounds(page); }
public override Rectangle GetInteriorHeaderBounds() {
Rectangle result = GetExteriorTitleBounds();
result.X -= 10;
result.Width += 10;
return result;
}
public override Rectangle GetInteriorHeaderImageBounds() { return GetExteriorHeaderImageBounds(); }
}
public class MyWizardViewInfo : WizardViewInfo {
public MyWizardViewInfo(WizardControl control) : base(control) { }
internal PanelControl NavBarControl { get { return ((MyWizardControl)Owner).navBarPanel; } }
protected internal WizardControl Owner { get { return base.WizardControl; } }
public void UpdateNavBarBounds() { ((MyWizard97Model)Model).UpdateNavBarPosition(); }
protected override WizardModelBase CreateWizardModelCore(WizardStyle style) { return new MyWizard97Model(this); }
}
}