I have an requirement that, need to customize the Device charm bar in windows 8?
I need to add a button or any other control in Device charm bar.
- Is it possible?
- If yes, how can we customize it?
Thanks in advance.
I have an requirement that, need to customize the Device charm bar in windows 8?
I need to add a button or any other control in Device charm bar.
Thanks in advance.
You can certainly add commands to Device's charms bar like this: I assume you want to add to Settings Charms bar.
Create a Class example AppSettings
public AppSetting()
{
SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested;
SizeChanged += AppSettingSizeChanged;
}
private void OnCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs eventArgs)
{
eventArgs.Request.ApplicationCommands.Clear();
UICommandInvokedHandler handler = new UICommandInvokedHandler(OnSettingsCommand);
// Some command
SettingsCommand someCommand = new SettingsCommand("uniqueID", "NameofLabel", handler);
eventArgs.Request.ApplicationCommands.Add(someCommand);
}
private void OnSettingsCommand(IUICommand command)
{
Logger.Log("Called");
SettingsCommand settingsCommand = (SettingsCommand)command;
string id = settingsCommand.Id as string;
switch (id)
{
case someID:
{
ShowSomeUI();
} break;
case otherID:
{
ShowSomeOtherUI();
} break;
}
}
protected void ShowSomeUI()
{
//Implement anything you want here
}
Use the above class and make the very first class of your Application inherit from this class so that the commands are added to charms bar and implement anything on their clicks.
P.S let me know if this is not clear or doesnt answer your question.