<commit_before>﻿using System;
using System.Reflection;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;

namespace XamlCSS.UWP.TestApp
{
    /// <summary>
    /// Provides application-specific behavior to supplement the default Application class.
    /// </summary>
    sealed partial class App : Application
    {
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
                Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
                Microsoft.ApplicationInsights.WindowsCollectors.Session);

            Css.Initialize(new[] { GetType().GetTypeInfo().Assembly });

            this.InitializeComponent();
            this.Suspending += OnSuspending;
            this.UnhandledException += App_UnhandledException;
        }

        private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {

        }

        public string cssStyle1 = @"
Button
{
	Foreground: Red;
}
.container
{
	Background: Yellow;

    Button
    {
	    Foreground: Brown;
    }
}
.jumbo
{
	FontSize: 50;
}
Grid Grid 
{
    TextBlock:nth-of-type(1)
    {
	    Grid.Row: 0;
	    Grid.Column: 1;
	    Text: #Binding Test;
    }

    TextBlock:nth-of-type(2)
    {
	    Grid.Row: 1;
	    Grid.Column: 0;
	    Text: StaticResource testString;
    }
}
";

        public string cssStyle2 = @"
Window
{
	Background: #333333;
	Foreground: #ffffff;
}
Button
{
	Foreground: Red;
	Height: 40;
	Width: 100;
}
.container
{
	Background: #aaaaaa;

    Button
    {
	    Foreground: Brown;
    }
}
#thebutton
{
	FontSize: 30;
}
.jumbo
{
	FontSize: 50;
	FontStyle: Italic;
	HorizontalAlignment: Center;
}
Grid Grid 
{
    TextBlock:nth-of-type(1)
    {
	    Grid.Row: 1;
	    Grid.Column: 1;
    }

    TextBlock:nth-of-type(2)
    {
	    Grid.Row: 0;
	    Grid.Column: 0;
    }
}
";
        public string currentStyle;

        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,<commit_msg>UWP: fixed initialization order in sample app if Application.Current.Resources is already initialized (HRESULT: 0x8000FFFF (E_UNEXPECTED))<commit_after>﻿using System;
using System.Reflection;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;

namespace XamlCSS.UWP.TestApp
{
    /// <summary>
    /// Provides application-specific behavior to supplement the default Application class.
    /// </summary>
    sealed partial class App : Application
    {
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
                Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
                Microsoft.ApplicationInsights.WindowsCollectors.Session);

            this.InitializeComponent();
            
            this.Suspending += OnSuspending;
            this.UnhandledException += App_UnhandledException;
        }
        
        private void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {

        }

        public string cssStyle1 = @"
Button
{
	Foreground: Red;
}
.container
{
	Background: Yellow;

    Button
    {
	    Foreground: Brown;
    }
}
.jumbo
{
	FontSize: 50;
}
Grid Grid 
{
    TextBlock:nth-of-type(1)
    {
	    Grid.Row: 0;
	    Grid.Column: 1;
	    Text: #Binding Test;
    }

    TextBlock:nth-of-type(2)
    {
	    Grid.Row: 1;
	    Grid.Column: 0;
	    Text: StaticResource testString;
    }
}
";

        public string cssStyle2 = @"
Window
{
	Background: #333333;
	Foreground: #ffffff;
}
Button
{
	Foreground: Red;
	Height: 40;
	Width: 100;
}
.container
{
	Background: #aaaaaa;

    Button
    {
	    Foreground: Brown;
    }
}
#thebutton
{
	FontSize: 30;
}
.jumbo
{
	FontSize: 50;
	FontStyle: Italic;
	HorizontalAlignment: Center;
}
Grid Grid 
{
    TextBlock:nth-of-type(1)
    {
	    Grid.Row: 1;
	    Grid.Column: 1;
    }

    TextBlock:nth-of-type(2)
    {
	    Grid.Row: 0;
	    Grid.Column: 0;
    }
}
";
        public string currentStyle;

        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            Css.Initialize(new[] { GetType().GetTypeInfo().Assembly });

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif
            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
{'fraction_non_alphanumeric': 0.10013175230566534, 'fraction_numerical': 0.01103425559947299, 'mean_word_length': 2.286255411255411, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3493618', 'n_tokens_mistral': 1854, 'n_tokens_neox': 1750, 'n_words': 459}