示例#1
0
        public void Visit(RootNode node, INode parentNode)
        {
            var rnode = (XamlLoader.RuntimeRootNode)node;

            Values[node]        = rnode.Root;
            Context.Types[node] = rnode.Root.GetType();
            if (rnode.Root is BindableObject bindable)
            {
                if (NameScope.GetNameScope(bindable) is INameScope existingNs)
                {
                    node.NameScopeRef.NameScope = existingNs;
                }
                else
                {
                    NameScope.SetNameScope(bindable, node.NameScopeRef?.NameScope);
                }
            }

            var assemblyName = (Context.RootAssembly ?? Context.RootElement.GetType().Assembly)?.GetName().Name;

            if (rnode.Root != null && !rnode.Root.GetType().IsValueType&& XamlFilePathAttribute.GetFilePathForObject(Context.RootElement) is string path)
            {
                VisualDiagnostics.RegisterSourceInfo(rnode.Root, new Uri($"{path};assembly={assemblyName}", UriKind.Relative), ((IXmlLineInfo)node).LineNumber, ((IXmlLineInfo)node).LinePosition);
            }
        }
示例#2
0
        // NOTE:  The code here is highly similar to RemoveChildCore in ModelVisual3D,
        //        but slightly different because the parent is 2D here.
        void IVisual3DContainer.RemoveChild(Visual3D child)
        {
            int index = child.ParentIndex;

            // It is invalid to modify the children collection that we
            // might be iterating during a property invalidation tree walk.
            if (IsVisualChildrenIterationInProgress)
            {
                throw new InvalidOperationException(SR.Get(SRID.CannotModifyVisualChildrenDuringTreeWalk));
            }

            Debug.Assert(child != null);
            Debug.Assert(child.InternalVisualParent == this);

            VisualDiagnostics.OnVisualChildChanged(this, child, false);

            child.SetParent(/* newParent = */ (Visual)null);   // CS0121: Call is ambigious without casting null to Visual.

            // remove the inheritance context
            if (_inheritanceContextForChildren != null)
            {
                _inheritanceContextForChildren.RemoveSelfAsInheritanceContext(child, null);
            }

            //
            // Remove the child on all channels this visual is marshalled to.
            //

            for (int i = 0, limit = _proxy3D.Count; i < limit; i++)
            {
                DUCE.Channel channel = _proxy3D.GetChannel(i);

                if (child.CheckFlagsAnd(channel, VisualProxyFlags.IsConnectedToParent))
                {
                    child.SetFlags(channel, false, VisualProxyFlags.IsConnectedToParent);
                    DUCE.IResource childResource = (DUCE.IResource)child;
                    childResource.RemoveChildFromParent(this, channel);
                    childResource.ReleaseOnChannel(channel);
                }
            }

            SetFlagsOnAllChannels(true, VisualProxyFlags.IsContentDirty);

            //
            // Force a full precompute and render pass for this visual.
            //

            Visual.PropagateFlags(
                this,
                VisualFlags.IsSubtreeDirtyForPrecompute,
                VisualProxyFlags.IsSubtreeDirtyForRender);

            //


            child.FireOnVisualParentChanged(this);

            OnVisualChildrenChanged(/* visualAdded = */ null, child);
        }
示例#3
0
 /// <include file="../../docs/Microsoft.Maui.Controls/TableSectionBase.xml" path="//Member[@MemberName='Add']/Docs" />
 public void Add(T item)
 {
     _children.Add(item);
     if (item is IVisualTreeElement element)
     {
         VisualDiagnostics.OnChildAdded(this, element);
     }
 }
示例#4
0
        /// <include file="../../docs/Microsoft.Maui.Controls/TableSectionBase.xml" path="//Member[@MemberName='Remove']/Docs" />
        public bool Remove(T item)
        {
            if (item is IVisualTreeElement element)
            {
                VisualDiagnostics.OnChildRemoved(this, element, _children.IndexOf(item));
            }

            return(_children.Remove(item));
        }
示例#5
0
        /// <include file="../../docs/Microsoft.Maui.Controls/TableSectionBase.xml" path="//Member[@MemberName='Insert']/Docs" />
        public void Insert(int index, T item)
        {
            if (item is IVisualTreeElement element)
            {
                VisualDiagnostics.OnChildAdded(this, element, index);
            }

            _children.Insert(index, item);
        }
示例#6
0
            public void SourceInfoIsRelative([Values(false)] bool useCompiledXaml)
            {
                var page = new Maui2418(useCompiledXaml);

                Assert.That(page, Is.Not.Null);
                var label0     = page.label0;
                var sourceInfo = VisualDiagnostics.GetSourceInfo(label0);

                Assert.That(sourceInfo.SourceUri.OriginalString, Is.EqualTo($"Issues{System.IO.Path.DirectorySeparatorChar}Maui2418.xaml;assembly=Microsoft.Maui.Controls.Xaml.UnitTests"));
            }
示例#7
0
        /// <include file="../../docs/Microsoft.Maui.Controls/TableSectionBase.xml" path="//Member[@MemberName='RemoveAt']/Docs" />
        public void RemoveAt(int index)
        {
            T item = _children[index];

            if (item is IVisualTreeElement element)
            {
                VisualDiagnostics.OnChildRemoved(this, element, index);
            }

            _children.RemoveAt(index);
        }
示例#8
0
        /// <include file="../../docs/Microsoft.Maui.Controls/TableSectionBase.xml" path="//Member[@MemberName='Clear']/Docs" />
        public void Clear()
        {
            foreach (T item in _children)
            {
                if (item is IVisualTreeElement element)
                {
                    VisualDiagnostics.OnChildRemoved(this, element, _children.IndexOf(item));
                }
            }

            _children.Clear();
        }
示例#9
0
        public static object Create(string xaml, bool doNotThrow, bool useDesignProperties)
        {
            doNotThrow = doNotThrow || ResourceLoader.ExceptionHandler2 != null;
            void ehandler(Exception e) => ResourceLoader.ExceptionHandler2?.Invoke((e, null));

            object inflatedView = null;

            using (var textreader = new StringReader(xaml))
                using (var reader = XmlReader.Create(textreader)) {
                    while (reader.Read())
                    {
                        //Skip until element
                        if (reader.NodeType == XmlNodeType.Whitespace)
                        {
                            continue;
                        }
                        if (reader.NodeType == XmlNodeType.XmlDeclaration)
                        {
                            continue;
                        }
                        if (reader.NodeType != XmlNodeType.Element)
                        {
                            Debug.WriteLine("Unhandled node {0} {1} {2}", reader.NodeType, reader.Name, reader.Value);
                            continue;
                        }

                        var typeArguments = XamlParser.GetTypeArguments(reader);
                        var rootnode      = new RuntimeRootNode(new XmlType(reader.NamespaceURI, reader.Name, typeArguments), null, (IXmlNamespaceResolver)reader)
                        {
                            LineNumber = ((IXmlLineInfo)reader).LineNumber, LinePosition = ((IXmlLineInfo)reader).LinePosition
                        };

                        XamlParser.ParseXaml(rootnode, reader);
                        var visitorContext = new HydrationContext {
                            ExceptionHandler = doNotThrow ? ehandler : (Action <Exception>)null,
                        };
                        var cvv = new CreateValuesVisitor(visitorContext);
                        cvv.Visit((ElementNode)rootnode, null);
                        inflatedView = rootnode.Root = visitorContext.Values[rootnode];
                        if (XamlFilePathAttribute.GetFilePathForObject(inflatedView) is string path)
                        {
                            VisualDiagnostics.RegisterSourceInfo(inflatedView, new Uri($"{path};assembly={inflatedView.GetType().GetTypeInfo().Assembly.GetName().Name}", UriKind.Relative), ((IXmlLineInfo)rootnode).LineNumber, ((IXmlLineInfo)rootnode).LinePosition);
                            VisualDiagnostics.SendVisualTreeChanged(null, inflatedView);
                        }
                        visitorContext.RootElement = inflatedView as BindableObject;

                        Visit(rootnode, visitorContext, useDesignProperties);
                        break;
                    }
                }
            return(inflatedView);
        }
示例#10
0
            void VTChanged(object sender, VisualTreeChangeEventArgs e)
            {
                var parentSourInfo = e.Parent == null ? null : VisualDiagnostics.GetXamlSourceInfo(e.Parent);
                var childSourInfo  = VisualDiagnostics.GetXamlSourceInfo(e.Child);

                if (childSourInfo == null)
                {
                    failures++;
                }
                if (e.Parent != null && parentSourInfo == null)
                {
                    failures++;
                }
            }
示例#11
0
        protected override void UnhookContent(Cell content)
        {
            base.UnhookContent(content);

            if (content == null || !_logicalChildren.Contains(content))
            {
                return;
            }
            var index = _logicalChildren.IndexOf(content);

            _logicalChildren.Remove(content);
            content.Parent = null;
            VisualDiagnostics.OnChildRemoved(this, content, index);
        }
示例#12
0
        protected override void SetupContent(Cell content, int index)
        {
            base.SetupContent(content, index);
            if (content is ViewCell viewCell && viewCell.View != null && HasUnevenRows)
            {
                viewCell.View.ComputedConstraint = LayoutConstraint.None;
            }

            if (content != null)
            {
                _logicalChildren.Add(content);
            }

            content.Parent = this;
            VisualDiagnostics.OnChildAdded(this, content);
        }
示例#13
0
        // NOTE:  The code here is highly similar to AddChildCore in ModelVisual3D,
        //        but slightly different because the parent is 2D here.
        void IVisual3DContainer.AddChild(Visual3D child)
        {
            // It is invalid to modify the children collection that we
            // might be iterating during a property invalidation tree walk.
            if (IsVisualChildrenIterationInProgress)
            {
                throw new InvalidOperationException(SR.Get(SRID.CannotModifyVisualChildrenDuringTreeWalk));
            }

            // invalid during a VisualTreeChanged event
            VisualDiagnostics.VerifyVisualTreeChange(this);

            Debug.Assert(child != null);
            Debug.Assert(child.InternalVisualParent == null);

            child.SetParent(this);

            // set the inheritance context so databinding, etc... work
            if (_inheritanceContextForChildren != null)
            {
                _inheritanceContextForChildren.ProvideSelfAsInheritanceContext(child, null);
            }

            SetFlagsOnAllChannels(true, VisualProxyFlags.IsContentDirty);

            // The child already might be dirty. Hence we need to propagate dirty information
            // from the parent and from the child.
            Visual.PropagateFlags(
                this,
                VisualFlags.IsSubtreeDirtyForPrecompute,
                VisualProxyFlags.IsSubtreeDirtyForRender);

            Visual3D.PropagateFlags(
                child,
                VisualFlags.IsSubtreeDirtyForPrecompute,
                VisualProxyFlags.IsSubtreeDirtyForRender);

            //


            // Fire notifications
            OnVisualChildrenChanged(child, /* visualRemoved = */ null);

            child.FireOnVisualParentChanged(null);
            VisualDiagnostics.OnVisualChildChanged(this, child, true);
        }
示例#14
0
        public static void Load(object view, string xaml, Assembly rootAssembly, bool useDesignProperties)
        {
            using (var textReader = new StringReader(xaml))
                using (var reader = XmlReader.Create(textReader)) {
                    while (reader.Read())
                    {
                        //Skip until element
                        if (reader.NodeType == XmlNodeType.Whitespace)
                        {
                            continue;
                        }
                        if (reader.NodeType == XmlNodeType.XmlDeclaration)
                        {
                            continue;
                        }
                        if (reader.NodeType != XmlNodeType.Element)
                        {
                            Debug.WriteLine("Unhandled node {0} {1} {2}", reader.NodeType, reader.Name, reader.Value);
                            continue;
                        }

                        var rootnode = new RuntimeRootNode(new XmlType(reader.NamespaceURI, reader.Name, null), view, (IXmlNamespaceResolver)reader)
                        {
                            LineNumber = ((IXmlLineInfo)reader).LineNumber, LinePosition = ((IXmlLineInfo)reader).LinePosition
                        };
                        if (XamlFilePathAttribute.GetFilePathForObject(view) is string path)
                        {
                            VisualDiagnostics.RegisterSourceInfo(view, new Uri($"{path};assembly={view.GetType().GetTypeInfo().Assembly.GetName().Name}", UriKind.Relative), ((IXmlLineInfo)rootnode).LineNumber, ((IXmlLineInfo)rootnode).LinePosition);
                            VisualDiagnostics.SendVisualTreeChanged(null, view);
                        }
                        XamlParser.ParseXaml(rootnode, reader);
#pragma warning disable 0618
                        var doNotThrow = ResourceLoader.ExceptionHandler2 != null || Internals.XamlLoader.DoNotThrowOnExceptions;
#pragma warning restore 0618
                        void ehandler(Exception e) => ResourceLoader.ExceptionHandler2?.Invoke((e, XamlFilePathAttribute.GetFilePathForObject(view)));

                        Visit(rootnode, new HydrationContext {
                            RootElement      = view,
                            RootAssembly     = rootAssembly ?? view.GetType().GetTypeInfo().Assembly,
                            ExceptionHandler = doNotThrow ? ehandler : (Action <Exception>)null
                        }, useDesignProperties);
                        break;
                    }
                }
        }
