/// <summary>
        /// Create an InventariumFlyout.
        /// </summary>
        /// <param name="foreground">The color of Text and Border, NOTE: the BackButton color binds to the ApplicationTextBrush, so it's best to stick to that too.</param>
        /// <param name="background">Color of Background.</param>
        /// <param name="title">Header/Title</param>
        /// <param name="dimension">Width -> Narrow of Wide</param>
        /// <param name="url">url to open in browser.</param>
        /// <param name="image">optional: display an image next to the header</param>
        public InventariumFlyout(
            Brush foreground,
            Brush background,
            string title,
            FlyoutDimension dimension,
            string url,
            BitmapImage image = null)
        {
            this.InitializeComponent();
            this.Dimension = dimension;
            //to handle app activation -> close
            Window.Current.Activated += OnWindowActivated;
            //prepare the frame
            mainBorder.Width = (int)dimension;
            mainBorder.Height = Window.Current.Bounds.Height;
            //fill in the content
            flyoutTitle.Text = title;
            //contentPanel.Children.Add(content);
            smallImage.Source = image;
            //brush the controls according to the parameters
            mainBorder.BorderBrush = foreground;
            flyoutTitle.Foreground = foreground;
            mainFrame.Background = background;

            progressRing.IsActive = true;
            webView.LoadCompleted += OnWebViewOnLoadCompleted;

            webView.Navigate(new Uri(url));
        }
 /// <summary>
 /// Create FlyoutCustomization
 /// </summary>
 /// <param name="foreground">The color of Text and Border, NOTE: the BackButton color binds to the ApplicationTextBrush, so it's best to stick to that too.</param>
 /// <param name="background">Color of Background.</param>
 /// <param name="title">Header/Title</param>
 /// <param name="dimension">Width -> Narrow of Wide</param>
 /// <param name="image">optional: display an image next to the header</param>
 public FlyoutCustomization(
     Brush foreground,
     Brush background,
     string title,
     FlyoutDimension dimension,
     BitmapImage image = null)
 {
     Foreground = foreground;
     Background = background;
     Title = title;
     Dimension = dimension;
     Image = image;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Create a Flyout.
 /// </summary>
 /// <param name="foreground">The color of Text and Border, NOTE: the BackButton color binds to the ApplicationTextBrush, so it's best to stick to that too.</param>
 /// <param name="background">Color of Background.</param>
 /// <param name="title">Header/Title</param>
 /// <param name="dimension">Width -> Narrow of Wide</param>
 /// <param name="content">A control that contains the relevant content.</param>
 /// <param name="image">optional: display an image next to the header</param>
 public Flyout(Brush foreground, Brush background, string title, FlyoutDimension dimension, UIElement content, BitmapImage image = null)
 {
     this.InitializeComponent();
     this.Dimension = dimension;
     //to handle app activation -> close
     Window.Current.Activated += OnWindowActivated;
     //prepare the frame
     mainBorder.Width  = (int)dimension;
     mainBorder.Height = Window.Current.Bounds.Height;
     //fill in the content
     flyoutTitle.Text = title;
     contentPanel.Children.Add(content);
     smallImage.Source = image;
     //brush the controls according to the parameters
     mainBorder.BorderBrush = foreground;
     flyoutTitle.Foreground = foreground;
     mainFrame.Background   = background;
 }