public void StartDisplay(TravelOffer lastTravel) { _currentOffer = lastTravel; try { InitializeComponent(); InitList(); var helper = KinectHelper.Instance; helper.ReadyEvent += (s, _) => HelperReady(); GreenScreen.Start(helper.Sensor, false); SetNewHat(); Accessories.Start(helper.Sensor); RectNavigationControl.Start(helper.Sensor); RectNavigationControl.SwipeLeftEvent += SwipeLeft; RectNavigationControl.SwipeRightEvent += SwipeRight; RectNavigationControl.SwipeUpEvent += SwipeUp; RectNavigationControl.SwipeDownEvent += SwipeDown; RectNavigationControl.NoSwipe += NoSwipe; string[] texts = MyTextLoopList.GetNeighbourTexts(); RectNavigationControl.SetTopText(texts[0]); RectNavigationControl.SetBottomText(texts[1]); InitGenderDetection(); } catch (Exception exc) { ExceptionTextBlock.Text = exc.Message + "\r\n" + exc.InnerException + "\r\n" + exc.StackTrace; } }
/*Erst wenn die Scrollanimation der TextLoopList beendet ist, darf die LoopList weiterscrollen (vertical).*/ private void MyTextLoopList_Scrolled(object sender, EventArgs e) { _waitForTextList = false; if (!_unclicked) { _doDrag = true; } string[] texts = MyTextLoopList.GetNeighbourTexts(); RectNavigationControl.SetTopText(texts[0]); RectNavigationControl.SetBottomText(texts[1]); }
private void InitList() { MyLoopList.SetAutoDragOffset(0.50); MyLoopList.SetDuration(new Duration(new TimeSpan(3000000))); //300m MyLoopList.Scrolled += MyLoopListOnScrolled; MyTextLoopList.Scrolled += MyTextLoopList_Scrolled; MyTextLoopList.SetFontSize(36); MyTextLoopList.SetFontColor(Colors.White); //MyTextLoopList.SetWordWrap(TextWrapping.Wrap); //MyTextLoopList.SetFontFamily("Miriam Fixed"); MyTextLoopList.SetDuration(new Duration(new TimeSpan(5500000))); LoadPictures(new LocalPictureUiLoader()); }
private void InitList() { MyLoopList.SetAutoDragOffset(0.5); MyLoopList.SetDuration(new Duration(new TimeSpan(3000000))); //300m MyLoopList.Scrolled += MyLoopListOnScrolled; MyTextLoopList.Scrolled += MyTextLoopList_Scrolled; MyTextLoopList.SetFontSize(36); MyTextLoopList.SetFontFamily("Miriam Fixed"); MyTextLoopList.SetDuration(new Duration(new TimeSpan(5500000))); string[] paths = Directory.GetFiles(Environment.CurrentDirectory + @"\images\Beach"); Image img = new Image { Source = new BitmapImage(new Uri(paths[0], UriKind.RelativeOrAbsolute)) }; Node node1 = MyLoopList.AddNewToLeft(null, -1, img); img = new Image { Source = new BitmapImage(new Uri(paths[1], UriKind.RelativeOrAbsolute)) }; Node node2 = MyLoopList.AddNewToLeft(null, -1, img); node1.Right = node2; node2.Left = node1; node2.Below = node1; node2.Right = node1; Node nodeHallo = MyLoopList.AddNewToAbove(null, -1, new Button { Content = "Hallo", Width = 40, Height = 40 }); Node nodeToll = MyLoopList.AddNewToLeft(nodeHallo, -1, new Button { Content = "Toll, ne?", Width = 100, Height = 40 }); node2.Above = nodeToll; nodeToll.Below = nodeHallo; nodeToll.Above = nodeHallo; nodeHallo.Above = nodeToll; nodeHallo.Below = nodeToll; MyTextLoopList.Add("lol"); MyTextLoopList.Add("käse"); MyTextLoopList.Add("Test"); MyTextLoopList.Add("Ahjo"); MyTextLoopList.Add("a"); MyTextLoopList.Add("b"); MyTextLoopList.Add("c"); }
/*Wenn die LoopList vertical gescrollt wurde, wird die TextLoopList gescrollt.*/ private void MyLoopListOnScrolled(object sender, EventArgs e) { if (e != null) { LoopListArgs lla = (LoopListArgs)e; if (lla.GetId() != -1) // Wenn Minigame { GreenScreen.Opacity = 1; Accessories.Opacity = 1; MyTextLoopList.Opacity = 0.7; _isGameActive = false; _currentOffer = new TravelOfferDao().SelectById(lla.GetId()); } else { _isGameActive = true; GreenScreen.Opacity = 0.2; Accessories.Opacity = 0.2; MyTextLoopList.Opacity = 0; } SetNewHat(); switch (lla.GetDirection()) { case Direction.Top: _waitForTextList = MyTextLoopList.Anim(true); break; case Direction.Down: _waitForTextList = MyTextLoopList.Anim(false); break; } ResetDragDirectionObvious(); if (!_unclicked) { _doDrag = true; } } }
/*Wenn die LoopList vertical gescrollt wurde, wird die TextLoopList gescrollt.*/ private void MyLoopListOnScrolled(object sender, EventArgs e) { if (e != null) { switch (((LoopListArgs)e).GetDirection()) { case Direction.Top: _waitForTextList = MyTextLoopList.Anim(true); break; case Direction.Down: _waitForTextList = MyTextLoopList.Anim(false); break; } ResetDragDirectionObvious(); if (!_mouseIsUp) { _doDrag = true; } } }