示例#15
0
 public async Task LaunchAndDebug(IMessageBus messageBus, CancellationTokenSource cancellationTokenSource)
 {
     await ThreadUtil.RunOnStaThreadAsync(async() =>
     {
         using (var retryFilter = new RetryMessageFilter())
         {
             var diagnostics         = new VisualDiagnostics(this, DiagnosticMessageSink, messageBus, cancellationTokenSource);
             var extensionsToInstall = VsInstance.GetExtensionsToInstall(ExtensionDirectories);
             var installation        = VisualStudioUtil.FindInstallations().First(i => i.ApplicationPath == ApplicationPath);
             var hive = new VsHive(installation, RootSuffix);
             await VsInstance.Prepare(hive, extensionsToInstall, resetSettings: false, diagnostics, installInvoker: false);
             var process = await diagnostics.RunAsync("Launching Instance", () => Task.FromResult(VisualStudioUtil.StartProcess(hive)));
             if (Debugger.IsAttached)
             {
                 await VsInstance.AttachDebugger(process, DebugMixedMode, diagnostics);
             }
         }
     });
 }
示例#16
0
        public static void Load(object view, string xaml, Assembly rootAssembly, bool useDesignProperties)
        {
            using (var textReader = new StringReader(xaml))
                using (var reader = XmlReader.Create(textReader))
                {
                    while (reader.Read())
                    {
                        //Skip until element
                        if (reader.NodeType == XmlNodeType.Whitespace)
                        {
                            continue;
                        }
                        if (reader.NodeType == XmlNodeType.XmlDeclaration)
                        {
                            continue;
                        }
                        if (reader.NodeType != XmlNodeType.Element)
                        {
                            Debug.WriteLine("Unhandled node {0} {1} {2}", reader.NodeType, reader.Name, reader.Value);
                            continue;
                        }

                        var rootnode = new RuntimeRootNode(new XmlType(reader.NamespaceURI, reader.Name, null), view, (IXmlNamespaceResolver)reader)
                        {
                            LineNumber = ((IXmlLineInfo)reader).LineNumber, LinePosition = ((IXmlLineInfo)reader).LinePosition
                        };
                        XamlParser.ParseXaml(rootnode, reader);
                        var doNotThrow = ResourceLoader.ExceptionHandler2 != null;
                        void ehandler(Exception e) => ResourceLoader.ExceptionHandler2?.Invoke((e, XamlFilePathAttribute.GetFilePathForObject(view)));

                        Visit(rootnode, new HydrationContext
                        {
                            RootElement      = view,
                            RootAssembly     = rootAssembly ?? view.GetType().Assembly,
                            ExceptionHandler = doNotThrow ? ehandler : (Action <Exception>)null
                        }, useDesignProperties);

                        VisualDiagnostics.OnChildAdded(null, view as Element);

                        break;
                    }
                }
        }
示例#17
0
        public static void SetPropertyValue(object xamlelement, XmlName propertyName, object value, object rootElement, INode node, HydrationContext context, IXmlLineInfo lineInfo)
        {
            var       localName       = propertyName.LocalName;
            var       serviceProvider = new XamlServiceProvider(node, context);
            Exception xpe             = null;
            var       xKey            = node is IElementNode && ((IElementNode)node).Properties.ContainsKey(XmlName.xKey) ? ((ValueNode)((IElementNode)node).Properties[XmlName.xKey]).Value as string : null;

            //If it's an attached BP, update elementType and propertyName
            var bpOwnerType = xamlelement.GetType();
            var attached    = GetRealNameAndType(ref bpOwnerType, propertyName.NamespaceURI, ref localName, context, lineInfo);
            var property    = GetBindableProperty(bpOwnerType, localName, lineInfo, false);

            //If the target is an event, connect
            if (xpe == null && TryConnectEvent(xamlelement, localName, attached, value, rootElement, lineInfo, out xpe))
            {
                return;
            }

            //If Value is DynamicResource and it's a BP, SetDynamicResource
            if (xpe == null && TrySetDynamicResource(xamlelement, property, value, lineInfo, out xpe))
            {
                return;
            }

            //If value is BindingBase, SetBinding
            if (xpe == null && TrySetBinding(xamlelement, property, localName, value, lineInfo, out xpe))
            {
                return;
            }

            var assemblyName = (context.RootAssembly ?? rootElement.GetType().GetTypeInfo().Assembly)?.GetName().Name;

            //If it's a BindableProberty, SetValue
            if (xpe == null && TrySetValue(xamlelement, property, attached, value, lineInfo, serviceProvider, out xpe))
            {
                if (!(node is ValueNode) && value != null && !value.GetType().GetTypeInfo().IsValueType&& XamlFilePathAttribute.GetFilePathForObject(context.RootElement) is string path)
                {
                    VisualDiagnostics.RegisterSourceInfo(value, new Uri($"{path};assembly={assemblyName}", UriKind.Relative), ((IXmlLineInfo)node).LineNumber, ((IXmlLineInfo)node).LinePosition);
                }
                return;
            }

            //If we can assign that value to a normal property, let's do it
            if (xpe == null && TrySetProperty(xamlelement, localName, value, lineInfo, serviceProvider, context, out xpe))
            {
                if (!(node is ValueNode) && value != null && !value.GetType().GetTypeInfo().IsValueType&& XamlFilePathAttribute.GetFilePathForObject(context.RootElement) is string path)
                {
                    VisualDiagnostics.RegisterSourceInfo(value, new Uri($"{path};assembly={assemblyName}", UriKind.Relative), ((IXmlLineInfo)node).LineNumber, ((IXmlLineInfo)node).LinePosition);
                }
                return;
            }

            //If it's an already initialized property, add to it
            if (xpe == null && TryAddToProperty(xamlelement, propertyName, value, xKey, lineInfo, serviceProvider, context, out xpe))
            {
                if (!(node is ValueNode) && value != null && !value.GetType().GetTypeInfo().IsValueType&& XamlFilePathAttribute.GetFilePathForObject(context.RootElement) is string path)
                {
                    VisualDiagnostics.RegisterSourceInfo(value, new Uri($"{path};assembly={assemblyName}", UriKind.Relative), ((IXmlLineInfo)node).LineNumber, ((IXmlLineInfo)node).LinePosition);
                }
                return;
            }

            xpe = xpe ?? new XamlParseException($"Cannot assign property \"{localName}\": Property does not exist, or is not assignable, or mismatching type between value and property", lineInfo);
            if (context.ExceptionHandler != null)
            {
                context.ExceptionHandler(xpe);
            }
            else
            {
                throw xpe;
            }
        }
示例#18
0
        //Used by HotReload, do not change signature
        public static bool TrySetPropertyValue(object element, XmlName propertyName, string xKey, object value, object rootElement, IXmlLineInfo lineInfo, IServiceProvider serviceProvider, out Exception xpe)
        {
            var localName = propertyName.LocalName;

            xpe = null;

            void registerSourceInfo(object target, string path)
            {
                var assemblyName = rootElement.GetType().GetTypeInfo().Assembly?.GetName().Name;

                if (lineInfo != null)
                {
                    VisualDiagnostics.RegisterSourceInfo(target, new Uri($"{path};assembly={assemblyName}", UriKind.Relative), lineInfo.LineNumber, lineInfo.LinePosition);
                }
            }

            //If it's an attached BP, update elementType and propertyName
            var bpOwnerType = element.GetType();
            var attached    = GetRealNameAndType(ref bpOwnerType, propertyName.NamespaceURI, ref localName, rootElement, lineInfo);
            var property    = GetBindableProperty(bpOwnerType, localName, lineInfo, false);

            //If the target is an event, connect
            if (xpe == null && TryConnectEvent(element, localName, attached, value, rootElement, lineInfo, out xpe))
            {
                return(true);
            }

            //If Value is DynamicResource and it's a BP, SetDynamicResource
            if (xpe == null && TrySetDynamicResource(element, property, value, lineInfo, out xpe))
            {
                return(true);
            }

            //If value is BindingBase, SetBinding
            if (xpe == null && TrySetBinding(element, property, localName, value, lineInfo, out var binding, out xpe))
            {
                if (binding != null && XamlFilePathAttribute.GetFilePathForObject(rootElement) is string path)
                {
                    registerSourceInfo(binding, path);
                }
                return(true);
            }

            //If it's a BindableProberty, SetValue
            if (xpe == null && TrySetValue(element, property, attached, value, lineInfo, serviceProvider, out xpe))
            {
                if (value != null && !value.GetType().GetTypeInfo().IsValueType&& XamlFilePathAttribute.GetFilePathForObject(rootElement) is string path)
                {
                    registerSourceInfo(value, path);
                }
                return(true);
            }

            //If we can assign that value to a normal property, let's do it
            if (xpe == null && TrySetProperty(element, localName, value, lineInfo, serviceProvider, rootElement, out xpe))
            {
                if (value != null && !value.GetType().GetTypeInfo().IsValueType&& XamlFilePathAttribute.GetFilePathForObject(rootElement) is string path)
                {
                    registerSourceInfo(value, path);
                }
                return(true);
            }

            //If it's an already initialized property, add to it
            if (xpe == null && TryAddToProperty(element, propertyName, value, xKey, lineInfo, serviceProvider, rootElement, out xpe))
            {
                if (value != null && !value.GetType().GetTypeInfo().IsValueType&& XamlFilePathAttribute.GetFilePathForObject(rootElement) is string path)
                {
                    registerSourceInfo(value, path);
                }
                return(true);
            }

            xpe = xpe ?? new XamlParseException($"Cannot assign property \"{localName}\": Property does not exist, or is not assignable, or mismatching type between value and property", lineInfo);
            return(false);
        }
示例#19
0
        public MainWindow()
        {
            VisualDiagnostics.EnableVisualTreeChanged();
            VisualDiagnostics.VisualTreeChanged += VisualDiagnosticsOnVisualTreeChanged;

            InitializeComponent();

            Binding.AddTargetUpdatedHandler(this, Handler);
            PrimaryRibbonModel model = new PrimaryRibbonModel();
            var modelTab             = new RibbonModelTab {
                Header = "Tab 1"
            };

            model.RibbonItems.Add(modelTab);
            var group1 = new RibbonModelGroup {
                Label = "Group 1"
            };
            // var modelControlGroup = new RibbonModelControlGroup();
            // modelControlGroup.Items.Add(new RibbonModelButton() { Label = "Click me" });
            // modelControlGroup.Items.Add(new RibbonModelButton() { Label = "Click me toos" });
            var insertFruitcommand = TryFindResource("InsertFruitCommand") as ICommand;
            var group2             = new RibbonModelGroup {
                Label = "Fruit"
            };

            var modelButton = new RibbonModelButton()
            {
                Label = "Strawberry", LargeImageSource = TryFindResource("Strawberry")
            };

            modelButton.Command          = insertFruitcommand;
            modelButton.CommandTarget    = this;
            modelButton.CommandParameter = modelButton;
            group2.Items.Add(modelButton);
            var modelItem = new RibbonModelButton
            {
                Label = "Grapes", LargeImageSource = TryFindResource("Grapes"), Command = insertFruitcommand
            };

            modelItem.CommandParameter = modelItem;
            group2.Items.Add(modelItem);
            modelItem.CommandTarget = this;
            var button = new RibbonModelButton()
            {
                Label = "Watermelon", LargeImageSource = TryFindResource("Watermelon")
            };

            button.Command          = insertFruitcommand;
            button.CommandTarget    = this;
            button.CommandParameter = button;
            group2.Items.Add(button);
            var comboBox = new RibbonModelItemComboBox()
            {
                Label = "Fruit dropdown"
            };
            var modelGallery = new RibbonModelGallery();

            var modelGalleryCategory = CreateFruitGalleryCategory();

            modelGallery.Items.Add(modelGalleryCategory);


            CommandBindings.Add(new CommandBinding(insertFruitcommand, Executed));

            var cat1 = CreateFruitGalleryCategory();

            cat1.Command       = insertFruitcommand;
            cat1.CommandTarget = this;
            RibbonModelItemMenuButton FruitButton = new RibbonModelItemMenuButton()
            {
                Label = "Fruit Selector"
            };
            var gallery = new RibbonModelGallery();

            gallery.Items.Add(cat1);
            FruitButton.ItemsCollection.Add(gallery);

            group1.Items.Add(FruitButton);
            comboBox.Items.Add(modelGallery);
            group1.Items.Add(comboBox);
            // group1.Items.Add(modelControlGroup);
            modelTab.ItemsCollection.Add(group1);
            modelTab.ItemsCollection.Add(group2);
            DataContext = model;
        }
