Esempio n. 1
0
 public void SettersTest1()
 {
     tlog.Debug(tag, $"SettersTest1 START");
     try
     {
         XamlStyle t2 = new XamlStyle(typeof(View));
         Assert.IsNotNull(t2, "null XamlStyle");
         Assert.AreEqual(0, t2.Setters.Count, "Should be equal");
     }
     catch (Exception e)
     {
         Assert.Fail("Caught Exception" + e.ToString());
     }
     tlog.Debug(tag, $"SettersTest1 END");
 }
Esempio n. 2
0
 public void TargetTypeTest1()
 {
     tlog.Debug(tag, $"TargetTypeTest1 START");
     try
     {
         Type      type = typeof(View);
         XamlStyle t2   = new XamlStyle(type);
         Assert.IsNotNull(t2, "null XamlStyle");
         Assert.AreEqual(type, t2.TargetType, "Should be equal");
     }
     catch (Exception e)
     {
         Assert.Fail("Caught Exception" + e.ToString());
     }
     tlog.Debug(tag, $"TargetTypeTest1 END");
 }
Esempio n. 3
0
 public void ClassTest1()
 {
     tlog.Debug(tag, $"ClassTest1 START");
     try
     {
         XamlStyle t2 = new XamlStyle(typeof(View));
         Assert.IsNotNull(t2, "null XamlStyle");
         t2.Class = "baseStyle";
         Assert.AreEqual("baseStyle", t2.Class, "Should be equal");
     }
     catch (Exception e)
     {
         Assert.Fail("Caught Exception" + e.ToString());
     }
     tlog.Debug(tag, $"ClassTest1 END");
 }
Esempio n. 4
0
 public void BasedOnTest1()
 {
     tlog.Debug(tag, $"BasedOnTest1 START");
     try
     {
         XamlStyle t1 = new XamlStyle(typeof(View));
         Assert.IsNotNull(t1, "null XamlStyle");
         XamlStyle t2 = new XamlStyle(typeof(ImageView));
         t2.BasedOn = t1;
         Assert.AreEqual(t1, t2.BasedOn, "Should be equal");
     }
     catch (Exception e)
     {
         Assert.Fail("Caught Exception" + e.ToString());
     }
     tlog.Debug(tag, $"BasedOnTest1 END");
 }
Esempio n. 5
0
        public void XamlStyleConstructor()
        {
            tlog.Debug(tag, $"XamlStyleConstructor START");

            try
            {
                XamlStyle t2 = new XamlStyle(typeof(View));
                Assert.IsNotNull(t2, "null XamlStyle");
                Assert.IsInstanceOf <XamlStyle>(t2, "Should return XamlStyle instance.");
            }
            catch (Exception e)
            {
                Assert.Fail("Caught Exception" + e.ToString());
            }

            tlog.Debug(tag, $"XamlStyleConstructor END");
        }
Esempio n. 6
0
 public void CanCascadeTest1()
 {
     tlog.Debug(tag, $"CanCascadeTest1 START");
     try
     {
         XamlStyle t2 = new XamlStyle(typeof(View));
         Assert.IsNotNull(t2, "null XamlStyle");
         t2.CanCascade = true;
         Assert.AreEqual(true, t2.CanCascade, "Should be equal");
         t2.CanCascade = false;
         Assert.AreEqual(false, t2.CanCascade, "Should be equal");
     }
     catch (Exception e)
     {
         Assert.Fail("Caught Exception" + e.ToString());
     }
     tlog.Debug(tag, $"CanCascadeTest1 END");
 }
Esempio n. 7
0
        public void CanBeAppliedTo()
        {
            tlog.Debug(tag, $"CanBeAppliedTo START");
            try
            {
                View view = new View();
                Assert.IsNotNull(view, "null View");
                var style = new XamlStyle(typeof(View));
                style.CanBeAppliedTo(typeof(View));

                style.CanBeAppliedTo(typeof(TextLabel));
            }
            catch (Exception e)
            {
                Assert.Fail("Caught Exception" + e.ToString());
            }
            tlog.Debug(tag, $"CanBeAppliedTo END");
        }
Esempio n. 8
0
 internal override void OnSetStyles()
 {
     XamlStyle?.Set(this);
 }
Esempio n. 9
0
 public override void OnSetStyles()
 {
     XamlStyle?.Set(this);
 }