<commit_before>/// <reference path="../Runtime/Nullstone.js" />
/// <reference path="UIElement.js"/>
/// <reference path="../Runtime/MulticastEvent.js"/>
/// <reference path="../Primitives/Rect.js"/>
/// <reference path="PropertyValueProviders/StylePropertyValueProvider.js"/>
/// <reference path="PropertyValueProviders/ImplicitStylePropertyValueProvider.js"/>
/// <reference path="PropertyValueProviders/FrameworkElementPropertyValueProvider.js"/>
/// <reference path="PropertyValueProviders/InheritedDataContextPropertyValueProvider.js"/>
/// CODE
/// <reference path="../Runtime/BError.js"/>
/// <reference path="Style.js"/>
/// <reference path="VisualTreeHelper.js"/>

//#region FrameworkElement
var FrameworkElement = Nullstone.Create("FrameworkElement", UIElement);

FrameworkElement.Instance.Init = function () {
    this.Init$UIElement();

    this._BoundsWithChildren = new Rect();
    this._GlobalBoundsWithChildren = new Rect();
    this._SurfaceBoundsWithChildren = new Rect();
    this._ExtentsWithChildren = new Rect();

    this.AddProvider(new _StylePropertyValueProvider(this, _PropertyPrecedence.LocalStyle));
    this.AddProvider(new _ImplicitStylePropertyValueProvider(this, _PropertyPrecedence.ImplicitStyle));
    this.AddProvider(new FrameworkElementPropertyValueProvider(this, _PropertyPrecedence.DynamicValue));
    this.AddProvider(new _InheritedDataContextPropertyValueProvider(this, _PropertyPrecedence.InheritedDataContext));

    this.SizeChanged = new MulticastEvent();
    this.LayoutUpdated = {
        Subscribe: function (callback, closure) {
            var surface = App.Instance.MainSurface;
            if (surface)
                surface.LayoutUpdated.Subscribe(callback, closure);
        },
        Unsubscribe: function (callback, closure) {
            var surface = App.Instance.MainSurface;
            if (surface)
                surface.LayoutUpdated.Unsubscribe(callback, closure);
        }
    };
};

//#region Properties

FrameworkElement.CursorProperty = DependencyProperty.RegisterFull("Cursor", function () { return new Enum(CursorType); }, FrameworkElement, CursorType.Default); //TODO: AutoCreator: FrameworkElement._CoerceCursor);
FrameworkElement.HeightProperty = DependencyProperty.RegisterCore("Height", function () { return Number; }, FrameworkElement, NaN);
FrameworkElement.WidthProperty = DependencyProperty.RegisterCore("Width", function () { return Number; }, FrameworkElement, NaN);
FrameworkElement.ActualHeightProperty = DependencyProperty.RegisterReadOnlyCore("ActualHeight", function () { return Number; }, FrameworkElement);
FrameworkElement.ActualWidthProperty = DependencyProperty.RegisterReadOnlyCore("ActualWidth", function () { return Number; }, FrameworkElement);
FrameworkElement.DataContextProperty = DependencyProperty.RegisterCore("DataContext", function () { return Object; }, FrameworkElement);
FrameworkElement.HorizontalAlignmentProperty = DependencyProperty.RegisterCore("HorizontalAlignment", function () { return new Enum(HorizontalAlignment); }, FrameworkElement, HorizontalAlignment.Stretch);
FrameworkElement.LanguageProperty = DependencyProperty.RegisterCore("Language", function () { return String; }, FrameworkElement);
FrameworkElement.MarginProperty = DependencyProperty.RegisterCore("Margin", function () { return Thickness; }, FrameworkElement, new Thickness());
FrameworkElement.MaxHeightProperty = DependencyProperty.RegisterCore("MaxHeight", function () { return Number; }, FrameworkElement, Number.POSITIVE_INFINITY);
FrameworkElement.MaxWidthProperty = DependencyProperty.RegisterCore("MaxWidth", function () { return Number; }, FrameworkElement, Number.POSITIVE_INFINITY);
FrameworkElement.MinHeightProperty = DependencyProperty.RegisterCore("MinHeight", function () { return Number; }, FrameworkElement, 0.0);
FrameworkElement.MinWidthProperty = DependencyProperty.RegisterCore("MinWidth", function () { return Number; }, FrameworkElement, 0.0);
FrameworkElement.VerticalAlignmentProperty = DependencyProperty.RegisterCore("VerticalAlignment", function () { return new Enum(VerticalAlignment); }, FrameworkElement, VerticalAlignment.Stretch);
FrameworkElement.StyleProperty = DependencyProperty.RegisterCore("Style", function () { return Style; }, FrameworkElement);
FrameworkElement.FlowDirectionProperty = DependencyProperty.RegisterInheritable("FlowDirection", function () { return new Enum(FlowDirection); }, FrameworkElement, undefined, undefined, undefined, _Inheritable.FlowDirection);

