private async void Button_Clicked_2(object sender, EventArgs e) { try { string fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "temp.txt"); bool doesExist = File.Exists(fileName); string text = null; if (doesExist == true) { text = File.ReadAllText(fileName); } text += note1.Title.ToString() + "\t" + note1.Description.ToString() + "\t" + note1.Enclosure.ToString() + "\t" + note1.Link + "\n"; File.WriteAllText(fileName, text); DependencyService.Get <Interface1>().LongAlert("Cохранено"); } catch (Exception ex) { await DisplayAlert("В файле ошибка ", ex.ToString(), "OK"); } finally { note1 = null; frame.IsVisible = false; } }
private async void Button_Clicked(object sender, EventArgs e) { note1 = null; BindableObject bindableObject = sender as BindableObject; if (bindableObject != null) { note1 = bindableObject.BindingContext as RSSFeedItem; } Image.Source = note1.Enclosure; TextTitle.Text = note1.Title; TextDesc.Text = note1.Description; TextIst.Text = note1.istochnic; // ImageFrame.HeightRequest = note1.h; frame.IsVisible = true; }
public async void OnItemTapped(object sender, ItemTappedEventArgs e) { RSSFeedItem selectedPhone = e.Item as RSSFeedItem; if (selectedPhone != null) { if (selectedPhone.Enclosure != null) { if (!ClassSetUpUser.MyWebShow) { await Navigation.PushAsync(new PageMyWeb(selectedPhone)); } else { await Navigation.PushAsync(new PageWebView(selectedPhone.Link)); } } } // await Navigation.PushModalAsync(new Page4(selectedPhone.Link)); }
private async void Button_Clicked(object sender, EventArgs e) { try { Button button = (Button)sender; string ID = button.CommandParameter.ToString(); BindableObject bindableObject = sender as BindableObject; if (bindableObject != null) { RSSFeedItem note = bindableObject.BindingContext as RSSFeedItem; int x = 0; foreach (var cl in Col1) { if (cl.Title == note.Title) { Col1.RemoveAt(x); break; } x++; } string text = String.Empty; string fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "temp.txt"); bool doesExist = File.Exists(fileName); foreach (var cl in Col1) { text += cl.Title.ToString() + "\t" + cl.Description.ToString() + "\t" + cl.Enclosure.ToString() + "\t" + cl.Link + "\n"; } File.WriteAllText(fileName, text); DependencyService.Get <Interface1>().LongAlert("Удалено"); } } catch (Exception ex) { await DisplayAlert("В файле ошибка ", ex.ToString(), "OK"); } }
private void Button_Clicked_1(object sender, EventArgs e) { frame.IsVisible = false; note1 = null; }
public PageMyWeb(RSSFeedItem rSSFeedItem) { InitializeComponent(); myUri2 = rSSFeedItem.Link; ist = rSSFeedItem.istochnic; }