private void OnPushButtonClicked(object sender, global::System.EventArgs args) { mSlideshow = !mSlideshow; if (mSlideshow) { mPanGestureDetector.Detach(mContent); var style = mSlideshowButton.Style; style.Icon.ResourceUrl = new Selector <string>() { Normal = SLIDE_SHOW_STOP_ICON, Pressed = SLIDE_SHOW_STOP_ICON_SELECTED }; mSlideshowButton.ApplyStyle(style); mPanPosition = new Vector2(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Width * 0.5f); mPanDisplacement = new Vector2(-10.0f, 0.0f); mViewTimer.Start(); } else { mPanGestureDetector.Attach(mContent); var style = mSlideshowButton.Style; style.Icon.ResourceUrl = new Selector <string>() { Normal = SLIDE_SHOW_START_ICON, Pressed = SLIDE_SHOW_START_ICON_SELECTED }; mSlideshowButton.ApplyStyle(style); mViewTimer.Stop(); } }
private bool OnPushButtonClicked(object sender, global::System.EventArgs args) { mSlideshow = !mSlideshow; if (mSlideshow) { mPanGestureDetector.Detach(mContent); PropertyMap unselected_bg_map = new PropertyMap(); unselected_bg_map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)); unselected_bg_map.Add(ImageVisualProperty.URL, new PropertyValue(SLIDE_SHOW_STOP_ICON)); mSlideshowButton.UnselectedBackgroundVisual = unselected_bg_map; PropertyMap selected_bg_map = new PropertyMap(); selected_bg_map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)); selected_bg_map.Add(ImageVisualProperty.URL, new PropertyValue(SLIDE_SHOW_STOP_ICON_SELECTED)); mSlideshowButton.SelectedBackgroundVisual = selected_bg_map; mPanPosition = new Vector2(Window.Instance.WindowSize.Width, Window.Instance.WindowSize.Width * 0.5f); mPanDisplacement = new Vector2(-10.0f, 0.0f); mViewTimer.Start(); } else { mPanGestureDetector.Attach(mContent); PropertyMap unselected_bg_map = new PropertyMap(); unselected_bg_map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)); unselected_bg_map.Add(ImageVisualProperty.URL, new PropertyValue(SLIDE_SHOW_START_ICON)); mSlideshowButton.UnselectedBackgroundVisual = unselected_bg_map; PropertyMap selected_bg_map = new PropertyMap(); selected_bg_map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)); selected_bg_map.Add(ImageVisualProperty.URL, new PropertyValue(SLIDE_SHOW_START_ICON_SELECTED)); mSlideshowButton.SelectedBackgroundVisual = selected_bg_map; mViewTimer.Stop(); } return(true); }