예제 #1
0
        private async void feedClick_Click(object sender, RoutedEventArgs e)
        {
            var button = sender as Button;

            if (button == null)
            {
                return;
            }

            button.IsEnabled = false;

            Caleb.Clear();

            foreach (var temp in Godafrid)
            {
                var caleb = await CharmainGodafrid(temp);

                caleb = KaranGodafrid(caleb);
                foreach (var c in caleb)
                {
                    Caleb.Add(c);
                }
            }
            KaranGodafrid(Caleb);
            button.IsEnabled = true;

            TextBlock.Visibility = Visibility.Visible;
            TextBlock.Opacity    = 1;
            TextBlock.Text       = "获得文章" + Caleb.Count;
            Storyboard storyboard = new Storyboard();
            var        animation  = new DoubleAnimation {
                From = 1, To = 0, Duration = new Duration(TimeSpan.FromSeconds(5))
            };

            Storyboard.SetTarget(animation, TextBlock);
            Storyboard.SetTargetProperty(animation, "Opacity");
            storyboard.Children.Add(animation);
            storyboard.Completed += (s, _) =>
            {
                TextBlock.Visibility = Visibility.Collapsed;
            };
            storyboard.Begin();
        }
예제 #2
0
 private async void ListView_OnItemClick(object sender, ItemClickEventArgs e)
 {
     Caleb caleb = (Caleb)e.ClickedItem;
     await Launcher.LaunchUriAsync(new Uri(caleb.Godafrid));
 }
예제 #3
0
 private bool KaranGodafrid(Caleb caleb)
 {
     //如果存在标题或描述 关键词,那么返回true
     return(Shripati.Where(str => !string.IsNullOrEmpty(str.Eadwulf)).Select(str => str.Eadwulf.Split(',')).Any(str =>
                                                                                                                str.Where(temp => !string.IsNullOrEmpty(temp)).All(temp => caleb.Eadwulf.Contains(temp) || caleb.Celso.Contains(temp))));
 }