Nullstone.AutoProperties(FrameworkElement, [
    FrameworkElement.CursorProperty,
    FrameworkElement.WidthProperty,
    FrameworkElement.HeightProperty,
    FrameworkElement.DataContextProperty,
    FrameworkElement.HorizontalAlignmentProperty,
    FrameworkElement.LanguageProperty,
    FrameworkElement.MarginProperty,
    FrameworkElement.MaxWidthProperty,
    FrameworkElement.MaxHeightProperty,
    FrameworkElement.MinWidthProperty,
    FrameworkElement.MinHeightProperty,
    FrameworkElement.VerticalAlignmentProperty,
    FrameworkElement.StyleProperty,<commit_msg>Added default value to FlowDirection.<commit_after>/// <reference path="../Runtime/Nullstone.js" />
/// <reference path="UIElement.js"/>
/// <reference path="../Runtime/MulticastEvent.js"/>
/// <reference path="../Primitives/Rect.js"/>
/// <reference path="PropertyValueProviders/StylePropertyValueProvider.js"/>
/// <reference path="PropertyValueProviders/ImplicitStylePropertyValueProvider.js"/>
/// <reference path="PropertyValueProviders/FrameworkElementPropertyValueProvider.js"/>
/// <reference path="PropertyValueProviders/InheritedDataContextPropertyValueProvider.js"/>
/// CODE
/// <reference path="../Runtime/BError.js"/>
/// <reference path="Style.js"/>
/// <reference path="VisualTreeHelper.js"/>

//#region FrameworkElement
var FrameworkElement = Nullstone.Create("FrameworkElement", UIElement);

FrameworkElement.Instance.Init = function () {
    this.Init$UIElement();

    this._BoundsWithChildren = new Rect();
    this._GlobalBoundsWithChildren = new Rect();
    this._SurfaceBoundsWithChildren = new Rect();
    this._ExtentsWithChildren = new Rect();

    this.AddProvider(new _StylePropertyValueProvider(this, _PropertyPrecedence.LocalStyle));
    this.AddProvider(new _ImplicitStylePropertyValueProvider(this, _PropertyPrecedence.ImplicitStyle));
    this.AddProvider(new FrameworkElementPropertyValueProvider(this, _PropertyPrecedence.DynamicValue));
    this.AddProvider(new _InheritedDataContextPropertyValueProvider(this, _PropertyPrecedence.InheritedDataContext));

    this.SizeChanged = new MulticastEvent();
    this.LayoutUpdated = {
        Subscribe: function (callback, closure) {
            var surface = App.Instance.MainSurface;
            if (surface)
                surface.LayoutUpdated.Subscribe(callback, closure);
        },
        Unsubscribe: function (callback, closure) {
            var surface = App.Instance.MainSurface;
            if (surface)
                surface.LayoutUpdated.Unsubscribe(callback, closure);
        }
    };
};

//#region Properties

FrameworkElement.CursorProperty = DependencyProperty.RegisterFull("Cursor", function () { return new Enum(CursorType); }, FrameworkElement, CursorType.Default); //TODO: AutoCreator: FrameworkElement._CoerceCursor);
FrameworkElement.HeightProperty = DependencyProperty.RegisterCore("Height", function () { return Number; }, FrameworkElement, NaN);
FrameworkElement.WidthProperty = DependencyProperty.RegisterCore("Width", function () { return Number; }, FrameworkElement, NaN);
FrameworkElement.ActualHeightProperty = DependencyProperty.RegisterReadOnlyCore("ActualHeight", function () { return Number; }, FrameworkElement);
FrameworkElement.ActualWidthProperty = DependencyProperty.RegisterReadOnlyCore("ActualWidth", function () { return Number; }, FrameworkElement);
FrameworkElement.DataContextProperty = DependencyProperty.RegisterCore("DataContext", function () { return Object; }, FrameworkElement);
FrameworkElement.HorizontalAlignmentProperty = DependencyProperty.RegisterCore("HorizontalAlignment", function () { return new Enum(HorizontalAlignment); }, FrameworkElement, HorizontalAlignment.Stretch);
FrameworkElement.LanguageProperty = DependencyProperty.RegisterCore("Language", function () { return String; }, FrameworkElement);
FrameworkElement.MarginProperty = DependencyProperty.RegisterCore("Margin", function () { return Thickness; }, FrameworkElement, new Thickness());
FrameworkElement.MaxHeightProperty = DependencyProperty.RegisterCore("MaxHeight", function () { return Number; }, FrameworkElement, Number.POSITIVE_INFINITY);
FrameworkElement.MaxWidthProperty = DependencyProperty.RegisterCore("MaxWidth", function () { return Number; }, FrameworkElement, Number.POSITIVE_INFINITY);
FrameworkElement.MinHeightProperty = DependencyProperty.RegisterCore("MinHeight", function () { return Number; }, FrameworkElement, 0.0);
FrameworkElement.MinWidthProperty = DependencyProperty.RegisterCore("MinWidth", function () { return Number; }, FrameworkElement, 0.0);
FrameworkElement.VerticalAlignmentProperty = DependencyProperty.RegisterCore("VerticalAlignment", function () { return new Enum(VerticalAlignment); }, FrameworkElement, VerticalAlignment.Stretch);
FrameworkElement.StyleProperty = DependencyProperty.RegisterCore("Style", function () { return Style; }, FrameworkElement);
FrameworkElement.FlowDirectionProperty = DependencyProperty.RegisterInheritable("FlowDirection", function () { return new Enum(FlowDirection); }, FrameworkElement, FlowDirection.LeftToRight, undefined, undefined, _Inheritable.FlowDirection);

Nullstone.AutoProperties(FrameworkElement, [
    FrameworkElement.CursorProperty,
    FrameworkElement.WidthProperty,
    FrameworkElement.HeightProperty,
    FrameworkElement.DataContextProperty,
    FrameworkElement.HorizontalAlignmentProperty,
    FrameworkElement.LanguageProperty,
    FrameworkElement.MarginProperty,
    FrameworkElement.MaxWidthProperty,
    FrameworkElement.MaxHeightProperty,
    FrameworkElement.MinWidthProperty,
    FrameworkElement.MinHeightProperty,
    FrameworkElement.VerticalAlignmentProperty,
    FrameworkElement.StyleProperty,
{'fraction_non_alphanumeric': 0.11215686274509803, 'fraction_numerical': 0.000784313725490196, 'mean_word_length': 6.281227694503926, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '2655335', 'n_tokens_mistral': 2489, 'n_tokens_neox': 2364, 'n_words': 437}