예제 #1
0
        public Playground(ComponentBuilderOptions options)
        {
            InitializeComponent();

            options.Content = Content;

            ComponentBuilder.Init(options);
        }
예제 #2
0
        public static async Task Main(string[] args)
        {
            var xamlPreserve = CreatePreserveXaml();

            await Post(xamlPreserve, xamlPreserve);

            return;

            MockForms.Init();

            var componentBuilderOptions = new ComponentBuilderOptions
            {
                PreserveSession                 = true,
                SuppressAllBackGroundColor      = false,
                EnableRepeater                  = true,
                EnableRestorationOfUIAttributes = true,
                EnableTapGestureRecognizers     = true,
                EnableUIAttributesGeneration    = true
            };

            var playground           = new Playground(componentBuilderOptions);
            var preserveUIAttributes = ComponentBuilder.PreserveUIAttributes;



            XmlSerializer xs        = new XmlSerializer(typeof(Preserve));
            TextWriter    txtWriter = new StreamWriter(xmlFilePath);

            xs.Serialize(txtWriter, preserveUIAttributes);
            txtWriter.Close();

            string xml, xaml = string.Empty;

            Console.WriteLine("----------------------------------------------");

            using (StreamReader reader = File.OpenText(xamlFilePath))
            {
                Console.WriteLine("Given XAML:");
                xaml = reader.ReadToEnd();
                Console.WriteLine(xaml);
            }

            Console.WriteLine("----------------------------------------------");

            using (StreamReader reader = File.OpenText(xmlFilePath))
            {
                Console.WriteLine("Generated XML:");
                xml = reader.ReadToEnd();
                Console.WriteLine(xml);
            }

            Console.WriteLine("----------------------------------------------");

            await Post(xml, xaml);

            Console.WriteLine("XML File Generated!");
        }
예제 #3
0
        public static ISencillaBuilder UseSencillaComponents(this ISencillaBuilder builder, Action <ComponentBuilderOptions> componentsRetriver)
        {
            // Component retriever
            var options = new ComponentBuilderOptions();

            componentsRetriver(options);

            // Register in container
            var componentInterface = typeof(IComponent);

            foreach (var componentImpl in options.Components)
            {
                builder.Resolver.RegisterType(componentInterface, componentImpl, componentImpl.FullName);
            }

            // Init components
            return(builder.BuildSencillaComponents());
        }