Beispiel #1
0
        public MobileItem(XmlElement phoneNode = null)
        {
            InitializeComponent();
            MobileSpecification = new MobileItemSpecification();
            ListOfPackage = new List<PackageItem>();
            ClickedAnimation = (Storyboard)TryFindResource("phoneClick");
            aurastart = (Storyboard)TryFindResource("aurastart");

            MobileSpecification = new MobileItemSpecification(phoneNode);

            this.InitPhoneContent(MobileSpecification);
        }
Beispiel #2
0
        void initPhoneDataFromXMLFile(string dir)
        {
            XmlElement rootNode;
            XmlDocument document = new XmlDocument();

            document.Load(dir);
            rootNode = document.DocumentElement;

            Global.maxPhoneItem = rootNode.GetElementsByTagName("Phone").Count;

            for (int i = 0; i < Global.maxPhoneItem; i++)
            {
                XmlElement childNode = (XmlElement)rootNode.ChildNodes[i];
                MobileItemSpecification specification = new MobileItemSpecification(childNode);
                MobileItem MB = new MobileItem(childNode);
                MB.IDPHONE = i;
                //MB.Margin = new Thickness(MB.Width * i,0,0,0);
                //Console.WriteLine("Name : " + MB.MobileSpecification.NAME + " ID : "+MB.IDPHONE);
                listOfSpecification.Add(specification);
                Global.listOfMobileItem.Add(i,MB);
            }
            Global.listOfMobileFillter = Global.listOfMobileItem;
        }
Beispiel #3
0
        public void InitPhoneContent(MobileItemSpecification _specification)
        {
            this.MobileSpecification = _specification;

            comparemonth = DateTime.Now.Month - MobileSpecification.DATESALE.Month;
            //Console.WriteLine("Month Now : {0} Release Month : {1}", DateTime.Now.Month, mobileSpecification.DATESALE);

            this.frontPhone.Source = Global.LoadImage(new Uri(MobileSpecification.imagePath, UriKind.Relative));
            //this.shadow_frontPhone.Source = Global.LoadImage(new Uri(mobileSpecification.imagePath, UriKind.Relative));
            this.headerName.Source = Global.LoadImage(new Uri(MobileSpecification.WHITEPATH, UriKind.Relative));
            this.priceTextBlock.Text = MobileSpecification.PRICETEXT + " บาท";

            if (comparemonth == 0) { _new.Visibility = Visibility.Visible; }
            else _new.Visibility = Visibility.Collapsed;

            //Console.WriteLine("Mobilename {0} : CompareDate : {1} ",MobileSpecification.NAME,comparemonth);

            this.initSpecailItem(MobileSpecification.PROMOTION);

            this.initPackageItem(MobileSpecification.PACKAGENAME);

            //this.Tag = _phoneTag;
        }