<commit_before>﻿using Windows.Foundation.Metadata;
using Windows.UI.Xaml;

namespace UWPHelper.Triggers
{
    public sealed class IsApiContractPresentTrigger : StateTriggerBase
    {
        public static readonly DependencyProperty ContractNameProperty = DependencyProperty.Register(nameof(ContractName), typeof(string), typeof(IsApiContractPresentTrigger), new PropertyMetadata(null, OnPropertyChanged));
        public static readonly DependencyProperty MajorVersionProperty = DependencyProperty.Register(nameof(MajorVersion), typeof(int), typeof(IsApiContractPresentTrigger), new PropertyMetadata(null, OnPropertyChanged));
        public static readonly DependencyProperty MinorVersionProperty = DependencyProperty.Register(nameof(MinorVersion), typeof(int), typeof(IsApiContractPresentTrigger), new PropertyMetadata(null, OnPropertyChanged));
        
        public string ContractName
        {
            get { return (string)GetValue(ContractNameProperty); }
            set { SetValue(ContractNameProperty, value); }
        }
        public int MajorVersion
        {
            get { return (int)GetValue(MajorVersionProperty); }
            set { SetValue(MajorVersionProperty, value); }
        }
        public int MinorVersion
        {
            get { return (int)GetValue(MinorVersionProperty); }
            set { SetValue(MinorVersionProperty, value); }
        }

        private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            IsApiContractPresentTrigger isApiContractPresentTrigger = (IsApiContractPresentTrigger)d;

            if (isApiContractPresentTrigger.ReadLocalValue(MajorVersionProperty) != DependencyProperty.UnsetValue)
            {
                if (isApiContractPresentTrigger.ReadLocalValue(MinorVersionProperty) != DependencyProperty.UnsetValue)
                {
                    isApiContractPresentTrigger.SetActive(ApiInformation.IsApiContractPresent(isApiContractPresentTrigger.ContractName, (ushort)isApiContractPresentTrigger.MajorVersion, (ushort)isApiContractPresentTrigger.MinorVersion));
                }
                else
                {
                    isApiContractPresentTrigger.SetActive(ApiInformation.IsApiContractPresent(isApiContractPresentTrigger.ContractName, (ushort)isApiContractPresentTrigger.MajorVersion));
                }
            }
        }
    }
}<commit_msg>Minor change in IsApiContractPresentTrigger<commit_after>﻿using Windows.Foundation.Metadata;
using Windows.UI.Xaml;

namespace UWPHelper.Triggers
{
    public sealed class IsApiContractPresentTrigger : StateTriggerBase
    {
        public static readonly DependencyProperty ContractNameProperty = DependencyProperty.Register(nameof(ContractName), typeof(string), typeof(IsApiContractPresentTrigger), new PropertyMetadata(null, OnPropertyChanged));
        public static readonly DependencyProperty MajorVersionProperty = DependencyProperty.Register(nameof(MajorVersion), typeof(int), typeof(IsApiContractPresentTrigger), new PropertyMetadata(null, OnPropertyChanged));
        public static readonly DependencyProperty MinorVersionProperty = DependencyProperty.Register(nameof(MinorVersion), typeof(int), typeof(IsApiContractPresentTrigger), new PropertyMetadata(null, OnPropertyChanged));

        public string ContractName
        {
            get { return (string)GetValue(ContractNameProperty); }
            set { SetValue(ContractNameProperty, value); }
        }
        // Cannot use ushort here, since XAML is unable to assign numbers to it
        public int MajorVersion
        {
            get { return (int)GetValue(MajorVersionProperty); }
            set { SetValue(MajorVersionProperty, value); }
        }
        public int MinorVersion
        {
            get { return (int)GetValue(MinorVersionProperty); }
            set { SetValue(MinorVersionProperty, value); }
        }

        private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            IsApiContractPresentTrigger isApiContractPresentTrigger = (IsApiContractPresentTrigger)d;

            if (isApiContractPresentTrigger.ReadLocalValue(MajorVersionProperty) != DependencyProperty.UnsetValue)
            {
                if (isApiContractPresentTrigger.ReadLocalValue(MinorVersionProperty) == DependencyProperty.UnsetValue)
                {
                    isApiContractPresentTrigger.SetActive(ApiInformation.IsApiContractPresent(isApiContractPresentTrigger.ContractName, (ushort)isApiContractPresentTrigger.MajorVersion));
                }
                else
                {
                    isApiContractPresentTrigger.SetActive(ApiInformation.IsApiContractPresent(isApiContractPresentTrigger.ContractName, (ushort)isApiContractPresentTrigger.MajorVersion, (ushort)isApiContractPresentTrigger.MinorVersion));
                }
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.06989465153970827, 'fraction_numerical': 0.0, 'mean_word_length': 3.4080357142857145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7551334', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1125, 'n_words': 203}