void Settings_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { try { var viewAboutPage = new SettingsCommand("", "Об авторе", cmd => { Windows.UI.Xaml.Controls.SettingsFlyout settings = new Windows.UI.Xaml.Controls.SettingsFlyout(); settings.Width = 500; //settings.HeaderBackground = new SolidColorBrush(App.VisualElements.BackgroundColor); //.HeaderForeground = new SolidColorBrush(Colors.Black); settings.Title = "Об авторе"; //string.Format("{0} Custom 2", App.VisualElements.DisplayName); settings.IconSource = new BitmapImage(Windows.ApplicationModel.Package.Current.Logo); settings.Content = new About(); settings.Show(); }); args.Request.ApplicationCommands.Add(viewAboutPage); var viewAboutMalukahPage = new SettingsCommand("", "Политика конфиденциальности", cmd => { Windows.UI.Xaml.Controls.SettingsFlyout settings = new Windows.UI.Xaml.Controls.SettingsFlyout(); settings.Width = 500; //settings.HeaderBackground = new SolidColorBrush(App.VisualElements.BackgroundColor); //.HeaderForeground = new SolidColorBrush(Colors.Black); settings.Title = "Политика конфиденциальности"; //string.Format("{0} Custom 2", App.VisualElements.DisplayName); settings.IconSource = new BitmapImage(Windows.ApplicationModel.Package.Current.Logo); settings.Content = new Privacy(); settings.Show(); }); args.Request.ApplicationCommands.Add(viewAboutMalukahPage); } catch { }; }
private void About_Click(IUICommand cmd) { Windows.UI.Xaml.Controls.SettingsFlyout settings = new Windows.UI.Xaml.Controls.SettingsFlyout(); settings.Background = new SolidColorBrush(Colors.White); settings.HeaderBackground = new SolidColorBrush(Colors.Black); settings.Content = new AboutPanel(); settings.Title = "About"; settings.Show(); RestoreCursor(); }
private void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { // Note this is kept here for posterity but shouldn't be used // see the next sample of using the Windows.UI.Xaml.Controls.SettingsFlyout // in Windows 8.1 for the replacement if you were using this code example before. SettingsCommand cmd = new SettingsCommand("sample", "Sample Custom Setting", (x) => { // create a new instance of the flyout Callisto.Controls.SettingsFlyout settings = new Callisto.Controls.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); }); // note this is the new and preferred way in Windows 8.1 using // Windows.UI.Xaml.Controls.SettingsFlyout // This sample is kept here to show an example of this SettingsCommand cmd2 = new SettingsCommand("sample2", "Sample 2", (x) => { Windows.UI.Xaml.Controls.SettingsFlyout settings = new Windows.UI.Xaml.Controls.SettingsFlyout(); settings.Width = 500; settings.HeaderBackground = new SolidColorBrush(Colors.Orange); settings.HeaderForeground = new SolidColorBrush(Colors.Black); settings.Title = string.Format("{0} Custom 2", App.VisualElements.DisplayName); settings.IconSource = new BitmapImage(Windows.ApplicationModel.Package.Current.Logo); settings.Content = new SettingsContent(); settings.Show(); ObjectTracker.Track(settings); }); args.Request.ApplicationCommands.Add(cmd); args.Request.ApplicationCommands.Add(cmd2); }
public void GoToProfile() { var settings = new Windows.UI.Xaml.Controls.SettingsFlyout { Width = 500, HeaderBackground = new SolidColorBrush(Color.FromArgb(255, 0, 113, 206)), HeaderForeground = new SolidColorBrush(Colors.White), Title = International.Translation.Profile, Content = new iFixit.W81.UI.Views.UC.Profile() }; settings.Show(); }
private void SettingsCommandInvokedHandler(IUICommand command) { ISettingsCommandInfo commandInfo = _commands[command.Id]; _settingsFlyout = new Windows.UI.Xaml.Controls.SettingsFlyout(); _settingsFlyout.HeaderBackground = _headerBrush; _settingsFlyout.IconSource = _smallLogoImageSource; _settingsFlyout.Title = command.Label; #pragma warning disable 612,618 if (ContentBackgroundBrush != null) #pragma warning restore 612,618 { #pragma warning disable 612,618 _settingsFlyout.Background = ContentBackgroundBrush; #pragma warning restore 612,618 } _settingsFlyout.Content = commandInfo.Instance; _settingsFlyout.Width = commandInfo.LiteralWidth; _settingsFlyout.Show(); }
private void BlankPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { // Note this is kept here for posterity but shouldn't be used // see the next sample of using the Windows.UI.Xaml.Controls.SettingsFlyout // in Windows 8.1 for the replacement if you were using this code example before. SettingsCommand cmd = new SettingsCommand("sample", "Sample Custom Setting", (x) => { // create a new instance of the flyout Callisto.Controls.SettingsFlyout settings = new Callisto.Controls.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.HeaderBrush = new SolidColorBrush(Colors.Orange); // 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); }); // note this is the new and preferred way in Windows 8.1 using // Windows.UI.Xaml.Controls.SettingsFlyout // This sample is kept here to show an example of this SettingsCommand cmd2 = new SettingsCommand("sample2", "Sample 2", (x) => { Windows.UI.Xaml.Controls.SettingsFlyout settings = new Windows.UI.Xaml.Controls.SettingsFlyout(); settings.Width = 500; settings.HeaderBackground = new SolidColorBrush(Colors.Orange); settings.HeaderForeground = new SolidColorBrush(Colors.Black); settings.Title = string.Format("{0} Custom 2", App.VisualElements.DisplayName); settings.IconSource = new BitmapImage(Windows.ApplicationModel.Package.Current.Logo); settings.Content = new SettingsContent(); settings.Show(); ObjectTracker.Track(settings); }); args.Request.ApplicationCommands.Add(cmd); args.Request.ApplicationCommands.Add(cmd2); }
void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { var about = new SettingsCommand("about", "About", (handler) => { Windows.UI.Xaml.Controls.SettingsFlyout settings = new Windows.UI.Xaml.Controls.SettingsFlyout(); settings.HeaderBackground = new SolidColorBrush(Colors.Red); settings.Background = new SolidColorBrush(Colors.White); settings.Title = "About"; settings.Width = 600; settings.Content = new AboutUserControl(); settings.Show(); }); args.Request.ApplicationCommands.Add(about); var settingsFlyout = new SettingsCommand("settings", "Settings", (handler) => { Windows.UI.Xaml.Controls.SettingsFlyout settings = new Windows.UI.Xaml.Controls.SettingsFlyout(); settings.HeaderBackground = new SolidColorBrush(Colors.Red); settings.Background = new SolidColorBrush(Colors.White); settings.Title = "Settings"; settings.Width = 600; settings.Content = new SettingsUserControl(); settings.Show(); }); args.Request.ApplicationCommands.Add(settingsFlyout); var emaildev = new SettingsCommand("email dev", "Email Dev", (handler) => { sendEmail(); }); args.Request.ApplicationCommands.Add(emaildev); var privacypolicy = new SettingsCommand("privacy policy", "Privacy Policy", (handler) => { Windows.UI.Xaml.Controls.SettingsFlyout settings = new Windows.UI.Xaml.Controls.SettingsFlyout(); settings.HeaderBackground = new SolidColorBrush(Colors.Red); settings.Background = new SolidColorBrush(Colors.White); settings.Title = "Privacy Policy"; settings.Width = 600; settings.Content = new PrivacyPolicyUserControl(); settings.Show(); }); args.Request.ApplicationCommands.Add(privacypolicy); var donate = new SettingsCommand("donate", "Donate", (handler) => { donateYay(); }); LicenseInformation licenseInformation = CurrentApp.LicenseInformation; var productLicense = licenseInformation.ProductLicenses["Donate"]; if (!productLicense.IsActive) { args.Request.ApplicationCommands.Add(donate); } }