using Microsoft.Services.Store.Engagement;
using System;
using Windows.ApplicationModel;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace FoxTube.Pages.SettingsPages
{
    /// <summary>
    /// Page with general information about the app
    /// </summary>
    public sealed partial class About : Page
    {
        public About()
        {
            InitializeComponent();
            PackageVersion ver = Package.Current.Id.Version;
            version.Text = $"{ver.Major}.{ver.Minor}.{ver.Build}";

            crMe.Text = crMe.Text.Insert(1, " " + DateTime.Now.Year);
            crYt.Text = crYt.Text.Insert(1, " " + DateTime.Now.Year);

            if (StoreServicesFeedbackLauncher.IsSupported())
                feedback.Visibility = Visibility.Visible;
        }

        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            await StoreServicesFeedbackLauncher.GetDefault().LaunchAsync();
        }
    }
}