示例#20
0
        /// <summary>
        ///     Invoked when logical parent is changed.  This just
        ///     sets the parent pointer.
        /// </summary>
        /// <remarks>
        ///     A parent change is considered catastrohpic and results in a large
        ///     amount of invalidations and tree traversals. <cref see="DependencyFastBuild"/>
        ///     is recommended to reduce the work necessary to build a tree
        /// </remarks>
        /// <param name="newParent">
        ///     New parent that was set
        /// </param>
        internal void ChangeLogicalParent(DependencyObject newParent)
        {
            ///////////////////
            // OnNewParent:
            ///////////////////

            //
            // -- Approved By The Core Team --
            //
            // Do not allow foreign threads to change the tree.
            // (This is a noop if this object is not assigned to a Dispatcher.)
            //
            // We also need to ensure that the tree is homogenous with respect
            // to the dispatchers that the elements belong to.
            //
            this.VerifyAccess();
            if (newParent != null)
            {
                newParent.VerifyAccess();
            }

            // Logical Parent must first be dropped before you are attached to a newParent
            // This mitigates illegal tree state caused by logical child stealing as illustrated in bug 970706
            if (_parent != null && newParent != null && _parent != newParent)
            {
                throw new System.InvalidOperationException(SR.Get(SRID.HasLogicalParent));
            }

            // Trivial check to avoid loops
            if (newParent == this)
            {
                throw new System.InvalidOperationException(SR.Get(SRID.CannotBeSelfParent));
            }

            // invalid during a VisualTreeChanged event
            VisualDiagnostics.VerifyVisualTreeChange(this);

            // Logical Parent implies no InheritanceContext
            if (newParent != null)
            {
                ClearInheritanceContext();
            }

            IsParentAnFE = newParent is FrameworkElement;

            DependencyObject oldParent = _parent;

            OnNewParent(newParent);

            // Update Has[Loaded/Unloaded]Handler Flags
            BroadcastEventHelper.AddOrRemoveHasLoadedChangeHandlerFlag(this, oldParent, newParent);



            ///////////////////
            // OnParentChanged:
            ///////////////////

            // Invalidate relevant properties for this subtree
            DependencyObject parent = (newParent != null) ? newParent : oldParent;

            TreeWalkHelper.InvalidateOnTreeChange(/* fe = */ this, /* fce = */ null, parent, (newParent != null));

            // If no one has called BeginInit then mark the element initialized and fire Initialized event
            // (non-parser programmatic tree building scenario)
            TryFireInitialized();
        }
示例#21
0
        private void InitializeComponent()
        {
            if (ResourceLoader.CanProvideContentFor(new ResourceLoader.ResourceLoadingQuery
            {
                AssemblyName = typeof(App).GetTypeInfo().Assembly.GetName(),
                ResourcePath = "App.xaml",
                Instance = this
            }))
            {
                __InitComponentRuntime();
                return;
            }
            if (XamlLoader.XamlFileProvider != null && XamlLoader.XamlFileProvider(GetType()) != null)
            {
                __InitComponentRuntime();
                return;
            }
            On on  = new On();
            On on2 = new On();
            OnPlatform <string> onPlatform = new OnPlatform <string>();
            On on3 = new On();
            On on4 = new On();
            OnPlatform <string> onPlatform2 = new OnPlatform <string>();
            On on5 = new On();
            On on6 = new On();
            OnPlatform <string> onPlatform3 = new OnPlatform <string>();
            Color color  = new Color(0.18823529779911041, 0.18823529779911041, 0.18431372940540314, 1.0);
            Color color2 = new Color(0.49019607901573181, 0.48627451062202454, 0.48627451062202454, 1.0);
            Color color3 = new Color(0.72156864404678345, 0.72156864404678345, 0.72156864404678345, 1.0);
            Color color4 = new Color(0.97254902124404907, 0.96078431606292725, 0.9686274528503418, 1.0);
            Color color5 = new Color(0.886274516582489, 0.0235294122248888, 0.074509806931018829, 1.0);
            ResourceDictionary resourceDictionary = new ResourceDictionary();
            App       app;
            NameScope value = (NameScope)(NameScope.GetNameScope(app = this) ?? new NameScope());

            NameScope.SetNameScope(app, value);
            app.Resources = resourceDictionary;
            VisualDiagnostics.RegisterSourceInfo(resourceDictionary, new Uri("App.xaml", UriKind.RelativeOrAbsolute), 8, 10);
            on.Platform = new List <string>(1)
            {
                "Android"
            };
            on.Value = "Fonts/TCL-Light_0.otf#TCL";
            onPlatform.Platforms.Add(on);
            VisualDiagnostics.RegisterSourceInfo(on, new Uri("App.xaml", UriKind.RelativeOrAbsolute), 10, 18);
            on2.Platform = new List <string>(1)
            {
                "iOS"
            };
            on2.Value = "TCL-Light";
            onPlatform.Platforms.Add(on2);
            VisualDiagnostics.RegisterSourceInfo(on2, new Uri("App.xaml", UriKind.RelativeOrAbsolute), 11, 18);
            resourceDictionary.Add("TCLLight", onPlatform);
            on3.Platform = new List <string>(1)
            {
                "Android"
            };
            on3.Value = "Fonts/TCL-Regular_0.otf#TCL";
            onPlatform2.Platforms.Add(on3);
            VisualDiagnostics.RegisterSourceInfo(on3, new Uri("App.xaml", UriKind.RelativeOrAbsolute), 14, 18);
            on4.Platform = new List <string>(1)
            {
                "iOS"
            };
            on4.Value = "TCL-Regular";
            onPlatform2.Platforms.Add(on4);
            VisualDiagnostics.RegisterSourceInfo(on4, new Uri("App.xaml", UriKind.RelativeOrAbsolute), 15, 18);
            resourceDictionary.Add("TCLRegular", onPlatform2);
            on5.Platform = new List <string>(1)
            {
                "Android"
            };
            on5.Value = "Fonts/TCL-Bold_0.otf#TCL";
            onPlatform3.Platforms.Add(on5);
            VisualDiagnostics.RegisterSourceInfo(on5, new Uri("App.xaml", UriKind.RelativeOrAbsolute), 18, 18);
            on6.Platform = new List <string>(1)
            {
                "iOS"
            };
            on6.Value = "TCL-Bold";
            onPlatform3.Platforms.Add(on6);
            VisualDiagnostics.RegisterSourceInfo(on6, new Uri("App.xaml", UriKind.RelativeOrAbsolute), 19, 18);
            resourceDictionary.Add("TCLBold", onPlatform3);
            resourceDictionary.Add("DarkGrayColor", color);
            resourceDictionary.Add("MediumGrayColor", color2);
            resourceDictionary.Add("DisabledGrayColor", color3);
            resourceDictionary.Add("LightGrayColor", color4);
            resourceDictionary.Add("TCLRed", color5);
            app.Resources = resourceDictionary;
            VisualDiagnostics.RegisterSourceInfo(resourceDictionary, new Uri("App.xaml", UriKind.RelativeOrAbsolute), 8, 10);
            VisualDiagnostics.RegisterSourceInfo(app, new Uri("App.xaml", UriKind.RelativeOrAbsolute), 2, 2);
        }
