|
using System;
using System.IO;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
namespace WPF_Tour_Beginners_Layout
{
public partial class DEMOLauncher
{
public DEMOLauncher()
{
this.InitializeComponent();
lstDEMOS.SelectionChanged += new SelectionChangedEventHandler(lstDEMOS_SelectionChanged);
lstDEMOS.Items.Add("CanvasDEMO.xaml");
lstDEMOS.Items.Add("CanvasDEMOCodeBehind.xaml");
lstDEMOS.Items.Add("StackPanelDEMO.xaml");
lstDEMOS.Items.Add("StackPanelDEMOCodeBehind.xaml");
lstDEMOS.Items.Add("WrapPanelDEMO.xaml");
lstDEMOS.Items.Add("WrapPanelDEMOCodeBehind.xaml");
lstDEMOS.Items.Add("DockPanelDEMO.xaml");
lstDEMOS.Items.Add("DockPanelDEMOCodeBehind.xaml");
lstDEMOS.Items.Add("GridDEMO.xaml");
lstDEMOS.Items.Add("GridDEMOCodeBehind.xaml");
lstDEMOS.Items.Add("PuttingItAllTogether.xaml");
}
void lstDEMOS_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
switch (lstDEMOS.SelectedValue.ToString())
{
case "CanvasDEMO.xaml":
CanvasDEMO demoWin1 = new CanvasDEMO();
demoWin1.Owner = this;
demoWin1.ShowDialog();
break;
case "CanvasDEMOCodeBehind.xaml":
CanvasDEMOCodeBehind demoWin2 = new CanvasDEMOCodeBehind();
demoWin2.Owner = this;
demoWin2.ShowDialog();
break;
case "StackPanelDEMO.xaml":
StackPanelDEMO demoWin3 = new StackPanelDEMO();
demoWin3.Owner = this;
demoWin3.ShowDialog();
break;
case "StackPanelDEMOCodeBehind.xaml":
StackPanelDEMOCodeBehind demoWin4 = new StackPanelDEMOCodeBehind();
demoWin4.Owner = this;
demoWin4.ShowDialog();
break;
case "WrapPanelDEMO.xaml":
WrapPanelDEMO demoWin5 = new WrapPanelDEMO();
demoWin5.Owner = this;
demoWin5.ShowDialog();
break;
case "WrapPanelDEMOCodeBehind.xaml":
WrapPanelDEMOCodeBehind demoWin6 = new WrapPanelDEMOCodeBehind();
demoWin6.Owner = this;
demoWin6.ShowDialog();
break;
case "DockPanelDEMO.xaml":
DockPanelDEMO demoWin7 = new DockPanelDEMO();
demoWin7.Owner = this;
demoWin7.ShowDialog();
break;
case "DockPanelDEMOCodeBehind.xaml":
DockPanelDEMOCodeBehind demoWin8 = new DockPanelDEMOCodeBehind();
demoWin8.Owner = this;
demoWin8.ShowDialog();
break;
case "GridDEMO.xaml":
GridDEMO demoWin9 = new GridDEMO();
demoWin9.Owner = this;
demoWin9.ShowDialog();
break;
case "GridDEMOCodeBehind.xaml":
GridDEMOCodeBehind demoWin10 = new GridDEMOCodeBehind();
demoWin10.Owner = this;
demoWin10.ShowDialog();
break;
case "PuttingItAllTogether.xaml":
PuttingItAllTogether demoWin11 = new PuttingItAllTogether();
demoWin11.Owner = this;
demoWin11.ShowDialog();
break;
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I currently hold the following qualifications (amongst others, I also studied Music Technology and Electronics, for my sins)
- MSc (Passed with distinctions), in Information Technology for E-Commerce
- BSc Hons (1st class) in Computer Science & Artificial Intelligence
Both of these at Sussex University UK.
Award(s)
I am lucky enough to have won a few awards for Zany Crazy code articles over the years
- Microsoft C# MVP 2016
- Codeproject MVP 2016
- Microsoft C# MVP 2015
- Codeproject MVP 2015
- Microsoft C# MVP 2014
- Codeproject MVP 2014
- Microsoft C# MVP 2013
- Codeproject MVP 2013
- Microsoft C# MVP 2012
- Codeproject MVP 2012
- Microsoft C# MVP 2011
- Codeproject MVP 2011
- Microsoft C# MVP 2010
- Codeproject MVP 2010
- Microsoft C# MVP 2009
- Codeproject MVP 2009
- Microsoft C# MVP 2008
- Codeproject MVP 2008
- And numerous codeproject awards which you can see over at my blog