- xplorerbar_demo.zip
- XPlorerBar_demo
- ZonaTools.XPlorerBar.DemoApp.exe
- ZonaTools.XPlorerBar.dll
- ZonaTools.XPlorerBar.Documentation.chm
- xplorerbar_src.zip
- XPlorerBar_src
- XPlorerBar.DemoApp.sln
- XPlorerBar.DemoApp
- App.xaml
- App.xaml.cs
- Converters
- Extra_BindingMode
- Extra_ThemeManagement
- Images
- codeproject120x60.gif
- Computer16.png
- Copy16.png
- CreateFolder16.png
- Delete16.png
- MailFile16.png
- Move16.png
- MusicOnLine16.png
- MyComputer16.png
- MyDocuments16.png
- MyMusic32.png
- MyNetwork16.png
- MyPictures16.png
- MyPictures32.png
- MyPictures48.png
- NetworkFavorites16.png
- OrderPictures16.png
- PlayAll16.png
- PrintPictures16.png
- PublishFolder16.png
- Rename16.png
- SharedMusic16.png
- ShareFolder16.png
- SlideShow16.png
- MainWindow.xaml
- MainWindow.xaml.cs
- Properties
- Resources
- Images
- Folder16.png
- MyComputer16.png
- NetworkPlaces16.png
- PicturePrint16.png
- PictureTasks32.png
- PictureTasksMono48.png
- PrintsOnline16.png
- SlideShow16.png
- Skins
- XPlorerBar.DemoApp.csproj
- XPlorerBar.Documentation
- XPlorerBarDocumentationProject.shfb
- XPlorerBar.Library
- XPlorerBar.VisualStudio.Design
|
#region [ Copyright © 2008, Zona-Tools, all rights reserved. ]
/*
*
This source code is licensed under the Code Project Open License (CPOL).
Check out http://www.codeproject.com/info/cpol10.aspx for further details.
*
*/
#endregion
#region [ Using namespaces ]
using System;
using System.Windows;
using System.Windows.Controls;
#endregion
namespace ZonaTools.XPlorerBar.DemoApp
{
/// <summary>
/// Interaction logic for ThemesWindow.xaml
/// </summary>
public partial class ThemesWindow : Window
{
#region [ Themes declarataions ]
/// <summary>
/// Code Project theme.
/// </summary>
static Theme CodeProjectTheme = new Theme(
"CodeProject",
"ZonaTools.XPlorerBar.DemoApp;component/Skins/CodeProjectSkinDictionary.xaml");
#endregion
#region [ Constructor ]
//===========================================================================
/// <summary>
/// Default constructor.
/// </summary>
//===========================================================================
public ThemesWindow()
{
//Registers the custom theme
ThemeManager.RegisterTheme(CodeProjectTheme, typeof(XPlorerBar));
//Registers the Luna themes for the XPlorerSection class
ThemeManager.RegisterTheme(XPlorerBar.LunaNormalColorTheme, typeof(XPlorerSection));
ThemeManager.RegisterTheme(XPlorerBar.LunaHomesteadTheme, typeof(XPlorerSection));
ThemeManager.RegisterTheme(XPlorerBar.LunaMetallicTheme, typeof(XPlorerSection));
InitializeComponent();
//Populates the 'cbTheme' combobox with the various themes
PopulateComboBox();
}
#endregion
#region [ Events ]
//===========================================================================
/// <summary>
/// Invoked whenever an XPlorerItem is clicked.
/// </summary>
/// <param name="sender">The object where the event handler is
/// attached.</param>
/// <param name="e">The event data.</param>
//===========================================================================
private void XPlorerItem_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show(
string.Format("You clicked the '{0}' item.", ((XPlorerItem)e.OriginalSource).ItemText),
"Information Message",
MessageBoxButton.OK,
MessageBoxImage.Information);
}
//===========================================================================
/// <summary>
/// Invoked whenever the theme is changed.
/// </summary>
/// <param name="sender">The object where the event handler is
/// attached.</param>
/// <param name="e">The event data.</param>
//===========================================================================
private void OnThemeChanged(object sender, SelectionChangedEventArgs e)
{
//Gets the combobox who sent the event
ComboBox cb = sender as ComboBox;
if (cb == null)
return;
//Gets the Tag of the combobox item clicked
String cbTag = ((ComboBoxItem)cb.SelectedItem).Tag.ToString();
//Sets the theme relative to the combobox item clicked
ZT_XPlorerBar.SetValue(ThemeManager.ThemeProperty, cbTag);
}
#endregion
#region [ Populates the combobox ]
//===========================================================================
/// <summary>
/// Populates the 'cbTheme' combobox.
/// </summary>
//===========================================================================
private void PopulateComboBox()
{
CreateComboBoxItem("Default (OS theme)", Themes.Default.ToString());
CreateComboBoxItem("Aero theme (Vista)", XPlorerBar.AeroNormalColorTheme.Name);
CreateComboBoxItem("Classic theme (NT)", XPlorerBar.ClassicTheme.Name);
CreateComboBoxItem("Luna blue theme (XP)", XPlorerBar.LunaNormalColorTheme.Name);
CreateComboBoxItem("Luna olive green theme (XP)", XPlorerBar.LunaHomesteadTheme.Name);
CreateComboBoxItem("Luna silver theme (XP)", XPlorerBar.LunaMetallicTheme.Name);
CreateComboBoxItem("Royale theme (XP Media Center)", XPlorerBar.RoyaleNormalColorTheme.Name);
CreateComboBoxItem("Zune theme (XP)", XPlorerBar.ZuneNormalColorTheme.Name);
CreateComboBoxItem("MS Blend theme", XPlorerBar.BlendTheme.Name);
CreateComboBoxItem("Code Project theme (Custom)", CodeProjectTheme.Name);
}
//===========================================================================
/// <summary>
/// Add an item to the 'cbTheme' combobox.
/// </summary>
/// <param name="itemContent">Display name of the item.</param>
/// <param name="itemTag">Tag of the item.</param>
//===========================================================================
private void CreateComboBoxItem(string itemContent, string itemTag)
{
ComboBoxItem cbItem = new ComboBoxItem();
cbItem.Content = itemContent;
cbItem.Tag = itemTag;
cbTheme.Items.Add(cbItem);
}
#endregion
}
}
|
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 have been developing and managing projects for real-time embedded softwares for eight years. Then, I moved from Paris to the south of France and began to lead a team who was developping Java applications.
My main occupation right now is to continue my journey in the WPF world.
You can check out my blog
here. [
^]