示例#1
0
        public override void ApplyAttribute(ulong attributeEventHandlerId, string attributeName, object attributeValue, string attributeEventUpdatesAttributeName)
        {
            switch (attributeName)
            {
            case nameof(XF.Image.Aspect):
                ImageControl.Aspect = (XF.Aspect)AttributeHelper.GetInt(attributeValue);
                break;

            case nameof(XF.Image.IsAnimationPlaying):
                ImageControl.IsAnimationPlaying = AttributeHelper.GetBool(attributeValue);
                break;

            case nameof(XF.Image.IsOpaque):
                ImageControl.IsOpaque = AttributeHelper.GetBool(attributeValue);
                break;

            case nameof(XF.Image.Source):
                ImageControl.Source = AttributeHelper.DelegateToImageSource(attributeValue);
                break;

            default:
                base.ApplyAttribute(attributeEventHandlerId, attributeName, attributeValue, attributeEventUpdatesAttributeName);
                break;
            }
        }
        public override void ApplyAttribute(ulong attributeEventHandlerId, string attributeName, object attributeValue, string attributeEventUpdatesAttributeName)
        {
            switch (attributeName)
            {
            case nameof(XF.MenuItem.@class):
                MenuItemControl.@class = AttributeHelper.GetStringList(attributeValue);
                break;

            case nameof(XF.MenuItem.IconImageSource):
                MenuItemControl.IconImageSource = AttributeHelper.DelegateToImageSource(attributeValue);
                break;

            case nameof(XF.MenuItem.IsDestructive):
                MenuItemControl.IsDestructive = AttributeHelper.GetBool(attributeValue);
                break;

            case nameof(XF.MenuItem.IsEnabled):
                MenuItemControl.IsEnabled = AttributeHelper.GetBool(attributeValue, true);
                break;

            case nameof(XF.MenuItem.StyleClass):
                MenuItemControl.StyleClass = AttributeHelper.GetStringList(attributeValue);
                break;

            case nameof(XF.MenuItem.Text):
                MenuItemControl.Text = (string)attributeValue;
                break;

            default:
                base.ApplyAttribute(attributeEventHandlerId, attributeName, attributeValue, attributeEventUpdatesAttributeName);
                break;
            }
        }
        public override void ApplyAttribute(ulong attributeEventHandlerId, string attributeName, object attributeValue, string attributeEventUpdatesAttributeName)
        {
            switch (attributeName)
            {
            case nameof(XF.Page.BackgroundImageSource):
                PageControl.BackgroundImageSource = AttributeHelper.DelegateToImageSource(attributeValue);
                break;

            case nameof(XF.Page.IconImageSource):
                PageControl.IconImageSource = AttributeHelper.DelegateToImageSource(attributeValue);
                break;

            case nameof(XF.Page.IsBusy):
                PageControl.IsBusy = AttributeHelper.GetBool(attributeValue);
                break;

            case nameof(XF.Page.Padding):
                PageControl.Padding = AttributeHelper.StringToThickness(attributeValue);
                break;

            case nameof(XF.Page.Title):
                PageControl.Title = (string)attributeValue;
                break;

            default:
                base.ApplyAttribute(attributeEventHandlerId, attributeName, attributeValue, attributeEventUpdatesAttributeName);
                break;
            }
        }
        public override void ApplyAttribute(ulong attributeEventHandlerId, string attributeName, object attributeValue, string attributeEventUpdatesAttributeName)
        {
            switch (attributeName)
            {
            case nameof(XF.Button.BorderColor):
                ButtonControl.BorderColor = AttributeHelper.StringToColor((string)attributeValue);
                break;

            case nameof(XF.Button.BorderWidth):
                ButtonControl.BorderWidth = AttributeHelper.StringToDouble((string)attributeValue, -1.00);
                break;

            case nameof(XF.Button.CharacterSpacing):
                ButtonControl.CharacterSpacing = AttributeHelper.StringToDouble((string)attributeValue);
                break;

            case nameof(XF.Button.CornerRadius):
                ButtonControl.CornerRadius = AttributeHelper.GetInt(attributeValue, -1);
                break;

            case nameof(XF.Button.FontAttributes):
                ButtonControl.FontAttributes = (XF.FontAttributes)AttributeHelper.GetInt(attributeValue);
                break;

            case nameof(XF.Button.FontFamily):
                ButtonControl.FontFamily = (string)attributeValue;
                break;

            case nameof(XF.Button.FontSize):
                ButtonControl.FontSize = AttributeHelper.StringToDouble((string)attributeValue, -1.00);
                break;

            case nameof(XF.Button.ImageSource):
                ButtonControl.ImageSource = AttributeHelper.DelegateToImageSource(attributeValue);
                break;

            case nameof(XF.Button.Padding):
                ButtonControl.Padding = AttributeHelper.StringToThickness(attributeValue);
                break;

            case nameof(XF.Button.Text):
                ButtonControl.Text = (string)attributeValue;
                break;

            case nameof(XF.Button.TextColor):
                ButtonControl.TextColor = AttributeHelper.StringToColor((string)attributeValue);
                break;

            case nameof(XF.Button.TextTransform):
                ButtonControl.TextTransform = (XF.TextTransform)AttributeHelper.GetInt(attributeValue, (int)XF.TextTransform.Default);
                break;

            default:
                base.ApplyAttribute(attributeEventHandlerId, attributeName, attributeValue, attributeEventUpdatesAttributeName);
                break;
            }
        }
        public override void ApplyAttribute(ulong attributeEventHandlerId, string attributeName, object attributeValue, string attributeEventUpdatesAttributeName)
        {
            switch (attributeName)
            {
            case nameof(XF.Shell.FlyoutBackgroundColor):
                ShellControl.FlyoutBackgroundColor = AttributeHelper.StringToColor((string)attributeValue);
                break;

            case nameof(XF.Shell.FlyoutBackgroundImage):
                ShellControl.FlyoutBackgroundImage = AttributeHelper.DelegateToImageSource(attributeValue);
                break;

            case nameof(XF.Shell.FlyoutBackgroundImageAspect):
                ShellControl.FlyoutBackgroundImageAspect = (XF.Aspect)AttributeHelper.GetInt(attributeValue);
                break;

            case nameof(XF.Shell.FlyoutBehavior):
                ShellControl.FlyoutBehavior = (XF.FlyoutBehavior)AttributeHelper.GetInt(attributeValue, (int)XF.FlyoutBehavior.Flyout);
                break;

            case nameof(XF.Shell.FlyoutHeaderBehavior):
                ShellControl.FlyoutHeaderBehavior = (XF.FlyoutHeaderBehavior)AttributeHelper.GetInt(attributeValue);
                break;

            case nameof(XF.Shell.FlyoutIcon):
                ShellControl.FlyoutIcon = AttributeHelper.DelegateToImageSource(attributeValue);
                break;

            case nameof(XF.Shell.FlyoutIsPresented):
                ShellControl.FlyoutIsPresented = AttributeHelper.GetBool(attributeValue);
                break;

            case nameof(XF.Shell.FlyoutVerticalScrollMode):
                ShellControl.FlyoutVerticalScrollMode = (XF.ScrollMode)AttributeHelper.GetInt(attributeValue, (int)XF.ScrollMode.Auto);
                break;

            default:
                base.ApplyAttribute(attributeEventHandlerId, attributeName, attributeValue, attributeEventUpdatesAttributeName);
                break;
            }
        }
