public ChildInformationpageView(int offlineStudentID) { viewModel = new ChildInformationpageViewModel(offlineStudentID); BindingContext = viewModel; InitializeComponent(); viewModel.ResetContent = new Action(ResetContent); AwesomeCheckbox.FillColor = Common.Colors.LightBlueColor; AwesomeCheckbox.OutlineColor = Common.Colors.LightBlueColor; }
private void ResetContent() { try { this.ListView.DisposeListView?.Invoke(); this.BindingContext = null; this.viewModel.BindingContext = null; this.viewModel = null; this.MainGrid.Children.Clear(); this.Content = null; } catch (Exception ex) { } GC.Collect(); GC.SuppressFinalize(this); }
private void TapGestureRecognizer_Tapped_1(object sender, EventArgs e) { try { this.ListView.DisposeListView?.Invoke(); viewModel.BindingContext = null; viewModel = null; this.BindingContext = null; this.MainGrid.Children.Clear(); this.Content = null; App.Current.MainPage = new DashboardHomeView(); } catch (Exception) { } GC.Collect(); GC.SuppressFinalize(this); }