示例#22
0
        private void InitializeComponent()
        {
            if (ResourceLoader.CanProvideContentFor(new ResourceLoader.ResourceLoadingQuery
            {
                AssemblyName = typeof(PopupPage).GetTypeInfo().Assembly.GetName(),
                ResourcePath = "Views/PopupPage.xaml",
                Instance = this
            }))
            {
                __InitComponentRuntime();
                return;
            }
            if (XamlLoader.XamlFileProvider != null && XamlLoader.XamlFileProvider(GetType()) != null)
            {
                __InitComponentRuntime();
                return;
            }
            StaticResourceExtension staticResourceExtension = new StaticResourceExtension();
            BindingExtension        bindingExtension        = new BindingExtension();
            BindingExtension        bindingExtension2       = new BindingExtension();
            Image                   image                    = new Image();
            BindingExtension        bindingExtension3        = new BindingExtension();
            BindingExtension        bindingExtension4        = new BindingExtension();
            Image                   image2                   = new Image();
            BindingExtension        bindingExtension5        = new BindingExtension();
            BindingExtension        bindingExtension6        = new BindingExtension();
            StaticResourceExtension staticResourceExtension2 = new StaticResourceExtension();
            StaticResourceExtension staticResourceExtension3 = new StaticResourceExtension();
            Label                   label                    = new Label();
            BindingExtension        bindingExtension7        = new BindingExtension();
            ImageButton             imageButton              = new ImageButton();
            FlexLayout              flexLayout               = new FlexLayout();
            StaticResourceExtension staticResourceExtension4 = new StaticResourceExtension();
            StaticResourceExtension staticResourceExtension5 = new StaticResourceExtension();
            Label                   label2                   = new Label();
            BindingExtension        bindingExtension8        = new BindingExtension();
            BindingExtension        bindingExtension9        = new BindingExtension();
            StaticResourceExtension staticResourceExtension6 = new StaticResourceExtension();
            StaticResourceExtension staticResourceExtension7 = new StaticResourceExtension();
            Label                   label3                   = new Label();
            FlexLayout              flexLayout2              = new FlexLayout();
            PopupPage               popupPage;
            NameScope               nameScope = (NameScope)(NameScope.GetNameScope(popupPage = this) ?? new NameScope());

            NameScope.SetNameScope(popupPage, nameScope);
            popupPage.SetValue(FlexLayout.DirectionProperty, new FlexDirectionTypeConverter().ConvertFromInvariantString("Column"));
            popupPage.SetValue(FlexLayout.AlignItemsProperty, new FlexAlignItemsTypeConverter().ConvertFromInvariantString("Stretch"));
            popupPage.SetValue(FlexLayout.JustifyContentProperty, new FlexJustifyTypeConverter().ConvertFromInvariantString("Start"));
            staticResourceExtension.Key = "LightGrayColor";
            XamlServiceProvider xamlServiceProvider = new XamlServiceProvider();
            Type typeFromHandle = typeof(IProvideValueTarget);

            object[] array = new object[0 + 1];
            array[0] = popupPage;
            object service;

            xamlServiceProvider.Add(typeFromHandle, service = new SimpleValueTargetProvider(array, VisualElement.BackgroundColorProperty, nameScope));
            xamlServiceProvider.Add(typeof(IReferenceProvider), service);
            Type typeFromHandle2 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver = new XmlNamespaceResolver();

            xmlNamespaceResolver.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xamlServiceProvider.Add(typeFromHandle2, new XamlTypeResolver(xmlNamespaceResolver, typeof(PopupPage).GetTypeInfo().Assembly));
            xamlServiceProvider.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(8, 13)));
            object obj = ((IMarkupExtension)staticResourceExtension).ProvideValue((IServiceProvider)xamlServiceProvider);

            popupPage.BackgroundColor = (Color)obj;
            VisualDiagnostics.RegisterSourceInfo(obj, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 8, 13);
            flexLayout.SetValue(FlexLayout.DirectionProperty, new FlexDirectionTypeConverter().ConvertFromInvariantString("Row"));
            flexLayout.SetValue(FlexLayout.AlignItemsProperty, new FlexAlignItemsTypeConverter().ConvertFromInvariantString("Center"));
            flexLayout.SetValue(FlexLayout.JustifyContentProperty, new FlexJustifyTypeConverter().ConvertFromInvariantString("SpaceBetween"));
            flexLayout.SetValue(FlexLayout.BasisProperty, new FlexBasis.FlexBasisTypeConverter().ConvertFromInvariantString("70"));
            flexLayout.SetValue(FlexLayout.ShrinkProperty, 0f);
            flexLayout.SetValue(VisualElement.BackgroundColorProperty, Color.White);
            image.SetValue(VisualElement.HeightRequestProperty, 25.0);
            image.SetValue(Image.AspectProperty, Aspect.AspectFit);
            image.SetValue(View.MarginProperty, new Thickness(20.0, 0.0, 0.0, 0.0));
            bindingExtension.Path = "SelectedVehicule";
            BindingBase binding = ((IMarkupExtension <BindingBase>)bindingExtension).ProvideValue((IServiceProvider)null);

            image.SetBinding(BindableObject.BindingContextProperty, binding);
            bindingExtension2.Path = "ModeImagePath";
            BindingBase binding2 = ((IMarkupExtension <BindingBase>)bindingExtension2).ProvideValue((IServiceProvider)null);

            image.SetBinding(Image.SourceProperty, binding2);
            flexLayout.Children.Add(image);
            VisualDiagnostics.RegisterSourceInfo(image, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 15, 10);
            image2.SetValue(VisualElement.HeightRequestProperty, 25.0);
            image2.SetValue(Image.AspectProperty, Aspect.AspectFit);
            image2.SetValue(View.MarginProperty, new Thickness(2.0, 0.0, 0.0, 0.0));
            bindingExtension3.Path = "SelectedVehicule";
            BindingBase binding3 = ((IMarkupExtension <BindingBase>)bindingExtension3).ProvideValue((IServiceProvider)null);

            image2.SetBinding(BindableObject.BindingContextProperty, binding3);
            bindingExtension4.Path = "LigneImagePath";
            BindingBase binding4 = ((IMarkupExtension <BindingBase>)bindingExtension4).ProvideValue((IServiceProvider)null);

            image2.SetBinding(Image.SourceProperty, binding4);
            flexLayout.Children.Add(image2);
            VisualDiagnostics.RegisterSourceInfo(image2, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 20, 10);
            bindingExtension5.Path = "SelectedVehicule";
            BindingBase binding5 = ((IMarkupExtension <BindingBase>)bindingExtension5).ProvideValue((IServiceProvider)null);

            label.SetBinding(BindableObject.BindingContextProperty, binding5);
            bindingExtension6.Path = "Destination";
            BindingBase binding6 = ((IMarkupExtension <BindingBase>)bindingExtension6).ProvideValue((IServiceProvider)null);

            label.SetBinding(Label.TextProperty, binding6);
            staticResourceExtension2.Key = "DarkGrayColor";
            XamlServiceProvider xamlServiceProvider2 = new XamlServiceProvider();
            Type typeFromHandle3 = typeof(IProvideValueTarget);

            object[] array2 = new object[0 + 3];
            array2[0] = label;
            array2[1] = flexLayout;
            array2[2] = popupPage;
            object service2;

            xamlServiceProvider2.Add(typeFromHandle3, service2 = new SimpleValueTargetProvider(array2, Label.TextColorProperty, nameScope));
            xamlServiceProvider2.Add(typeof(IReferenceProvider), service2);
            Type typeFromHandle4 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver2 = new XmlNamespaceResolver();

            xmlNamespaceResolver2.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver2.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xamlServiceProvider2.Add(typeFromHandle4, new XamlTypeResolver(xmlNamespaceResolver2, typeof(PopupPage).GetTypeInfo().Assembly));
            xamlServiceProvider2.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(27, 16)));
            object obj2 = ((IMarkupExtension)staticResourceExtension2).ProvideValue((IServiceProvider)xamlServiceProvider2);

            label.TextColor = (Color)obj2;
            VisualDiagnostics.RegisterSourceInfo(obj2, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 27, 16);
            staticResourceExtension3.Key = "TCLRegular";
            XamlServiceProvider xamlServiceProvider3 = new XamlServiceProvider();
            Type typeFromHandle5 = typeof(IProvideValueTarget);

            object[] array3 = new object[0 + 3];
            array3[0] = label;
            array3[1] = flexLayout;
            array3[2] = popupPage;
            object service3;

            xamlServiceProvider3.Add(typeFromHandle5, service3 = new SimpleValueTargetProvider(array3, Label.FontFamilyProperty, nameScope));
            xamlServiceProvider3.Add(typeof(IReferenceProvider), service3);
            Type typeFromHandle6 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver3 = new XmlNamespaceResolver();

            xmlNamespaceResolver3.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver3.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xamlServiceProvider3.Add(typeFromHandle6, new XamlTypeResolver(xmlNamespaceResolver3, typeof(PopupPage).GetTypeInfo().Assembly));
            xamlServiceProvider3.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(28, 16)));
            object target = label.FontFamily = (string)((IMarkupExtension)staticResourceExtension3).ProvideValue((IServiceProvider)xamlServiceProvider3);

            VisualDiagnostics.RegisterSourceInfo(target, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 28, 16);
            BindableProperty    fontSizeProperty     = Label.FontSizeProperty;
            FontSizeConverter   fontSizeConverter    = new FontSizeConverter();
            XamlServiceProvider xamlServiceProvider4 = new XamlServiceProvider();
            Type typeFromHandle7 = typeof(IProvideValueTarget);

            object[] array4 = new object[0 + 3];
            array4[0] = label;
            array4[1] = flexLayout;
            array4[2] = popupPage;
            object service4;

            xamlServiceProvider4.Add(typeFromHandle7, service4 = new SimpleValueTargetProvider(array4, Label.FontSizeProperty, nameScope));
            xamlServiceProvider4.Add(typeof(IReferenceProvider), service4);
            Type typeFromHandle8 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver4 = new XmlNamespaceResolver();

            xmlNamespaceResolver4.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver4.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xamlServiceProvider4.Add(typeFromHandle8, new XamlTypeResolver(xmlNamespaceResolver4, typeof(PopupPage).GetTypeInfo().Assembly));
            xamlServiceProvider4.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(29, 16)));
            label.SetValue(fontSizeProperty, ((IExtendedTypeConverter)fontSizeConverter).ConvertFromInvariantString("Default", (IServiceProvider)xamlServiceProvider4));
            label.SetValue(Label.LineBreakModeProperty, LineBreakMode.TailTruncation);
            label.SetValue(View.MarginProperty, new Thickness(5.0, 0.0, 0.0, 0.0));
            label.SetValue(FlexLayout.GrowProperty, 1f);
            flexLayout.Children.Add(label);
            VisualDiagnostics.RegisterSourceInfo(label, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 25, 10);
            imageButton.SetValue(VisualElement.HeightRequestProperty, 20.0);
            imageButton.SetValue(View.MarginProperty, new Thickness(20.0, 0.0));
            imageButton.SetValue(ImageButton.AspectProperty, Aspect.AspectFit);
            imageButton.SetValue(ImageButton.SourceProperty, new ImageSourceConverter().ConvertFromInvariantString("close.png"));
            imageButton.SetValue(VisualElement.BackgroundColorProperty, Color.White);
            bindingExtension7.Path = "ClosePopupTapCommand";
            BindingBase binding7 = ((IMarkupExtension <BindingBase>)bindingExtension7).ProvideValue((IServiceProvider)null);

            imageButton.SetBinding(ImageButton.CommandProperty, binding7);
            flexLayout.Children.Add(imageButton);
            VisualDiagnostics.RegisterSourceInfo(imageButton, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 33, 10);
            popupPage.Children.Add(flexLayout);
            VisualDiagnostics.RegisterSourceInfo(flexLayout, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 9, 6);
            flexLayout2.SetValue(FlexLayout.DirectionProperty, new FlexDirectionTypeConverter().ConvertFromInvariantString("Column"));
            flexLayout2.SetValue(FlexLayout.AlignItemsProperty, new FlexAlignItemsTypeConverter().ConvertFromInvariantString("Start"));
            flexLayout2.SetValue(FlexLayout.JustifyContentProperty, new FlexJustifyTypeConverter().ConvertFromInvariantString("Start"));
            flexLayout2.SetValue(FlexLayout.GrowProperty, 1f);
            label2.SetValue(Label.TextProperty, "Prochain arrêt : ");
            staticResourceExtension4.Key = "DarkGrayColor";
            XamlServiceProvider xamlServiceProvider5 = new XamlServiceProvider();
            Type typeFromHandle9 = typeof(IProvideValueTarget);

            object[] array5 = new object[0 + 3];
            array5[0] = label2;
            array5[1] = flexLayout2;
            array5[2] = popupPage;
            object service5;

            xamlServiceProvider5.Add(typeFromHandle9, service5 = new SimpleValueTargetProvider(array5, Label.TextColorProperty, nameScope));
            xamlServiceProvider5.Add(typeof(IReferenceProvider), service5);
            Type typeFromHandle10 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver5 = new XmlNamespaceResolver();

            xmlNamespaceResolver5.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver5.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xamlServiceProvider5.Add(typeFromHandle10, new XamlTypeResolver(xmlNamespaceResolver5, typeof(PopupPage).GetTypeInfo().Assembly));
            xamlServiceProvider5.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(45, 16)));
            object obj3 = ((IMarkupExtension)staticResourceExtension4).ProvideValue((IServiceProvider)xamlServiceProvider5);

            label2.TextColor = (Color)obj3;
            VisualDiagnostics.RegisterSourceInfo(obj3, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 45, 16);
            staticResourceExtension5.Key = "TCLLight";
            XamlServiceProvider xamlServiceProvider6 = new XamlServiceProvider();
            Type typeFromHandle11 = typeof(IProvideValueTarget);

            object[] array6 = new object[0 + 3];
            array6[0] = label2;
            array6[1] = flexLayout2;
            array6[2] = popupPage;
            object service6;

            xamlServiceProvider6.Add(typeFromHandle11, service6 = new SimpleValueTargetProvider(array6, Label.FontFamilyProperty, nameScope));
            xamlServiceProvider6.Add(typeof(IReferenceProvider), service6);
            Type typeFromHandle12 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver6 = new XmlNamespaceResolver();

            xmlNamespaceResolver6.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver6.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xamlServiceProvider6.Add(typeFromHandle12, new XamlTypeResolver(xmlNamespaceResolver6, typeof(PopupPage).GetTypeInfo().Assembly));
            xamlServiceProvider6.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(46, 16)));
            object target2 = label2.FontFamily = (string)((IMarkupExtension)staticResourceExtension5).ProvideValue((IServiceProvider)xamlServiceProvider6);

            VisualDiagnostics.RegisterSourceInfo(target2, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 46, 16);
            BindableProperty    fontSizeProperty2    = Label.FontSizeProperty;
            FontSizeConverter   fontSizeConverter2   = new FontSizeConverter();
            XamlServiceProvider xamlServiceProvider7 = new XamlServiceProvider();
            Type typeFromHandle13 = typeof(IProvideValueTarget);

            object[] array7 = new object[0 + 3];
            array7[0] = label2;
            array7[1] = flexLayout2;
            array7[2] = popupPage;
            object service7;

            xamlServiceProvider7.Add(typeFromHandle13, service7 = new SimpleValueTargetProvider(array7, Label.FontSizeProperty, nameScope));
            xamlServiceProvider7.Add(typeof(IReferenceProvider), service7);
            Type typeFromHandle14 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver7 = new XmlNamespaceResolver();

            xmlNamespaceResolver7.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver7.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xamlServiceProvider7.Add(typeFromHandle14, new XamlTypeResolver(xmlNamespaceResolver7, typeof(PopupPage).GetTypeInfo().Assembly));
            xamlServiceProvider7.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(47, 16)));
            label2.SetValue(fontSizeProperty2, ((IExtendedTypeConverter)fontSizeConverter2).ConvertFromInvariantString("Small", (IServiceProvider)xamlServiceProvider7));
            label2.SetValue(View.MarginProperty, new Thickness(20.0, 20.0, 0.0, 0.0));
            flexLayout2.Children.Add(label2);
            VisualDiagnostics.RegisterSourceInfo(label2, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 44, 10);
            bindingExtension8.Path = "SelectedVehicule";
            BindingBase binding8 = ((IMarkupExtension <BindingBase>)bindingExtension8).ProvideValue((IServiceProvider)null);

            label3.SetBinding(BindableObject.BindingContextProperty, binding8);
            bindingExtension9.Path = "ProchainArret";
            BindingBase binding9 = ((IMarkupExtension <BindingBase>)bindingExtension9).ProvideValue((IServiceProvider)null);

            label3.SetBinding(Label.TextProperty, binding9);
            staticResourceExtension6.Key = "DarkGrayColor";
            XamlServiceProvider xamlServiceProvider8 = new XamlServiceProvider();
            Type typeFromHandle15 = typeof(IProvideValueTarget);

            object[] array8 = new object[0 + 3];
            array8[0] = label3;
            array8[1] = flexLayout2;
            array8[2] = popupPage;
            object service8;

            xamlServiceProvider8.Add(typeFromHandle15, service8 = new SimpleValueTargetProvider(array8, Label.TextColorProperty, nameScope));
            xamlServiceProvider8.Add(typeof(IReferenceProvider), service8);
            Type typeFromHandle16 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver8 = new XmlNamespaceResolver();

            xmlNamespaceResolver8.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver8.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xamlServiceProvider8.Add(typeFromHandle16, new XamlTypeResolver(xmlNamespaceResolver8, typeof(PopupPage).GetTypeInfo().Assembly));
            xamlServiceProvider8.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(51, 16)));
            object obj4 = ((IMarkupExtension)staticResourceExtension6).ProvideValue((IServiceProvider)xamlServiceProvider8);

            label3.TextColor = (Color)obj4;
            VisualDiagnostics.RegisterSourceInfo(obj4, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 51, 16);
            staticResourceExtension7.Key = "TCLRegular";
            XamlServiceProvider xamlServiceProvider9 = new XamlServiceProvider();
            Type typeFromHandle17 = typeof(IProvideValueTarget);

            object[] array9 = new object[0 + 3];
            array9[0] = label3;
            array9[1] = flexLayout2;
            array9[2] = popupPage;
            object service9;

            xamlServiceProvider9.Add(typeFromHandle17, service9 = new SimpleValueTargetProvider(array9, Label.FontFamilyProperty, nameScope));
            xamlServiceProvider9.Add(typeof(IReferenceProvider), service9);
            Type typeFromHandle18 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver9 = new XmlNamespaceResolver();

            xmlNamespaceResolver9.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver9.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xamlServiceProvider9.Add(typeFromHandle18, new XamlTypeResolver(xmlNamespaceResolver9, typeof(PopupPage).GetTypeInfo().Assembly));
            xamlServiceProvider9.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(52, 16)));
            object target3 = label3.FontFamily = (string)((IMarkupExtension)staticResourceExtension7).ProvideValue((IServiceProvider)xamlServiceProvider9);

            VisualDiagnostics.RegisterSourceInfo(target3, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 52, 16);
            BindableProperty    fontSizeProperty3     = Label.FontSizeProperty;
            FontSizeConverter   fontSizeConverter3    = new FontSizeConverter();
            XamlServiceProvider xamlServiceProvider10 = new XamlServiceProvider();
            Type typeFromHandle19 = typeof(IProvideValueTarget);

            object[] array10 = new object[0 + 3];
            array10[0] = label3;
            array10[1] = flexLayout2;
            array10[2] = popupPage;
            object service10;

            xamlServiceProvider10.Add(typeFromHandle19, service10 = new SimpleValueTargetProvider(array10, Label.FontSizeProperty, nameScope));
            xamlServiceProvider10.Add(typeof(IReferenceProvider), service10);
            Type typeFromHandle20 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver10 = new XmlNamespaceResolver();

            xmlNamespaceResolver10.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver10.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xamlServiceProvider10.Add(typeFromHandle20, new XamlTypeResolver(xmlNamespaceResolver10, typeof(PopupPage).GetTypeInfo().Assembly));
            xamlServiceProvider10.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(53, 16)));
            label3.SetValue(fontSizeProperty3, ((IExtendedTypeConverter)fontSizeConverter3).ConvertFromInvariantString("Medium", (IServiceProvider)xamlServiceProvider10));
            label3.SetValue(View.MarginProperty, new Thickness(20.0, 0.0, 0.0, 0.0));
            label3.SetValue(Label.LineBreakModeProperty, LineBreakMode.TailTruncation);
            flexLayout2.Children.Add(label3);
            VisualDiagnostics.RegisterSourceInfo(label3, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 49, 10);
            popupPage.Children.Add(flexLayout2);
            VisualDiagnostics.RegisterSourceInfo(flexLayout2, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 40, 6);
            VisualDiagnostics.RegisterSourceInfo(popupPage, new Uri("Views\\PopupPage.xaml", UriKind.RelativeOrAbsolute), 2, 2);
        }
        private void InitializeComponent()
        {
            if (ResourceLoader.CanProvideContentFor(new ResourceLoader.ResourceLoadingQuery
            {
                AssemblyName = typeof(TutorialPage).GetTypeInfo().Assembly.GetName(),
                ResourcePath = "Views/TutorialPage.xaml",
                Instance = this
            }))
            {
                __InitComponentRuntime();
                return;
            }
            if (XamlLoader.XamlFileProvider != null && XamlLoader.XamlFileProvider(GetType()) != null)
            {
                __InitComponentRuntime();
                return;
            }
            IndexConverter          value                    = new IndexConverter();
            NegateBooleanConverter  value2                   = new NegateBooleanConverter();
            ResourceDictionary      resourceDictionary       = new ResourceDictionary();
            RowDefinition           rowDefinition            = new RowDefinition();
            RowDefinition           rowDefinition2           = new RowDefinition();
            RowDefinition           rowDefinition3           = new RowDefinition();
            StaticResourceExtension staticResourceExtension  = new StaticResourceExtension();
            StaticResourceExtension staticResourceExtension2 = new StaticResourceExtension();
            Label label = new Label();
            StaticResourceExtension staticResourceExtension3 = new StaticResourceExtension();
            StaticResourceExtension staticResourceExtension4 = new StaticResourceExtension();
            Type           typeFromHandle = typeof(ContentView);
            Image          image          = new Image();
            ContentView    contentView    = new ContentView();
            Image          image2         = new Image();
            ContentView    contentView2   = new ContentView();
            Image          image3         = new Image();
            ContentView    contentView3   = new ContentView();
            Image          image4         = new Image();
            ContentView    contentView4   = new ContentView();
            ArrayExtension arrayExtension;

            (arrayExtension = new ArrayExtension()).Type = typeFromHandle;
            VisualDiagnostics.RegisterSourceInfo(typeFromHandle, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 35, 26);
            contentView.SetValue(View.MarginProperty, new Thickness(30.0, 0.0));
            contentView.SetValue(View.VerticalOptionsProperty, LayoutOptions.StartAndExpand);
            image.SetValue(Image.AspectProperty, Aspect.AspectFit);
            image.SetValue(Image.SourceProperty, new ImageSourceConverter().ConvertFromInvariantString("tuto_prochainarret.png"));
            contentView.SetValue(ContentView.ContentProperty, image);
            VisualDiagnostics.RegisterSourceInfo(image, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 38, 26);
            arrayExtension.Items.Add(contentView);
            VisualDiagnostics.RegisterSourceInfo(contentView, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 36, 22);
            contentView2.SetValue(View.MarginProperty, new Thickness(30.0, 0.0));
            contentView2.SetValue(View.VerticalOptionsProperty, LayoutOptions.StartAndExpand);
            image2.SetValue(Image.AspectProperty, Aspect.AspectFit);
            image2.SetValue(Image.SourceProperty, new ImageSourceConverter().ConvertFromInvariantString("tuto_filtre.png"));
            contentView2.SetValue(ContentView.ContentProperty, image2);
            VisualDiagnostics.RegisterSourceInfo(image2, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 44, 26);
            arrayExtension.Items.Add(contentView2);
            VisualDiagnostics.RegisterSourceInfo(contentView2, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 42, 22);
            contentView3.SetValue(View.MarginProperty, new Thickness(30.0, 0.0));
            contentView3.SetValue(View.VerticalOptionsProperty, LayoutOptions.StartAndExpand);
            image3.SetValue(Image.AspectProperty, Aspect.AspectFit);
            image3.SetValue(Image.SourceProperty, new ImageSourceConverter().ConvertFromInvariantString("tuto_favoris.png"));
            contentView3.SetValue(ContentView.ContentProperty, image3);
            VisualDiagnostics.RegisterSourceInfo(image3, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 50, 26);
            arrayExtension.Items.Add(contentView3);
            VisualDiagnostics.RegisterSourceInfo(contentView3, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 48, 22);
            contentView4.SetValue(View.MarginProperty, new Thickness(30.0, 0.0));
            contentView4.SetValue(View.VerticalOptionsProperty, LayoutOptions.StartAndExpand);
            image4.SetValue(Image.AspectProperty, Aspect.AspectFit);
            image4.SetValue(Image.SourceProperty, new ImageSourceConverter().ConvertFromInvariantString("tuto_directions.png"));
            contentView4.SetValue(ContentView.ContentProperty, image4);
            VisualDiagnostics.RegisterSourceInfo(image4, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 56, 26);
            arrayExtension.Items.Add(contentView4);
            VisualDiagnostics.RegisterSourceInfo(contentView4, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 54, 22);
            ContentView[] array = new ContentView[4]
            {
                contentView,
                contentView2,
                contentView3,
                contentView4
            };
            RadSlideView            radSlideView             = new RadSlideView();
            StaticResourceExtension staticResourceExtension5 = new StaticResourceExtension();
            StaticResourceExtension staticResourceExtension6 = new StaticResourceExtension();
            StaticResourceExtension staticResourceExtension7 = new StaticResourceExtension();
            ReferenceExtension      referenceExtension       = new ReferenceExtension();
            BindingExtension        bindingExtension         = new BindingExtension();
            BindingExtension        bindingExtension2        = new BindingExtension();
            Setter setter  = new Setter();
            Setter setter2 = new Setter();
            StaticResourceExtension staticResourceExtension8 = new StaticResourceExtension();
            Setter       setter3     = new Setter();
            DataTrigger  dataTrigger = new DataTrigger(typeof(RadButton));
            RadButton    radButton   = new RadButton();
            Grid         grid        = new Grid();
            TutorialPage tutorialPage;
            NameScope    nameScope = (NameScope)(NameScope.GetNameScope(tutorialPage = this) ?? new NameScope());

            NameScope.SetNameScope(tutorialPage, nameScope);
            ((INameScope)nameScope).RegisterName("This", (object)tutorialPage);
            if (tutorialPage.StyleId == null)
            {
                tutorialPage.StyleId = "This";
            }
            ((INameScope)nameScope).RegisterName("slideView", (object)radSlideView);
            if (radSlideView.StyleId == null)
            {
                radSlideView.StyleId = "slideView";
            }
            This      = tutorialPage;
            slideView = radSlideView;
            tutorialPage.Resources = resourceDictionary;
            VisualDiagnostics.RegisterSourceInfo(resourceDictionary, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 10, 10);
            resourceDictionary.Add("indexConverter", value);
            resourceDictionary.Add("inverter", value2);
            tutorialPage.Resources = resourceDictionary;
            VisualDiagnostics.RegisterSourceInfo(resourceDictionary, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 10, 10);
            rowDefinition.SetValue(RowDefinition.HeightProperty, new GridLengthTypeConverter().ConvertFromInvariantString("50"));
            ((DefinitionCollection <RowDefinition>)grid.GetValue(Grid.RowDefinitionsProperty)).Add(rowDefinition);
            rowDefinition2.SetValue(RowDefinition.HeightProperty, new GridLengthTypeConverter().ConvertFromInvariantString("*"));
            ((DefinitionCollection <RowDefinition>)grid.GetValue(Grid.RowDefinitionsProperty)).Add(rowDefinition2);
            rowDefinition3.SetValue(RowDefinition.HeightProperty, new GridLengthTypeConverter().ConvertFromInvariantString("70"));
            ((DefinitionCollection <RowDefinition>)grid.GetValue(Grid.RowDefinitionsProperty)).Add(rowDefinition3);
            label.SetValue(Label.TextProperty, "TUTORIEL");
            staticResourceExtension.Key = "DarkGrayColor";
            XamlServiceProvider xamlServiceProvider = new XamlServiceProvider();
            Type typeFromHandle2 = typeof(IProvideValueTarget);

            object[] array2 = new object[0 + 3];
            array2[0] = label;
            array2[1] = grid;
            array2[2] = tutorialPage;
            object service;

            xamlServiceProvider.Add(typeFromHandle2, service = new SimpleValueTargetProvider(array2, Label.TextColorProperty, nameScope));
            xamlServiceProvider.Add(typeof(IReferenceProvider), service);
            Type typeFromHandle3 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver = new XmlNamespaceResolver();

            xmlNamespaceResolver.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver.Add("mvvm", "clr-namespace:AntilopeGP.Shared.MVVM");
            xmlNamespaceResolver.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xmlNamespaceResolver.Add("telerikInput", "clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input");
            xamlServiceProvider.Add(typeFromHandle3, new XamlTypeResolver(xmlNamespaceResolver, typeof(TutorialPage).GetTypeInfo().Assembly));
            xamlServiceProvider.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(22, 16)));
            object obj = ((IMarkupExtension)staticResourceExtension).ProvideValue((IServiceProvider)xamlServiceProvider);

            label.TextColor = (Color)obj;
            VisualDiagnostics.RegisterSourceInfo(obj, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 22, 16);
            staticResourceExtension2.Key = "TCLBold";
            XamlServiceProvider xamlServiceProvider2 = new XamlServiceProvider();
            Type typeFromHandle4 = typeof(IProvideValueTarget);

            object[] array3 = new object[0 + 3];
            array3[0] = label;
            array3[1] = grid;
            array3[2] = tutorialPage;
            object service2;

            xamlServiceProvider2.Add(typeFromHandle4, service2 = new SimpleValueTargetProvider(array3, Label.FontFamilyProperty, nameScope));
            xamlServiceProvider2.Add(typeof(IReferenceProvider), service2);
            Type typeFromHandle5 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver2 = new XmlNamespaceResolver();

            xmlNamespaceResolver2.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver2.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver2.Add("mvvm", "clr-namespace:AntilopeGP.Shared.MVVM");
            xmlNamespaceResolver2.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xmlNamespaceResolver2.Add("telerikInput", "clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input");
            xamlServiceProvider2.Add(typeFromHandle5, new XamlTypeResolver(xmlNamespaceResolver2, typeof(TutorialPage).GetTypeInfo().Assembly));
            xamlServiceProvider2.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(23, 16)));
            object target = label.FontFamily = (string)((IMarkupExtension)staticResourceExtension2).ProvideValue((IServiceProvider)xamlServiceProvider2);

            VisualDiagnostics.RegisterSourceInfo(target, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 23, 16);
            BindableProperty    fontSizeProperty     = Label.FontSizeProperty;
            FontSizeConverter   fontSizeConverter    = new FontSizeConverter();
            XamlServiceProvider xamlServiceProvider3 = new XamlServiceProvider();
            Type typeFromHandle6 = typeof(IProvideValueTarget);

            object[] array4 = new object[0 + 3];
            array4[0] = label;
            array4[1] = grid;
            array4[2] = tutorialPage;
            object service3;

            xamlServiceProvider3.Add(typeFromHandle6, service3 = new SimpleValueTargetProvider(array4, Label.FontSizeProperty, nameScope));
            xamlServiceProvider3.Add(typeof(IReferenceProvider), service3);
            Type typeFromHandle7 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver3 = new XmlNamespaceResolver();

            xmlNamespaceResolver3.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver3.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver3.Add("mvvm", "clr-namespace:AntilopeGP.Shared.MVVM");
            xmlNamespaceResolver3.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xmlNamespaceResolver3.Add("telerikInput", "clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input");
            xamlServiceProvider3.Add(typeFromHandle7, new XamlTypeResolver(xmlNamespaceResolver3, typeof(TutorialPage).GetTypeInfo().Assembly));
            xamlServiceProvider3.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(24, 16)));
            label.SetValue(fontSizeProperty, ((IExtendedTypeConverter)fontSizeConverter).ConvertFromInvariantString("Large", (IServiceProvider)xamlServiceProvider3));
            label.SetValue(Label.HorizontalTextAlignmentProperty, new TextAlignmentConverter().ConvertFromInvariantString("Center"));
            label.SetValue(Label.VerticalTextAlignmentProperty, new TextAlignmentConverter().ConvertFromInvariantString("Center"));
            grid.Children.Add(label);
            VisualDiagnostics.RegisterSourceInfo(label, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 21, 10);
            radSlideView.SetValue(Grid.RowProperty, 1);
            radSlideView.SetValue(View.MarginProperty, new Thickness(10.0, 0.0));
            radSlideView.SetValue(RadSlideView.HorizontalContentOptionsProperty, LayoutOptions.CenterAndExpand);
            radSlideView.SetValue(RadSlideView.VerticalContentOptionsProperty, LayoutOptions.StartAndExpand);
            staticResourceExtension3.Key = "DarkGrayColor";
            XamlServiceProvider xamlServiceProvider4 = new XamlServiceProvider();
            Type typeFromHandle8 = typeof(IProvideValueTarget);

            object[] array5 = new object[0 + 3];
            array5[0] = radSlideView;
            array5[1] = grid;
            array5[2] = tutorialPage;
            object service4;

            xamlServiceProvider4.Add(typeFromHandle8, service4 = new SimpleValueTargetProvider(array5, RadSlideView.IndicatorColorProperty, nameScope));
            xamlServiceProvider4.Add(typeof(IReferenceProvider), service4);
            Type typeFromHandle9 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver4 = new XmlNamespaceResolver();

            xmlNamespaceResolver4.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver4.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver4.Add("mvvm", "clr-namespace:AntilopeGP.Shared.MVVM");
            xmlNamespaceResolver4.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xmlNamespaceResolver4.Add("telerikInput", "clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input");
            xamlServiceProvider4.Add(typeFromHandle9, new XamlTypeResolver(xmlNamespaceResolver4, typeof(TutorialPage).GetTypeInfo().Assembly));
            xamlServiceProvider4.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(32, 41)));
            object obj2 = ((IMarkupExtension)staticResourceExtension3).ProvideValue((IServiceProvider)xamlServiceProvider4);

            radSlideView.IndicatorColor = (Color)obj2;
            VisualDiagnostics.RegisterSourceInfo(obj2, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 32, 41);
            staticResourceExtension4.Key = "TCLRed";
            XamlServiceProvider xamlServiceProvider5 = new XamlServiceProvider();
            Type typeFromHandle10 = typeof(IProvideValueTarget);

            object[] array6 = new object[0 + 3];
            array6[0] = radSlideView;
            array6[1] = grid;
            array6[2] = tutorialPage;
            object service5;

            xamlServiceProvider5.Add(typeFromHandle10, service5 = new SimpleValueTargetProvider(array6, RadSlideView.SelectedIndicatorColorProperty, nameScope));
            xamlServiceProvider5.Add(typeof(IReferenceProvider), service5);
            Type typeFromHandle11 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver5 = new XmlNamespaceResolver();

            xmlNamespaceResolver5.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver5.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver5.Add("mvvm", "clr-namespace:AntilopeGP.Shared.MVVM");
            xmlNamespaceResolver5.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xmlNamespaceResolver5.Add("telerikInput", "clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input");
            xamlServiceProvider5.Add(typeFromHandle11, new XamlTypeResolver(xmlNamespaceResolver5, typeof(TutorialPage).GetTypeInfo().Assembly));
            xamlServiceProvider5.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(33, 41)));
            object obj3 = ((IMarkupExtension)staticResourceExtension4).ProvideValue((IServiceProvider)xamlServiceProvider5);

            radSlideView.SelectedIndicatorColor = (Color)obj3;
            VisualDiagnostics.RegisterSourceInfo(obj3, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 33, 41);
            radSlideView.SetValue(RadSlideView.ItemsSourceProperty, array);
            VisualDiagnostics.RegisterSourceInfo(array, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 35, 18);
            grid.Children.Add(radSlideView);
            VisualDiagnostics.RegisterSourceInfo(radSlideView, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 27, 10);
            radButton.SetValue(Grid.RowProperty, 2);
            radButton.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
            radButton.SetValue(View.HorizontalOptionsProperty, LayoutOptions.Center);
            radButton.SetValue(VisualElement.HeightRequestProperty, 50.0);
            radButton.SetValue(Button.PaddingProperty, new Thickness(15.0, 0.0));
            radButton.SetValue(Button.BorderRadiusProperty, 25);
            radButton.SetValue(Button.TextProperty, "J'ai compris, fermer le tutoriel");
            staticResourceExtension5.Key = "MediumGrayColor";
            XamlServiceProvider xamlServiceProvider6 = new XamlServiceProvider();
            Type typeFromHandle12 = typeof(IProvideValueTarget);

            object[] array7 = new object[0 + 3];
            array7[0] = radButton;
            array7[1] = grid;
            array7[2] = tutorialPage;
            object service6;

            xamlServiceProvider6.Add(typeFromHandle12, service6 = new SimpleValueTargetProvider(array7, Button.TextColorProperty, nameScope));
            xamlServiceProvider6.Add(typeof(IReferenceProvider), service6);
            Type typeFromHandle13 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver6 = new XmlNamespaceResolver();

            xmlNamespaceResolver6.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver6.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver6.Add("mvvm", "clr-namespace:AntilopeGP.Shared.MVVM");
            xmlNamespaceResolver6.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xmlNamespaceResolver6.Add("telerikInput", "clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input");
            xamlServiceProvider6.Add(typeFromHandle13, new XamlTypeResolver(xmlNamespaceResolver6, typeof(TutorialPage).GetTypeInfo().Assembly));
            xamlServiceProvider6.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(70, 33)));
            object obj4 = ((IMarkupExtension)staticResourceExtension5).ProvideValue((IServiceProvider)xamlServiceProvider6);

            radButton.TextColor = (Color)obj4;
            VisualDiagnostics.RegisterSourceInfo(obj4, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 70, 33);
            staticResourceExtension6.Key = "TCLRegular";
            XamlServiceProvider xamlServiceProvider7 = new XamlServiceProvider();
            Type typeFromHandle14 = typeof(IProvideValueTarget);

            object[] array8 = new object[0 + 3];
            array8[0] = radButton;
            array8[1] = grid;
            array8[2] = tutorialPage;
            object service7;

            xamlServiceProvider7.Add(typeFromHandle14, service7 = new SimpleValueTargetProvider(array8, Button.FontFamilyProperty, nameScope));
            xamlServiceProvider7.Add(typeof(IReferenceProvider), service7);
            Type typeFromHandle15 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver7 = new XmlNamespaceResolver();

            xmlNamespaceResolver7.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver7.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver7.Add("mvvm", "clr-namespace:AntilopeGP.Shared.MVVM");
            xmlNamespaceResolver7.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xmlNamespaceResolver7.Add("telerikInput", "clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input");
            xamlServiceProvider7.Add(typeFromHandle15, new XamlTypeResolver(xmlNamespaceResolver7, typeof(TutorialPage).GetTypeInfo().Assembly));
            xamlServiceProvider7.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(71, 33)));
            object target2 = radButton.FontFamily = (string)((IMarkupExtension)staticResourceExtension6).ProvideValue((IServiceProvider)xamlServiceProvider7);

            VisualDiagnostics.RegisterSourceInfo(target2, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 71, 33);
            BindableProperty    fontSizeProperty2    = Button.FontSizeProperty;
            FontSizeConverter   fontSizeConverter2   = new FontSizeConverter();
            XamlServiceProvider xamlServiceProvider8 = new XamlServiceProvider();
            Type typeFromHandle16 = typeof(IProvideValueTarget);

            object[] array9 = new object[0 + 3];
            array9[0] = radButton;
            array9[1] = grid;
            array9[2] = tutorialPage;
            object service8;

            xamlServiceProvider8.Add(typeFromHandle16, service8 = new SimpleValueTargetProvider(array9, Button.FontSizeProperty, nameScope));
            xamlServiceProvider8.Add(typeof(IReferenceProvider), service8);
            Type typeFromHandle17 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver8 = new XmlNamespaceResolver();

            xmlNamespaceResolver8.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver8.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver8.Add("mvvm", "clr-namespace:AntilopeGP.Shared.MVVM");
            xmlNamespaceResolver8.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xmlNamespaceResolver8.Add("telerikInput", "clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input");
            xamlServiceProvider8.Add(typeFromHandle17, new XamlTypeResolver(xmlNamespaceResolver8, typeof(TutorialPage).GetTypeInfo().Assembly));
            xamlServiceProvider8.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(72, 33)));
            radButton.SetValue(fontSizeProperty2, ((IExtendedTypeConverter)fontSizeConverter2).ConvertFromInvariantString("Medium", (IServiceProvider)xamlServiceProvider8));
            staticResourceExtension7.Key = "LightGrayColor";
            XamlServiceProvider xamlServiceProvider9 = new XamlServiceProvider();
            Type typeFromHandle18 = typeof(IProvideValueTarget);

            object[] array10 = new object[0 + 3];
            array10[0] = radButton;
            array10[1] = grid;
            array10[2] = tutorialPage;
            object service9;

            xamlServiceProvider9.Add(typeFromHandle18, service9 = new SimpleValueTargetProvider(array10, VisualElement.BackgroundColorProperty, nameScope));
            xamlServiceProvider9.Add(typeof(IReferenceProvider), service9);
            Type typeFromHandle19 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver9 = new XmlNamespaceResolver();

            xmlNamespaceResolver9.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver9.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver9.Add("mvvm", "clr-namespace:AntilopeGP.Shared.MVVM");
            xmlNamespaceResolver9.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xmlNamespaceResolver9.Add("telerikInput", "clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input");
            xamlServiceProvider9.Add(typeFromHandle19, new XamlTypeResolver(xmlNamespaceResolver9, typeof(TutorialPage).GetTypeInfo().Assembly));
            xamlServiceProvider9.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(73, 33)));
            object obj5 = ((IMarkupExtension)staticResourceExtension7).ProvideValue((IServiceProvider)xamlServiceProvider9);

            radButton.BackgroundColor = (Color)obj5;
            VisualDiagnostics.RegisterSourceInfo(obj5, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 73, 33);
            referenceExtension.Name = "slideView";
            XamlServiceProvider xamlServiceProvider10 = new XamlServiceProvider();
            Type typeFromHandle20 = typeof(IProvideValueTarget);

            object[] array11 = new object[0 + 5];
            array11[0] = bindingExtension;
            array11[1] = dataTrigger;
            array11[2] = radButton;
            array11[3] = grid;
            array11[4] = tutorialPage;
            object service10;

            xamlServiceProvider10.Add(typeFromHandle20, service10 = new SimpleValueTargetProvider(array11, typeof(BindingExtension).GetRuntimeProperty("Source"), nameScope));
            xamlServiceProvider10.Add(typeof(IReferenceProvider), service10);
            Type typeFromHandle21 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver10 = new XmlNamespaceResolver();

            xmlNamespaceResolver10.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver10.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver10.Add("mvvm", "clr-namespace:AntilopeGP.Shared.MVVM");
            xmlNamespaceResolver10.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xmlNamespaceResolver10.Add("telerikInput", "clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input");
            xamlServiceProvider10.Add(typeFromHandle21, new XamlTypeResolver(xmlNamespaceResolver10, typeof(TutorialPage).GetTypeInfo().Assembly));
            xamlServiceProvider10.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(76, 30)));
            object target3 = bindingExtension.Source = ((IMarkupExtension)referenceExtension).ProvideValue((IServiceProvider)xamlServiceProvider10);

            VisualDiagnostics.RegisterSourceInfo(target3, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 76, 30);
            bindingExtension.Path = "SelectedIndex";
            BindingBase target4 = dataTrigger.Binding = ((IMarkupExtension <BindingBase>)bindingExtension).ProvideValue((IServiceProvider)null);

            VisualDiagnostics.RegisterSourceInfo(target4, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 76, 30);
            dataTrigger.Value      = "3";
            setter.Property        = Button.CommandProperty;
            bindingExtension2.Path = "AcceptTapCommand";
            BindingBase target5 = (BindingBase)(setter.Value = ((IMarkupExtension <BindingBase>)bindingExtension2).ProvideValue((IServiceProvider)null));

            VisualDiagnostics.RegisterSourceInfo(target5, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 79, 29);
            dataTrigger.Setters.Add(setter);
            VisualDiagnostics.RegisterSourceInfo(setter, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 78, 22);
            setter2.Property = Button.TextColorProperty;
            setter2.Value    = "White";
            setter2.Value    = Color.White;
            dataTrigger.Setters.Add(setter2);
            VisualDiagnostics.RegisterSourceInfo(setter2, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 80, 22);
            setter3.Property             = VisualElement.BackgroundColorProperty;
            staticResourceExtension8.Key = "TCLRed";
            XamlServiceProvider xamlServiceProvider11 = new XamlServiceProvider();
            Type typeFromHandle22 = typeof(IProvideValueTarget);

            object[] array12 = new object[0 + 5];
            array12[0] = setter3;
            array12[1] = dataTrigger;
            array12[2] = radButton;
            array12[3] = grid;
            array12[4] = tutorialPage;
            object service11;

            xamlServiceProvider11.Add(typeFromHandle22, service11 = new SimpleValueTargetProvider(array12, typeof(Setter).GetRuntimeProperty("Value"), nameScope));
            xamlServiceProvider11.Add(typeof(IReferenceProvider), service11);
            Type typeFromHandle23 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver11 = new XmlNamespaceResolver();

            xmlNamespaceResolver11.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver11.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver11.Add("mvvm", "clr-namespace:AntilopeGP.Shared.MVVM");
            xmlNamespaceResolver11.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xmlNamespaceResolver11.Add("telerikInput", "clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input");
            xamlServiceProvider11.Add(typeFromHandle23, new XamlTypeResolver(xmlNamespaceResolver11, typeof(TutorialPage).GetTypeInfo().Assembly));
            xamlServiceProvider11.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(83, 29)));
            object target6 = setter3.Value = ((IMarkupExtension)staticResourceExtension8).ProvideValue((IServiceProvider)xamlServiceProvider11);

            VisualDiagnostics.RegisterSourceInfo(target6, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 83, 29);
            dataTrigger.Setters.Add(setter3);
            VisualDiagnostics.RegisterSourceInfo(setter3, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 82, 22);
            ((ICollection <TriggerBase>)radButton.GetValue(VisualElement.TriggersProperty)).Add((TriggerBase)dataTrigger);
            VisualDiagnostics.RegisterSourceInfo(dataTrigger, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 75, 18);
            grid.Children.Add(radButton);
            VisualDiagnostics.RegisterSourceInfo(radButton, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 63, 10);
            tutorialPage.SetValue(ContentPage.ContentProperty, grid);
            VisualDiagnostics.RegisterSourceInfo(grid, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 15, 6);
            VisualDiagnostics.RegisterSourceInfo(tutorialPage, new Uri("Views\\TutorialPage.xaml", UriKind.RelativeOrAbsolute), 2, 2);
        }
