public static void returnAllMobile(MobileItem selectedPhone) { int count = 0; foreach (MobileItem MB in Global.listOfMobileFillter.Values) { MB.Margin = new Thickness(MB.Width * count, 0, 0, 0); Global.FadeinoutBtn(0, 1, MB, 0.1, 0); ScaleTransform ST = new ScaleTransform(1, 1, 0.5, 0.5); MB.RenderTransform = ST; //MB.Opacity = 1; Console.WriteLine("Phone : "+MB.MobileSpecification.NAME +" Margin : "+MB.Margin); count++; } //Global.Scene2 = null; Global.mainWindow.Introl = null; Global.mainWindow.mobileReturn = false; }
public void ChangeContentData(MobileItem _mobilteitem) { currentMobile = _mobilteitem; newClickedTime = DateTime.Now; TimeSpan ClicktimeDuration = newClickedTime - oldClickedTime; int clickTimeSec = ClicktimeDuration.Seconds; Detailin.Stop(); Detail_Out.Stop(); RandomBG(); if(screenAppear) { ////Console.WriteLine("Detail Out Animation Before State " + Detail_Out.GetCurrentProgress()); //this.settingContentAnimationOUT(Detail_Out); EventHandler handler = null; handler = delegate { DetailChange.Completed -= handler; DetailChange.Stop(); //Thread.Sleep(5000); }; DetailChange.Completed += handler; DetailChange.Begin(); //Detail_Out.Begin(); ////Console.WriteLine("Detail Out Animation After State " + Detail_Out.GetCurrentProgress()); } ////Console.WriteLine("Detail Count" + Detail_Scene.Children.Count); oldClickedTime = newClickedTime; }
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; }
public static void TransitionAnimation(Thickness movefrom, Thickness moveTarget, MobileItem MoveItem,Storyboard transitionStoryboard = null, double begintime = 0, double duration = 1) { ThicknessAnimation movegrid = new ThicknessAnimation() { From = movefrom, To = moveTarget, BeginTime = TimeSpan.FromSeconds(begintime), Duration = TimeSpan.FromSeconds(duration) }; QuarticEase be = new QuarticEase(); movegrid.EasingFunction = be; Storyboard.SetTarget(movegrid, MoveItem); Storyboard.SetTargetProperty(movegrid, new PropertyPath(Grid.MarginProperty)); //Storyboard sb = new Storyboard(); EventHandler handler = null; handler = delegate { transitionStoryboard.Completed -= handler; transitionStoryboard.Stop(); MoveItem.Margin = moveTarget; //Console.WriteLine(MoveItem.MobileSpecification.NAME + " Margin : " + MoveItem.Margin); }; transitionStoryboard.Children.Add(movegrid); transitionStoryboard.Completed += handler; //sb.Begin(); }