示例#6
0
        public override void ApplyAttribute(ulong attributeEventHandlerId, string attributeName, object attributeValue, string attributeEventUpdatesAttributeName)
        {
            switch (attributeName)
            {
            case nameof(XF.BaseShellItem.FlyoutIcon):
                BaseShellItemControl.FlyoutIcon = AttributeHelper.DelegateToImageSource(attributeValue);
                break;

            case nameof(XF.BaseShellItem.Icon):
                BaseShellItemControl.Icon = AttributeHelper.DelegateToImageSource(attributeValue);
                break;

            case nameof(XF.BaseShellItem.IsEnabled):
                BaseShellItemControl.IsEnabled = AttributeHelper.GetBool(attributeValue, true);
                break;

            case nameof(XF.BaseShellItem.IsTabStop):
                BaseShellItemControl.IsTabStop = AttributeHelper.GetBool(attributeValue, true);
                break;

            case nameof(XF.BaseShellItem.IsVisible):
                BaseShellItemControl.IsVisible = AttributeHelper.GetBool(attributeValue, true);
                break;

            case nameof(XF.BaseShellItem.Route):
                BaseShellItemControl.Route = (string)attributeValue;
                break;

            case nameof(XF.BaseShellItem.TabIndex):
                BaseShellItemControl.TabIndex = AttributeHelper.GetInt(attributeValue);
                break;

            case nameof(XF.BaseShellItem.Title):
                BaseShellItemControl.Title = (string)attributeValue;
                break;

            default:
                base.ApplyAttribute(attributeEventHandlerId, attributeName, attributeValue, attributeEventUpdatesAttributeName);
                break;
            }
        }
        public override void ApplyAttribute(ulong attributeEventHandlerId, string attributeName, object attributeValue, string attributeEventUpdatesAttributeName)
        {
            switch (attributeName)
            {
            case nameof(XF.Slider.Maximum):
                SliderControl.Maximum = AttributeHelper.StringToDouble((string)attributeValue, 1.00);
                break;

            case nameof(XF.Slider.MaximumTrackColor):
                SliderControl.MaximumTrackColor = AttributeHelper.StringToColor((string)attributeValue);
                break;

            case nameof(XF.Slider.Minimum):
                SliderControl.Minimum = AttributeHelper.StringToDouble((string)attributeValue);
                break;

            case nameof(XF.Slider.MinimumTrackColor):
                SliderControl.MinimumTrackColor = AttributeHelper.StringToColor((string)attributeValue);
                break;

            case nameof(XF.Slider.ThumbColor):
                SliderControl.ThumbColor = AttributeHelper.StringToColor((string)attributeValue);
                break;

            case nameof(XF.Slider.ThumbImageSource):
                SliderControl.ThumbImageSource = AttributeHelper.DelegateToImageSource(attributeValue);
                break;

            case nameof(XF.Slider.Value):
                SliderControl.Value = AttributeHelper.StringToDouble((string)attributeValue);
                break;

            default:
                base.ApplyAttribute(attributeEventHandlerId, attributeName, attributeValue, attributeEventUpdatesAttributeName);
                break;
            }
        }
        public override void ApplyAttribute(ulong attributeEventHandlerId, string attributeName, object attributeValue, string attributeEventUpdatesAttributeName)
        {
            switch (attributeName)
            {
            case nameof(XF.ImageButton.Aspect):
                ImageButtonControl.Aspect = (XF.Aspect)AttributeHelper.GetInt(attributeValue);
                break;

            case nameof(XF.ImageButton.BorderColor):
                ImageButtonControl.BorderColor = AttributeHelper.StringToColor((string)attributeValue);
                break;

            case nameof(XF.ImageButton.BorderWidth):
                ImageButtonControl.BorderWidth = AttributeHelper.StringToDouble((string)attributeValue, -1.00);
                break;

            case nameof(XF.ImageButton.CornerRadius):
                ImageButtonControl.CornerRadius = AttributeHelper.GetInt(attributeValue, -1);
                break;

            case nameof(XF.ImageButton.IsOpaque):
                ImageButtonControl.IsOpaque = AttributeHelper.GetBool(attributeValue);
                break;

            case nameof(XF.ImageButton.Padding):
                ImageButtonControl.Padding = AttributeHelper.StringToThickness(attributeValue);
                break;

            case nameof(XF.ImageButton.Source):
                ImageButtonControl.Source = AttributeHelper.DelegateToImageSource(attributeValue);
                break;

            default:
                base.ApplyAttribute(attributeEventHandlerId, attributeName, attributeValue, attributeEventUpdatesAttributeName);
                break;
            }
        }