本文整理汇总了C#中Windows.UI.ApplicationSettings.SettingsPaneCommandsRequestedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# SettingsPaneCommandsRequestedEventArgs类的具体用法?C# SettingsPaneCommandsRequestedEventArgs怎么用?C# SettingsPaneCommandsRequestedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SettingsPaneCommandsRequestedEventArgs类属于Windows.UI.ApplicationSettings命名空间,在下文中一共展示了SettingsPaneCommandsRequestedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Orders_CommandsRequested
void Orders_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
args.Request.ApplicationCommands.Add(new SettingsCommand("settings", "Nastavení", (handler) =>
{
new Settings().Show();
}));
}
开发者ID:uxsoft,项目名称:RestSys,代码行数:7,代码来源:Orders.xaml.cs
示例2: CommandsRequested
private void CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
args.Request.ApplicationCommands.Add(new SettingsCommand("about", "About", x =>
{
_flyout = new SettingsFlyout
{
HeaderText = "About",
Content = new AboutView(),
IsOpen = true,
ContentBackgroundBrush = new SolidColorBrush(Colors.Black),
ContentForegroundBrush = new SolidColorBrush(Colors.White)
};
}));
args.Request.ApplicationCommands.Add(new SettingsCommand("privacy", "Privacy", x =>
{
_flyout = new SettingsFlyout
{
HeaderText = "Privacy",
Content = new PrivacyView(),
IsOpen = true,
ContentBackgroundBrush = new SolidColorBrush(Colors.Black),
ContentForegroundBrush = new SolidColorBrush(Colors.White)
};
}));
}
开发者ID:quandtm,项目名称:exXAMLate,代码行数:26,代码来源:App.xaml.cs
示例3: ConfigureSettings
private void ConfigureSettings(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
var settingsColor = App.Current.Resources["MainAppColor"] as SolidColorBrush;
var aboutCommand = new SettingsCommand("about", "About MetroPass", a => DialogService.ShowSettingsFlyout<AboutSettingsViewModel>(headerBrush: settingsColor));
args.Request.ApplicationCommands.Add(aboutCommand);
var dataSource = _bootstrapper.GetInstance<IPWDatabaseDataSource>();
var dbOptionsCommand = new SettingsCommand("databaseOptions", "Database Options", h =>
{
if (dataSource.PwDatabase != null)
{
DialogService.ShowSettingsFlyout<DatabaseSettingsViewModel>( onClosed: SettingsClosed, headerBrush: settingsColor);
}
else
{
DialogService.ShowSettingsFlyout<DatabaseClosedSettingsViewModel>(headerBrush: settingsColor);
}
});
args.Request.ApplicationCommands.Add(dbOptionsCommand);
var appOptionsCommand = new SettingsCommand("metroPassOptions", "MetroPass Options", h => DialogService.ShowSettingsFlyout<AppSettingsViewModel>( headerBrush: settingsColor));
args.Request.ApplicationCommands.Add(appOptionsCommand);
var privacyPolicyCommand = new SettingsCommand("privacyPolicy", "Privacy Policy", a => LaunchUrl(PrivacyPolicyUrl));
args.Request.ApplicationCommands.Add(privacyPolicyCommand);
var supportCommand = new SettingsCommand("support", "Support & Feedback", a => LaunchUrl(SupportUrl));
args.Request.ApplicationCommands.Add(supportCommand);
}
开发者ID:TheAngryByrd,项目名称:MetroPass,代码行数:31,代码来源:App.xaml.cs
示例4: BlankPage_CommandsRequested
private void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
SettingsCommand cmd = new SettingsCommand("sample", "Sample Custom Setting", (x) =>
{
// create a new instance of the flyout
SettingsFlyout settings = new SettingsFlyout();
// set the desired width. If you leave this out, you will get Narrow (346px)
settings.FlyoutWidth = (Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth)Enum.Parse(typeof(Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth), settingswidth.SelectionBoxItem.ToString());
// optionally change header and content background colors away from defaults (recommended)
// if using Callisto's AppManifestHelper you can grab the element from some member var you held it in
// settings.HeaderBrush = new SolidColorBrush(App.VisualElements.BackgroundColor);
settings.HeaderBrush = new SolidColorBrush(Colors.Orange);
settings.HeaderText = string.Format("{0} Custom Settings", App.VisualElements.DisplayName);
// provide some logo (preferrably the smallogo the app uses)
BitmapImage bmp = new BitmapImage(App.VisualElements.SmallLogoUri);
settings.SmallLogoImageSource = bmp;
// set the content for the flyout
settings.Content = new SettingsContent();
// open it
settings.IsOpen = true;
// this is only for the test app and not needed
// you would not use this code in your real app
ObjectTracker.Track(settings);
});
args.Request.ApplicationCommands.Add(cmd);
}
开发者ID:rgmills,项目名称:callisto,代码行数:32,代码来源:SettingsSample.xaml.cs
示例5: BlankPage_CommandsRequested
void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
// 新建一个命令
SettingsCommand cmd = new SettingsCommand("login", "登录", (x) =>
{
// 新建一个Popup,并将其宽度设置为346,高度与屏幕一致
_settingsPopup = new Popup();
_settingsPopup.Width = 346;
_settingsPopup.Height = Window.Current.Bounds.Height;
_settingsPopup.IsLightDismissEnabled = true;
// 新建一个页面,并设置该页面的相关属性(大小,位置)
LoginPane mypane = new LoginPane();
mypane.Height = Window.Current.Bounds.Height;
mypane.Width = 346;
_settingsPopup.Child = mypane;
_settingsPopup.SetValue(Canvas.LeftProperty, Window.Current.Bounds.Width - 346);
_settingsPopup.IsOpen = true;
});
args.Request.ApplicationCommands.Add(cmd);
SettingsCommand cmd1 = new SettingsCommand("logout", "注销", (x) =>
{
});
args.Request.ApplicationCommands.Add(cmd1);
}
开发者ID:BeyondVincent,项目名称:WindowsStoreAppCode,代码行数:28,代码来源:MainPage.xaml.cs
示例6: settingsPane_CommandsRequested
///////////////////////////////////////////////////////////////////////////////////
// Update with URLs to About, Support and Privacy Policy Web Pages
///////////////////////////////////////////////////////////////////////////////////
void settingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
var rl = new ResourceLoader();
var aboutCmd = new SettingsCommand("About", rl.GetString("SETTINGS_PANEL_CMD_ABOUT"), async (x) =>
{
await Launcher.LaunchUriAsync(new Uri(""));
});
args.Request.ApplicationCommands.Add(aboutCmd);
var supportCmd = new SettingsCommand("Support", rl.GetString("SETTINGS_PANEL_CMD_SUPPORT"), async (x) =>
{
await Launcher.LaunchUriAsync(new Uri(""));
});
args.Request.ApplicationCommands.Add(supportCmd);
var policyCmd = new SettingsCommand("PrivacyPolicy", rl.GetString("SETTINGS_PANEL_CMD_PRIVACY_POLICY"), async (x) =>
{
await Launcher.LaunchUriAsync(new Uri(""));
});
args.Request.ApplicationCommands.Add(policyCmd);
}
开发者ID:AntonioJorgeFlorindo,项目名称:StarterKits,代码行数:28,代码来源:MainPage.xaml.cs
示例7: CommandsRequested
private void CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
args.Request.ApplicationCommands.Add(new SettingsCommand("a", "Privacy Policy", (p) => { PrivacyCharm.IsOpen = true; }));
args.Request.ApplicationCommands.Add(new SettingsCommand("b", "How does it work?", (p) => { HowCharm.IsOpen = true; }));
args.Request.ApplicationCommands.Add(new SettingsCommand("s", "Developed By", (p) => { DevelopedBy.IsOpen = true; }));
args.Request.ApplicationCommands.Add(new SettingsCommand("s", "Rate AzureSQLMonitor", (p) => { RateApp.IsOpen = true; }));
}
开发者ID:dantoshe,项目名称:AzureSQLMonitor,代码行数:7,代码来源:HomePageView.xaml.cs
示例8: CommandsRequested
void CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
var command = new SettingsCommand("settings", "Settings", (x) => {
this._settingsPopup = new Popup();
this._settingsPopup.Closed += this.SettingsPopupClosed;
this._settingsPopup.Opened += this.SettingsPopupOpened;
this._settingsPopup.IsLightDismissEnabled = true;
this._settingsPopup.Width = this._settingsWidth;
this._settingsPopup.Height = this._windowsBounds.Height;
var settingsPane = new ApplicationSettings();
settingsPane.Width = this._settingsWidth;
settingsPane.Height = this._windowsBounds.Height;
this._settingsPopup.Child = settingsPane;
this._settingsPopup.SetValue(Canvas.LeftProperty, this._windowsBounds.Width - this._settingsWidth);
this._settingsPopup.SetValue(Canvas.TopProperty, 0);
this._settingsPopup.IsOpen = true;
Window.Current.Activated += OnWindowActivated;
});
args.Request.ApplicationCommands.Add(command);
}
开发者ID:m-gagne,项目名称:MetroMarkdown,代码行数:25,代码来源:Editor.xaml.cs
示例9: OnCommandsRequested
// <snippet519>
public void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
if (args == null || args.Request == null || args.Request.ApplicationCommands == null
|| _getSettingsCharmItems == null)
{
return;
}
var applicationCommands = args.Request.ApplicationCommands;
var settingsCharmItems = _getSettingsCharmItems();
foreach (var settingsCharmItem in settingsCharmItems)
{
var notFound = applicationCommands.FirstOrDefault(
(settingsCommand) => settingsCommand.Id.ToString() == settingsCharmItem.FlyoutName) == null;
if (notFound)
{
SettingsCommand cmd = new SettingsCommand(settingsCharmItem.FlyoutName,
settingsCharmItem.SettingsCharmTitle,
(o) =>
_flyoutService.ShowFlyout(settingsCharmItem.FlyoutName));
applicationCommands.Add(cmd);
}
}
}
开发者ID:stevenh77,项目名称:ItineraryHunter-Win8,代码行数:27,代码来源:SettingsCharmService.cs
示例10: CommandsRequested
private void CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) {
SettingsCommand about = new SettingsCommand("About", "About", About_Click);
SettingsCommand privacy = new SettingsCommand("Privacy", "Privacy Policy", PrivacyPolicy_Click);
SettingsCommand history = new SettingsCommand("History", "Clear History", ClearHistory_Click);
args.Request.ApplicationCommands.Add(about);
args.Request.ApplicationCommands.Add(privacy);
args.Request.ApplicationCommands.Add(history); }
开发者ID:Razmal,项目名称:libmpeg2-winrt,代码行数:7,代码来源:App.xaml.cs
示例11: OnCommandsRequested
private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
var menuCommand = new SettingsCommand("handwritingSettings", "Handwriting options", OnHandwritingSettingsCommand);
args.Request.ApplicationCommands.Add(menuCommand);
menuCommand = new SettingsCommand("about", "About", OnAboutCommand);
args.Request.ApplicationCommands.Add(menuCommand);
}
开发者ID:rousse101,项目名称:WritePadSDK,代码行数:7,代码来源:SettingsUI.cs
示例12: OnCommandsRequested
private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
// Add an About command
var about = new SettingsCommand("about", "About", handler =>
{
var settings = new SettingsFlyout();
settings.Content = new AboutUserControl();
settings.HeaderBrush = new SolidColorBrush(Colors.Magenta);
settings.Background = new SolidColorBrush(Colors.LightGreen);
settings.ContentBackgroundBrush = new SolidColorBrush(Colors.LightGreen);
settings.HeaderText = "About";
settings.IsOpen = true;
});
args.Request.ApplicationCommands.Add(about);
var preferences = new SettingsCommand("preferences", "Preferences", (handler) =>
{
var settings = new SettingsFlyout();
settings.Content = new PreferencesUserControl();
settings.HeaderBrush = new SolidColorBrush(Colors.Magenta);
settings.Background = new SolidColorBrush(Colors.LightGreen);
settings.ContentBackgroundBrush = new SolidColorBrush(Colors.LightGreen);
settings.HeaderText = "Preferences";
settings.IsOpen = true;
});
args.Request.ApplicationCommands.Add(preferences);
}
开发者ID:kap0ton,项目名称:Cinemapark_AppStore,代码行数:29,代码来源:App.xaml.cs
示例13: SettingsPane_CommandsRequested
private void SettingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
if (this.OnSettingsRequested != null)
{
this.OnSettingsRequested(args.Request.ApplicationCommands);
}
}
开发者ID:brentedwards,项目名称:Charmed,代码行数:7,代码来源:SettingsManager.cs
示例14: BlankPage_CommandsRequested
void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
SettingsCommand cmd = new SettingsCommand("login", "登录", (x) =>
{
_settingsPopup = new Popup();
_settingsPopup.Closed += OnPopupClosed;
Window.Current.Activated += OnWindowActivated;
_settingsPopup.IsLightDismissEnabled = true;
_settingsPopup.Width = _settingsWidth;
_settingsPopup.Height = _windowBounds.Height;
SimpleSettingsNarrow mypane = new SimpleSettingsNarrow();
mypane.Width = _settingsWidth;
mypane.Height = _windowBounds.Height;
_settingsPopup.Child = mypane;
_settingsPopup.SetValue(Canvas.LeftProperty, _windowBounds.Width - _settingsWidth);
_settingsPopup.SetValue(Canvas.TopProperty, 0);
_settingsPopup.IsOpen = true;
});
args.Request.ApplicationCommands.Add(cmd);
SettingsCommand cmd1 = new SettingsCommand("logout", "注销", (x) =>
{
});
args.Request.ApplicationCommands.Add(cmd1);
}
开发者ID:BeyondVincent,项目名称:WindowsStoreAppStepByStep,代码行数:29,代码来源:MainPage.xaml.cs
示例15: CommandsRequested
void CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
UICommandInvokedHandler handler = new UICommandInvokedHandler(onSettingsCommand);
SettingsCommand policyCommand = new SettingsCommand("policyCommand", "Privacy Policy", handler);
args.Request.ApplicationCommands.Add(policyCommand);
}
开发者ID:kiewic,项目名称:WindowsStoreApps,代码行数:7,代码来源:LogInPage.xaml.cs
示例16: MainPage_CommandsRequested
void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
if (!settingPanelInitialized)
{
SettingsCommand cmd = new SettingsCommand("AIMine", "Layout Options", (x) =>
{
_settingsPopup = new Popup();
_settingsPopup.Closed += OnPopupClosed;
Window.Current.Activated += OnWindowActivated;
_settingsPopup.IsLightDismissEnabled = true;
_settingsPopup.Width = _settingsWidth;
_settingsPopup.Height = _windowBounds.Height;
SimpleSettingsNarrow mypane = new SimpleSettingsNarrow();
mypane.Width = _settingsWidth;
mypane.Height = _windowBounds.Height;
_settingsPopup.Child = mypane;
_settingsPopup.SetValue(Canvas.LeftProperty, _windowBounds.Width - _settingsWidth);
_settingsPopup.SetValue(Canvas.TopProperty, 0);
_settingsPopup.IsOpen = true;
});
args.Request.ApplicationCommands.Add(cmd);
settingPanelInitialized = true;
}
}
开发者ID:lantian2012,项目名称:MineSweeper,代码行数:26,代码来源:MainPage.xaml.cs
示例17: BlankPage_CommandsRequested
private void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
SettingsCommand cmd = new SettingsCommand("sample", "Sample Custom Setting", (x) =>
{
// create a new instance of the flyout
SettingsFlyout settings = new SettingsFlyout();
// set the desired width. If you leave this out, you will get Narrow (346px)
settings.FlyoutWidth = (Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth)Enum.Parse(typeof(Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth), settingswidth.SelectionBoxItem.ToString());
// optionally change header and content background colors away from defaults (recommended)
//settings.Background = new SolidColorBrush(Colors.Red);
settings.HeaderBrush = new SolidColorBrush(Colors.Orange);
settings.HeaderText = "Foo Bar Custom Settings";
// provide some logo (preferrably the smallogo the app uses)
BitmapImage bmp = new BitmapImage(new Uri("ms-appx:///Assets/SmallLogo.png"));
settings.SmallLogoImageSource = bmp;
// set the content for the flyout
settings.Content = new SettingsContent();
// open it
settings.IsOpen = true;
// this is only for the test app and not needed
// you would not use this code in your real app
ObjectTracker.Track(settings);
});
args.Request.ApplicationCommands.Add(cmd);
}
开发者ID:WillemGijsbers,项目名称:callisto,代码行数:31,代码来源:SettingsSample.xaml.cs
示例18: OnSettingsPaneCommandRequested
private void OnSettingsPaneCommandRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
// Add the commands one by one to the settings panel
args.Request.ApplicationCommands.Add(new SettingsCommand("Privacy Statement", "Privacy Statement", DoOperation));
args.Request.ApplicationCommands.Add(new SettingsCommand("a", " Feedback and Support",dO2 ));
}
开发者ID:Navaneeth92,项目名称:Xplore,代码行数:7,代码来源:MainPage.xaml.cs
示例19: BlankPage_CommandsRequested
private void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
SettingsCommand cmd = new SettingsCommand("sample", "Sample Custom Setting", (x) =>
{
SettingsFlyout settings = new SettingsFlyout();
settings.FlyoutWidth = (Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth)Enum.Parse(typeof(Callisto.Controls.SettingsFlyout.SettingsFlyoutWidth), settingswidth.SelectionBoxItem.ToString());
//settings.HeaderBrush = new SolidColorBrush(Colors.Orange);
//settings.Background = new SolidColorBrush(Colors.White);
settings.HeaderText = "Foo Bar Custom Settings";
BitmapImage bmp = new BitmapImage(new Uri("ms-appx:///Assets/SmallLogo.png"));
settings.SmallLogoImageSource = bmp;
StackPanel sp = new StackPanel();
ToggleSwitch ts = new ToggleSwitch();
ts.Header = "Download updates automatically";
Button b = new Button();
b.Content = "Test";
sp.Children.Add(ts);
sp.Children.Add(b);
settings.Content = sp;
settings.IsOpen = true;
ObjectTracker.Track(settings);
});
args.Request.ApplicationCommands.Add(cmd);
}
开发者ID:fransstridh,项目名称:callisto,代码行数:34,代码来源:SettingsSample.xaml.cs
示例20: Home_CommandsRequested
void Home_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
bool afound = false;
bool sfound = false;
bool pfound = false;
foreach (var command in args.Request.ApplicationCommands.ToList())
{
if (command.Label == "About")
{
afound = true;
}
if (command.Label == "Settings")
{
sfound = true;
}
if (command.Label == "Policy")
{
pfound = true;
}
}
if (!afound)
args.Request.ApplicationCommands.Add(new SettingsCommand("s", "About", (p) => { cfoAbout.IsOpen = true; }));
//if (!sfound)
// args.Request.ApplicationCommands.Add(new SettingsCommand("s", "Settings", (p) => { cfoSettings.IsOpen = true; }));
//if (!pfound)
// args.Request.ApplicationCommands.Add(new SettingsCommand("s", "Policy", (p) => { cfoPolicy.IsOpen = true; }));
if (!afound)
args.Request.ApplicationCommands.Add(new SettingsCommand("privacypolicy", "Privacy policy", OpenPrivacyPolicy));
}
开发者ID:ramezdebbas,项目名称:IQTest,代码行数:29,代码来源:Home.xaml.cs
注:本文中的Windows.UI.ApplicationSettings.SettingsPaneCommandsRequestedEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论