Esempio n. 1
0
        /// <summary>
        /// Show a settings flyout using the Callisto toolkit (http://callistotoolkit.com/)
        /// </summary>
        /// <param name="title">Name of flyout</param>
        /// <param name="content">UserControl containing the content to be displayed in the flyout</param>
        /// <param name="width">Flyout width (narrow or wide)</param>
        private async void ShowFlyout(string title, Windows.UI.Xaml.Controls.UserControl content,
                                      SettingsFlyout.SettingsFlyoutWidth width = SettingsFlyout.SettingsFlyoutWidth.Narrow)
        {
            // grab app theme color from resources (optional)
            SolidColorBrush color = null;

            if (App.Current.Resources.Keys.Contains("AppThemeBrush"))
            {
                color = App.Current.Resources["AppThemeBrush"] as SolidColorBrush;
            }

            // create the flyout
            var flyout = new SettingsFlyout();

            if (color != null)
            {
                flyout.HeaderBrush = color;
            }
            flyout.HeaderText  = title;
            flyout.FlyoutWidth = width;

            // access the small logo from the manifest
            flyout.SmallLogoImageSource = new BitmapImage((await AppManifestHelper.GetManifestVisualElementsAsync()).SmallLogoUri);

            // assign content and show
            flyout.Content = content;
            flyout.IsOpen  = true;
        }
Esempio n. 2
0
 public SettingsCommandInfo(string headerText, SettingsFlyout.SettingsFlyoutWidth width, SolidColorBrush headerTextBrush, SolidColorBrush contentBackgroundBrush, SolidColorBrush contentForegroundBrush)
 {
     HeaderText             = headerText;
     Width                  = width;
     HeaderTextBrush        = headerTextBrush;
     ContentBackgroundBrush = contentBackgroundBrush;
     ContentForegroundBrush = contentForegroundBrush;
 }
Esempio n. 3
0
        public void AddCommand <T>(string headerText, SettingsFlyout.SettingsFlyoutWidth width = SettingsFlyout.SettingsFlyoutWidth.Narrow) where T : UserControl, new()
        {
            string key = headerText.Trim().Replace(" ", "");

            if (!_commands.ContainsKey(key))
            {
                _commands.Add(key, new SettingsCommandInfo <T>(headerText, width));
            }
        }
Esempio n. 4
0
 public SettingsCommandInfo(string headerText, SettingsFlyout.SettingsFlyoutWidth width)
 {
     HeaderText = headerText;
     Width      = width;
     if (width == SettingsFlyout.SettingsFlyoutWidth.Narrow)
     {
         LiteralWidth = 346;
     }
     else
     {
         LiteralWidth = 646;
     }
 }
Esempio n. 5
0
        public SettingsCommandInfo(string headerText, SettingsFlyout.SettingsFlyoutWidth width)
        {
            HeaderText = headerText;
#pragma warning disable 0618 //Ignore obsolete warning
            Width = width;
            if (width == SettingsFlyout.SettingsFlyoutWidth.Narrow)
#pragma warning restore 0618
            {
                LiteralWidth = 346;
            }
            else
            {
                LiteralWidth = 646;
            }
        }
Esempio n. 6
0
 public SettingsCommandInfo(string headerText, SettingsFlyout.SettingsFlyoutWidth width)
 {
     HeaderText = headerText;
     Width      = width;
 }
        public void AddCommand <T>(string headerText, SolidColorBrush headerBrush, SolidColorBrush contentBackgroundBrush, SolidColorBrush contentForegroundBrush, SettingsFlyout.SettingsFlyoutWidth width = SettingsFlyout.SettingsFlyoutWidth.Narrow) where T : UserControl, new()
        {
            string key = headerText.Trim().Replace(" ", "");

            if (!_commands.ContainsKey(key))
            {
                _commands.Add(key, new SettingsCommandInfo <T>(headerText, width, headerBrush, contentBackgroundBrush, contentForegroundBrush));
            }
        }