示例#1
0
        private void InfoItemTapped(object sender, SelectionChangedEventArgs e)
        {
            if (e.AddedItems.Count <= 0)
            {
                return;
            }
            var infoItem = e.AddedItems[0] as InfoItemsViewModel;
            Uri uri      = null;
            var idx      = App.ViewModel.InfoItems.IndexOf(infoItem);

            if (infoItem != null && infoItem.Children.Count == 0 && infoItem.Link.StartsWith("http"))
            {
                uri = new Uri(infoItem.Link, UriKind.RelativeOrAbsolute);
            }
            else if (infoItem != null && infoItem.Children.Count == 0 && !infoItem.Link.StartsWith("http"))
            {
                uri = new Uri("/Pages/InfoItemBrowser.xaml?item=" + idx, UriKind.Relative);
            }
            else if (infoItem != null && infoItem.Children.Count != 0)
            {
                uri = new Uri("/Pages/InfoItemSubcontent.xaml?item=" + idx, UriKind.Relative);
            }
            if (uri != null && uri.ToString().StartsWith("http"))
            {
                InfoItemBrowser.BrowseToUrl(infoItem.Link);
            }
            else
            {
                NavigationService.Navigate(uri);
            }

            infoLLS.SelectedItem = null;
        }
示例#2
0
        private void ItemSelected(object sender, SelectionChangedEventArgs e)
        {
            var selected = e.AddedItems[0] as InfoItemsViewModel;

            if (selected == null)
            {
                return;
            }
            if (selected.Link.StartsWith("http"))
            {
                InfoItemBrowser.BrowseToUrl(selected.Link);
            }
            else
            {
                var uri = new Uri("/Pages/InfoItemBrowser.xaml?item=" + App.ViewModel.InfoItems.IndexOf(_item) + "&child=" + _item.Children.IndexOf(selected), UriKind.Relative);
                NavigationService.Navigate(uri);
            }
        }
示例#3
0
 private void HandleLinks(object sender, NotifyEventArgs e)
 {
     browser.Dispatcher.BeginInvoke(
         () => InfoItemBrowser.BrowseToUrl(e.Value)
         );
 }