示例#24
0
        public void Visit(ElementNode node, INode parentNode)
        {
            object value = null;

            var type = XamlParser.GetElementType(node.XmlType, node, Context.RootElement?.GetType().Assembly,
                                                 out XamlParseException xpe);

            if (xpe != null)
            {
                if (Context.ExceptionHandler != null)
                {
                    Context.ExceptionHandler(xpe);
                    return;
                }
                throw xpe;
            }
            Context.Types[node] = type;
            if (IsXaml2009LanguagePrimitive(node))
            {
                value = CreateLanguagePrimitive(type, node);
            }
            else if (node.Properties.ContainsKey(XmlName.xArguments) || node.Properties.ContainsKey(XmlName.xFactoryMethod))
            {
                value = CreateFromFactory(type, node);
            }
            else if (
                type.GetTypeInfo()
                .DeclaredConstructors.Any(
                    ci =>
                    ci.IsPublic && ci.GetParameters().Length != 0 &&
                    ci.GetParameters().All(pi => pi.CustomAttributes.Any(attr => attr.AttributeType == typeof(ParameterAttribute)))) &&
                ValidateCtorArguments(type, node, out string ctorargname))
            {
                value = CreateFromParameterizedConstructor(type, node);
            }
            else if (!type.GetTypeInfo().DeclaredConstructors.Any(ci => ci.IsPublic && ci.GetParameters().Length == 0) &&
                     !ValidateCtorArguments(type, node, out ctorargname))
            {
                throw new XamlParseException($"The Property {ctorargname} is required to create a {type.FullName} object.", node);
            }
            else
            {
                //this is a trick as the DataTemplate parameterless ctor is internal, and we can't CreateInstance(..., false) on WP7
                try
                {
                    if (type == typeof(DataTemplate))
                    {
                        value = new DataTemplate();
                    }
                    if (type == typeof(ControlTemplate))
                    {
                        value = new ControlTemplate();
                    }
                    if (value == null && node.CollectionItems.Any() && node.CollectionItems.First() is ValueNode)
                    {
                        var serviceProvider = new XamlServiceProvider(node, Context);
                        var converted       = ((ValueNode)node.CollectionItems.First()).Value.ConvertTo(type, () => type,
                                                                                                        serviceProvider, out Exception exception);
                        if (exception != null)
                        {
                            if (Context.ExceptionHandler != null)
                            {
                                Context.ExceptionHandler(exception);
                                return;
                            }
                            throw exception;
                        }
                        if (converted != null && converted.GetType() == type)
                        {
                            value = converted;
                        }
                    }
                    if (value == null)
                    {
                        value = Activator.CreateInstance(type);
                    }
                }
                catch (TargetInvocationException e) when(e.InnerException is XamlParseException || e.InnerException is XmlException)
                {
                    throw e.InnerException;
                }
                catch (MissingMemberException mme)
                {
                    throw new XamlParseException(mme.Message, node, mme);
                }
            }

            Values[node] = value;

            if (value is IMarkupExtension markup && (value is TypeExtension || value is StaticExtension || value is ArrayExtension))
            {
                var serviceProvider = new XamlServiceProvider(node, Context);

                var visitor = new ApplyPropertiesVisitor(Context);
                foreach (var cnode in node.Properties.Values.ToList())
                {
                    cnode.Accept(visitor, node);
                }
                foreach (var cnode in node.CollectionItems)
                {
                    cnode.Accept(visitor, node);
                }

                try
                {
                    value = markup.ProvideValue(serviceProvider);
                }
                catch (Exception e)
                {
                    var xamlpe = e as XamlParseException ?? new XamlParseException("Markup extension failed", serviceProvider, e);
                    if (Context.ExceptionHandler != null)
                    {
                        Context.ExceptionHandler(xamlpe);
                    }
                    else
                    {
                        throw xamlpe;
                    }
                }
                if (!node.Properties.TryGetValue(XmlName.xKey, out INode xKey))
                {
                    xKey = null;
                }

                node.Properties.Clear();
                node.CollectionItems.Clear();

                if (xKey != null)
                {
                    node.Properties.Add(XmlName.xKey, xKey);
                }

                Values[node] = value;
            }

            if (value is BindableObject bindableValue && node.NameScopeRef != (parentNode as IElementNode)?.NameScopeRef)
            {
                NameScope.SetNameScope(bindableValue, node.NameScopeRef.NameScope);
            }

            var assemblyName = (Context.RootAssembly ?? Context.RootElement?.GetType().Assembly)?.GetName().Name;

            if (assemblyName != null && value != null && !value.GetType().IsValueType&& XamlFilePathAttribute.GetFilePathForObject(Context.RootElement) is string path)
            {
                VisualDiagnostics.RegisterSourceInfo(value, new Uri($"{path};assembly={assemblyName}", UriKind.Relative), ((IXmlLineInfo)node).LineNumber, ((IXmlLineInfo)node).LinePosition);
            }
        }
