Ejemplo n.º 1
0
        public void OnControlTemplateChanged()
        {
            tlog.Debug(tag, $"OnControlTemplateChanged START");
            try
            {
                var view  = new MyView();
                var child = new MyView();
                child.Parent = view;

                TemplateUtilities.OnControlTemplateChanged(view, "old", "new");
            }
            catch (Exception e)
            {
                Assert.Fail("Catch exception" + e.Message.ToString());
            }

            tlog.Debug(tag, $"OnControlTemplateChanged END");
        }
Ejemplo n.º 2
0
        public void ViewIsResourcesCreated()
        {
            tlog.Debug(tag, $"ViewIsResourcesCreated START");

            var testingTarget = new MyView()
            {
                Layout = new LinearLayout(),
            };

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <View>(testingTarget, "Should return View instance.");

            var result = testingTarget.IsResourcesCreated;

            tlog.Debug(tag, "IsResourcesCreated : " + result);

            testingTarget.Dispose();
            tlog.Debug(tag, $"ViewIsResourcesCreated END (OK)");
        }
Ejemplo n.º 3
0
        public async Task RelayoutContainerAdd()
        {
            tlog.Debug(tag, $"RelayoutContainerAdd START");

            var myView = new MyView();

            Assert.IsNotNull(myView, "Can't create success object PaddingType");
            Assert.IsInstanceOf <MyView>(myView, "Should be an instance of MyView2 type.");

            Window.Instance.Add(myView);

            try
            {
                _flagAdd = false;
                Assert.False(_flagAdd, "Should be false");

                PropertyMap propertyMap = new PropertyMap();
                propertyMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color));
                propertyMap.Add(ColorVisualProperty.MixColor, new PropertyValue(Color.Blue));

                myView.AddVisual(propertyMap);
                await Task.Delay(1000);

                Assert.True(_flagAdd, "Should be true");
            }
            catch (Exception e)
            {
                tlog.Error(tag, "Caught Exception" + e.ToString());
                LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString());
                Assert.Fail("Caught Exception" + e.ToString());
            }
            finally
            {
                Window.Instance.Remove(myView);
            }

            myView.Dispose();
            tlog.Debug(tag, $"RelayoutContainerAdd END (OK)");
        }
Ejemplo n.º 4
0
        public void ViewKeyInputFocus()
        {
            tlog.Debug(tag, $"ViewKeyInputFocus START");

            var testingTarget = new MyView()
            {
                Layout = new LinearLayout(),
            };

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <View>(testingTarget, "Should return View instance.");

            var result = testingTarget.KeyInputFocus;

            tlog.Debug(tag, "KeyInputFocus : " + result);

            testingTarget.KeyInputFocus = true;
            tlog.Debug(tag, "KeyInputFocus : " + testingTarget.KeyInputFocus);

            testingTarget.Dispose();
            tlog.Debug(tag, $"ViewKeyInputFocus END (OK)");
        }
Ejemplo n.º 5
0
        public void ViewControlState()
        {
            tlog.Debug(tag, $"ViewControlState START");

            var testingTarget = new MyView()
            {
                Layout = new LinearLayout(),
            };

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <View>(testingTarget, "Should return View instance.");

            var result = testingTarget.LayoutSet;

            tlog.Debug(tag, "LayoutSet : " + result);

            testingTarget.OnControlState(ControlState.Disabled);
            tlog.Debug(tag, "LayoutSet : " + result);

            testingTarget.Dispose();
            tlog.Debug(tag, $"ViewControlState END (OK)");
        }
Ejemplo n.º 6
0
        public void OnDetachingFrom()
        {
            tlog.Debug(tag, $"OnDetachingFrom START");
            try
            {
                IEnumerable <MyView> collection = new List <MyView>()
                {
                    new MyView()
                };
                var testingTarget = new MyAttachedCollection <MyView>();
                Assert.IsNotNull(testingTarget, "Can't create success object AttachedCollection.");

                var v = new MyView();
                testingTarget.AttachTo(v);
                testingTarget.OnDetach(v);
            }
            catch (Exception e)
            {
                Assert.Fail("Catch exception: " + e.Message.ToString());
            }

            tlog.Debug(tag, $"OnDetachingFrom END");
        }