public void InitializeComponent() { if (_contentLoaded) { return; } _contentLoaded = true; System.Windows.Application.LoadComponent(this, new System.Uri("/Places;component/Pages/ResultPage.xaml", System.UriKind.Relative)); this.LayoutRoot = ((SlideView.Library.SlideView)(this.FindName("LayoutRoot"))); this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel"))); this.TitlePanel = ((System.Windows.Controls.StackPanel)(this.FindName("TitlePanel"))); this.LocalSearhc = ((Microsoft.Phone.Controls.PhoneTextBox)(this.FindName("LocalSearhc"))); this.Places = ((Microsoft.Phone.Controls.LongListSelector)(this.FindName("Places"))); this.map = ((Microsoft.Phone.Maps.Controls.Map)(this.FindName("map"))); this.Map = ((System.Windows.Controls.Button)(this.FindName("Map"))); this.Route = ((System.Windows.Controls.Button)(this.FindName("Route"))); this.MoreInfo = ((System.Windows.Controls.Button)(this.FindName("MoreInfo"))); this.More = ((Microsoft.Phone.Shell.ApplicationBarIconButton)(this.FindName("More"))); }
override void OnApplyTemplate() { base.OnApplyTemplate(); _header = GetTemplateChild(HeaderName) as Panel; #if NETFX_CORE SidePanelWidth = Window.Current.Bounds.Width * 0.85; #endif _mainPanel = GetTemplateChild(SlideViewName) as SlideView; _mainPanel.SelectionChanged += MainPanel_SelectionChanged; _previousPageCache = GetTemplateChild(PageCacheName) as Image; var root = VisualTreeHelper.GetChild(this, 0) as FrameworkElement; if (root != null) { _pageTransitionForward = root.Resources[PageTransitionForwardName] as Storyboard; if (_pageTransitionForward != null) _pageTransitionForward.Completed += PageTransition_Completed; else IsPageTransitionEnabled = false; _pageTransitionBackward = root.Resources[PageTransitionBackwardName] as Storyboard; if (_pageTransitionBackward != null) _pageTransitionBackward.Completed += PageTransition_Completed; else IsPageTransitionEnabled = false; } _leftButton = GetTemplateChild(LeftPanelButtonName) as Button; if (_leftButton != null) _leftButton.Click += LeftPanelButton_Click; _rightButton = GetTemplateChild(RightPanelButtonName) as Button; if (_rightButton != null) _rightButton.Click += RightPanelButton_Click; OnIsSlideEnabledChanged(); }