示例#25
0
        private void InitializeComponent()
        {
            if (ResourceLoader.CanProvideContentFor(new ResourceLoader.ResourceLoadingQuery
            {
                AssemblyName = typeof(BusyPage).GetTypeInfo().Assembly.GetName(),
                ResourcePath = "Busy/BusyPage.xaml",
                Instance = this
            }))
            {
                __InitComponentRuntime();
                return;
            }
            if (XamlLoader.XamlFileProvider != null && XamlLoader.XamlFileProvider(GetType()) != null)
            {
                __InitComponentRuntime();
                return;
            }
            ReferenceExtension referenceExtension = new ReferenceExtension();
            BindingExtension   bindingExtension   = new BindingExtension();
            Label            label            = new Label();
            RadBusyIndicator radBusyIndicator = new RadBusyIndicator();
            StackLayout      stackLayout      = new StackLayout();
            BusyPage         busyPage;
            NameScope        nameScope = (NameScope)(NameScope.GetNameScope(busyPage = this) ?? new NameScope());

            NameScope.SetNameScope(busyPage, nameScope);
            ((INameScope)nameScope).RegisterName("This", (object)busyPage);
            if (busyPage.StyleId == null)
            {
                busyPage.StyleId = "This";
            }
            This = busyPage;
            busyPage.SetValue(VisualElement.BackgroundColorProperty, new Color(0.0, 0.0, 0.0, 0.501960813999176));
            busyPage.SetValue(PopupPage.CloseWhenBackgroundIsClickedProperty, false);
            stackLayout.SetValue(View.VerticalOptionsProperty, LayoutOptions.CenterAndExpand);
            stackLayout.SetValue(View.HorizontalOptionsProperty, LayoutOptions.CenterAndExpand);
            radBusyIndicator.SetValue(View.MarginProperty, new Thickness(10.0));
            radBusyIndicator.SetValue(RadBusyIndicator.AnimationContentHeightRequestProperty, 100.0);
            radBusyIndicator.SetValue(RadBusyIndicator.AnimationContentWidthRequestProperty, 100.0);
            radBusyIndicator.SetValue(RadBusyIndicator.AnimationTypeProperty, AnimationType.Animation8);
            radBusyIndicator.SetValue(RadBusyIndicator.AnimationContentColorProperty, Color.White);
            radBusyIndicator.SetValue(RadBusyIndicator.IsBusyProperty, true);
            referenceExtension.Name = "This";
            XamlServiceProvider xamlServiceProvider = new XamlServiceProvider();
            Type typeFromHandle = typeof(IProvideValueTarget);

            object[] array = new object[0 + 5];
            array[0] = bindingExtension;
            array[1] = label;
            array[2] = radBusyIndicator;
            array[3] = stackLayout;
            array[4] = busyPage;
            object service;

            xamlServiceProvider.Add(typeFromHandle, service = new SimpleValueTargetProvider(array, typeof(BindingExtension).GetRuntimeProperty("Source"), nameScope));
            xamlServiceProvider.Add(typeof(IReferenceProvider), service);
            Type typeFromHandle2 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver = new XmlNamespaceResolver();

            xmlNamespaceResolver.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver.Add("pages", "clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup");
            xmlNamespaceResolver.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xamlServiceProvider.Add(typeFromHandle2, new XamlTypeResolver(xmlNamespaceResolver, typeof(BusyPage).GetTypeInfo().Assembly));
            xamlServiceProvider.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(24, 21)));
            object target = bindingExtension.Source = ((IMarkupExtension)referenceExtension).ProvideValue((IServiceProvider)xamlServiceProvider);

            VisualDiagnostics.RegisterSourceInfo(target, new Uri("Busy\\BusyPage.xaml", UriKind.RelativeOrAbsolute), 24, 21);
            bindingExtension.Path = "Message";
            BindingBase binding = ((IMarkupExtension <BindingBase>)bindingExtension).ProvideValue((IServiceProvider)null);

            label.SetBinding(Label.TextProperty, binding);
            label.SetValue(Label.TextColorProperty, Color.White);
            label.SetValue(Label.HorizontalTextAlignmentProperty, new TextAlignmentConverter().ConvertFromInvariantString("Center"));
            BindableProperty    fontSizeProperty     = Label.FontSizeProperty;
            FontSizeConverter   fontSizeConverter    = new FontSizeConverter();
            XamlServiceProvider xamlServiceProvider2 = new XamlServiceProvider();
            Type typeFromHandle3 = typeof(IProvideValueTarget);

            object[] array2 = new object[0 + 4];
            array2[0] = label;
            array2[1] = radBusyIndicator;
            array2[2] = stackLayout;
            array2[3] = busyPage;
            object service2;

            xamlServiceProvider2.Add(typeFromHandle3, service2 = new SimpleValueTargetProvider(array2, Label.FontSizeProperty, nameScope));
            xamlServiceProvider2.Add(typeof(IReferenceProvider), service2);
            Type typeFromHandle4 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver2 = new XmlNamespaceResolver();

            xmlNamespaceResolver2.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver2.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver2.Add("pages", "clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup");
            xmlNamespaceResolver2.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xamlServiceProvider2.Add(typeFromHandle4, new XamlTypeResolver(xmlNamespaceResolver2, typeof(BusyPage).GetTypeInfo().Assembly));
            xamlServiceProvider2.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(27, 21)));
            label.SetValue(fontSizeProperty, ((IExtendedTypeConverter)fontSizeConverter).ConvertFromInvariantString("Medium", (IServiceProvider)xamlServiceProvider2));
            radBusyIndicator.SetValue(RadBusyIndicator.BusyContentProperty, label);
            VisualDiagnostics.RegisterSourceInfo(label, new Uri("Busy\\BusyPage.xaml", UriKind.RelativeOrAbsolute), 23, 18);
            stackLayout.Children.Add(radBusyIndicator);
            VisualDiagnostics.RegisterSourceInfo(radBusyIndicator, new Uri("Busy\\BusyPage.xaml", UriKind.RelativeOrAbsolute), 14, 10);
            busyPage.SetValue(ContentPage.ContentProperty, stackLayout);
            VisualDiagnostics.RegisterSourceInfo(stackLayout, new Uri("Busy\\BusyPage.xaml", UriKind.RelativeOrAbsolute), 11, 6);
            VisualDiagnostics.RegisterSourceInfo(busyPage, new Uri("Busy\\BusyPage.xaml", UriKind.RelativeOrAbsolute), 2, 2);
        }
