mirror of
https://github.com/DevExpress/netcore-winforms-demos.git
synced 2026-01-05 16:26:09 +00:00
Add Outlook Inspired and Stock Market demos
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using DevExpress.DevAV.ViewModels;
|
||||
using DevExpress.XtraBars.Docking2010;
|
||||
using DevExpress.XtraEditors;
|
||||
|
||||
namespace DevExpress.DevAV.Modules {
|
||||
public partial class OverviewControl : XtraUserControl {
|
||||
public OverviewControl() {
|
||||
InitializeComponent();
|
||||
descriptionLabel.AutoSizeInLayoutControl = false;
|
||||
descriptionLabel.Text = "<image=#UISuperHero><br>"
|
||||
+ string.Format("<color=#{0:x6}><size=+24>Become a UI Superhero<br>", ColorHelper.TextColor.ToArgb())
|
||||
+ string.Format("<color=#{0:x6}><size=-18>And deliver compelling user-experiences on the WinForms platform<br>", ColorHelper.DisabledTextColor.ToArgb())
|
||||
+ "with award-winning DevExpress Controls and Libraries.";
|
||||
descriptionLabel.HyperlinkClick += descriptionLabel_HyperlinkClick;
|
||||
}
|
||||
void descriptionLabel_HyperlinkClick(object sender, Utils.HyperlinkClickEventArgs e) {
|
||||
viewModel.SelectedModuleType = ModuleType.Employees;
|
||||
var form = FindForm();
|
||||
if(form != null)
|
||||
form.Close();
|
||||
}
|
||||
MainViewModel viewModel;
|
||||
protected override void OnLoad(System.EventArgs e) {
|
||||
base.OnLoad(e);
|
||||
if(viewModel == null && AppHelper.MainForm != null) {
|
||||
viewModel = (AppHelper.MainForm as ISupportViewModel).ViewModel as MainViewModel;
|
||||
if(viewModel != null)
|
||||
BindCommands();
|
||||
}
|
||||
}
|
||||
void BindCommands() {
|
||||
((WindowsUIButton)buttonsPanel.Buttons[0]).BindCommand(() => viewModel.GetStarted(), viewModel);
|
||||
((WindowsUIButton)buttonsPanel.Buttons[1]).BindCommand(() => viewModel.GetSupport(), viewModel);
|
||||
((WindowsUIButton)buttonsPanel.Buttons[2]).BindCommand(() => viewModel.BuyNow(), viewModel);
|
||||
}
|
||||
internal void SetDescription(string description) {
|
||||
descriptionLabel.Appearance.Image = null;
|
||||
descriptionLabel.Text = "<image=#UISuperHero><br>"
|
||||
+ string.Format("<color=#{0:x6}><size=+24>Become a UI Superhero<br>", ColorHelper.TextColor.ToArgb())
|
||||
+ string.Format("<color=#{0:x6}><size=-18>{1}", ColorHelper.DisabledTextColor.ToArgb(), description);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user