示例#26
0
        private void InitializeComponent()
        {
            if (ResourceLoader.CanProvideContentFor(new ResourceLoader.ResourceLoadingQuery
            {
                AssemblyName = typeof(ModalPopupPage).GetTypeInfo().Assembly.GetName(),
                ResourcePath = "Views/ModalPopupPage.xaml",
                Instance = this
            }))
            {
                __InitComponentRuntime();
                return;
            }
            if (XamlLoader.XamlFileProvider != null && XamlLoader.XamlFileProvider(GetType()) != null)
            {
                __InitComponentRuntime();
                return;
            }
            ScaleAnimation          scaleAnimation          = new ScaleAnimation();
            BindingExtension        bindingExtension        = new BindingExtension();
            TapGestureRecognizer    tapGestureRecognizer    = new TapGestureRecognizer();
            BindingExtension        bindingExtension2       = new BindingExtension();
            StaticResourceExtension staticResourceExtension = new StaticResourceExtension();
            Label          label       = new Label();
            RadBorder      radBorder   = new RadBorder();
            StackLayout    stackLayout = new StackLayout();
            ModalPopupPage modalPopupPage;
            NameScope      nameScope = (NameScope)(NameScope.GetNameScope(modalPopupPage = this) ?? new NameScope());

            NameScope.SetNameScope(modalPopupPage, nameScope);
            modalPopupPage.SetValue(VisualElement.BackgroundColorProperty, Color.Transparent);
            scaleAnimation.PositionIn             = MoveAnimationOptions.Center;
            scaleAnimation.PositionOut            = MoveAnimationOptions.Center;
            scaleAnimation.ScaleIn                = 0.5;
            scaleAnimation.ScaleOut               = 0.5;
            scaleAnimation.DurationIn             = (uint)new UintTypeConverter().ConvertFromInvariantString("400");
            scaleAnimation.DurationOut            = (uint)new UintTypeConverter().ConvertFromInvariantString("300");
            scaleAnimation.EasingIn               = (Easing) new EasingTypeConverter().ConvertFromInvariantString("SinOut");
            scaleAnimation.EasingOut              = (Easing) new EasingTypeConverter().ConvertFromInvariantString("SinIn");
            scaleAnimation.HasBackgroundAnimation = true;
            modalPopupPage.SetValue(Rg.Plugins.Popup.Pages.PopupPage.AnimationProperty, scaleAnimation);
            VisualDiagnostics.RegisterSourceInfo(scaleAnimation, new Uri("Views\\ModalPopupPage.xaml", UriKind.RelativeOrAbsolute), 12, 10);
            stackLayout.SetValue(View.VerticalOptionsProperty, LayoutOptions.Center);
            stackLayout.SetValue(View.HorizontalOptionsProperty, LayoutOptions.Center);
            stackLayout.SetValue(Xamarin.Forms.Layout.PaddingProperty, new Thickness(20.0));
            bindingExtension.Path = "ContentTapCommand";
            BindingBase binding = ((IMarkupExtension <BindingBase>)bindingExtension).ProvideValue((IServiceProvider)null);

            tapGestureRecognizer.SetBinding(TapGestureRecognizer.CommandProperty, binding);
            stackLayout.GestureRecognizers.Add(tapGestureRecognizer);
            VisualDiagnostics.RegisterSourceInfo(tapGestureRecognizer, new Uri("Views\\ModalPopupPage.xaml", UriKind.RelativeOrAbsolute), 28, 14);
            radBorder.SetValue(RadBorder.BorderColorProperty, new Color(0.18823529779911041, 0.18823529779911041, 0.18431372940540314, 0.93333333730697632));
            radBorder.SetValue(VisualElement.BackgroundColorProperty, new Color(0.18823529779911041, 0.18823529779911041, 0.18431372940540314, 0.93333333730697632));
            radBorder.SetValue(RadBorder.BorderThicknessProperty, new Thickness(2.0));
            radBorder.SetValue(RadBorder.CornerRadiusProperty, new Thickness(10.0));
            radBorder.SetValue(VisualElement.WidthRequestProperty, 300.0);
            bindingExtension2.Path = "Text";
            BindingBase binding2 = ((IMarkupExtension <BindingBase>)bindingExtension2).ProvideValue((IServiceProvider)null);

            label.SetBinding(Label.TextProperty, binding2);
            label.SetValue(Label.TextColorProperty, Color.White);
            staticResourceExtension.Key = "TCLRegular";
            XamlServiceProvider xamlServiceProvider = new XamlServiceProvider();
            Type typeFromHandle = typeof(IProvideValueTarget);

            object[] array = new object[0 + 4];
            array[0] = label;
            array[1] = radBorder;
            array[2] = stackLayout;
            array[3] = modalPopupPage;
            object service;

            xamlServiceProvider.Add(typeFromHandle, service = new SimpleValueTargetProvider(array, Label.FontFamilyProperty, nameScope));
            xamlServiceProvider.Add(typeof(IReferenceProvider), service);
            Type typeFromHandle2 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver = new XmlNamespaceResolver();

            xmlNamespaceResolver.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver.Add("animations", "clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup");
            xmlNamespaceResolver.Add("pages", "clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup");
            xmlNamespaceResolver.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xamlServiceProvider.Add(typeFromHandle2, new XamlTypeResolver(xmlNamespaceResolver, typeof(ModalPopupPage).GetTypeInfo().Assembly));
            xamlServiceProvider.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(40, 17)));
            object target = label.FontFamily = (string)((IMarkupExtension)staticResourceExtension).ProvideValue((IServiceProvider)xamlServiceProvider);

            VisualDiagnostics.RegisterSourceInfo(target, new Uri("Views\\ModalPopupPage.xaml", UriKind.RelativeOrAbsolute), 40, 17);
            BindableProperty    fontSizeProperty     = Label.FontSizeProperty;
            FontSizeConverter   fontSizeConverter    = new FontSizeConverter();
            XamlServiceProvider xamlServiceProvider2 = new XamlServiceProvider();
            Type typeFromHandle3 = typeof(IProvideValueTarget);

            object[] array2 = new object[0 + 4];
            array2[0] = label;
            array2[1] = radBorder;
            array2[2] = stackLayout;
            array2[3] = modalPopupPage;
            object service2;

            xamlServiceProvider2.Add(typeFromHandle3, service2 = new SimpleValueTargetProvider(array2, Label.FontSizeProperty, nameScope));
            xamlServiceProvider2.Add(typeof(IReferenceProvider), service2);
            Type typeFromHandle4 = typeof(IXamlTypeResolver);
            XmlNamespaceResolver xmlNamespaceResolver2 = new XmlNamespaceResolver();

            xmlNamespaceResolver2.Add("", "http://xamarin.com/schemas/2014/forms");
            xmlNamespaceResolver2.Add("x", "http://schemas.microsoft.com/winfx/2009/xaml");
            xmlNamespaceResolver2.Add("animations", "clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup");
            xmlNamespaceResolver2.Add("pages", "clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup");
            xmlNamespaceResolver2.Add("telerikPrimitives", "clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives");
            xamlServiceProvider2.Add(typeFromHandle4, new XamlTypeResolver(xmlNamespaceResolver2, typeof(ModalPopupPage).GetTypeInfo().Assembly));
            xamlServiceProvider2.Add(typeof(IXmlLineInfoProvider), new XmlLineInfoProvider(new XmlLineInfo(41, 17)));
            label.SetValue(fontSizeProperty, ((IExtendedTypeConverter)fontSizeConverter).ConvertFromInvariantString("Default", (IServiceProvider)xamlServiceProvider2));
            label.SetValue(View.HorizontalOptionsProperty, LayoutOptions.FillAndExpand);
            label.SetValue(View.VerticalOptionsProperty, LayoutOptions.FillAndExpand);
            label.SetValue(Label.HorizontalTextAlignmentProperty, new TextAlignmentConverter().ConvertFromInvariantString("Center"));
            label.SetValue(Label.VerticalTextAlignmentProperty, new TextAlignmentConverter().ConvertFromInvariantString("Center"));
            label.SetValue(View.MarginProperty, new Thickness(10.0));
            radBorder.SetValue(ContentView.ContentProperty, label);
            VisualDiagnostics.RegisterSourceInfo(label, new Uri("Views\\ModalPopupPage.xaml", UriKind.RelativeOrAbsolute), 37, 14);
            stackLayout.Children.Add(radBorder);
            VisualDiagnostics.RegisterSourceInfo(radBorder, new Uri("Views\\ModalPopupPage.xaml", UriKind.RelativeOrAbsolute), 31, 10);
            modalPopupPage.SetValue(ContentPage.ContentProperty, stackLayout);
            VisualDiagnostics.RegisterSourceInfo(stackLayout, new Uri("Views\\ModalPopupPage.xaml", UriKind.RelativeOrAbsolute), 23, 6);
            VisualDiagnostics.RegisterSourceInfo(modalPopupPage, new Uri("Views\\ModalPopupPage.xaml", UriKind.RelativeOrAbsolute), 2, 2);
        }