/// <summary> /// Fired when pullToRefresh View is pulling /// </summary> /// <param name="sender">PullToRefresh_Pulling event sender</param> /// <param name="e">PullToRefresh_Pulling event args</param> private void PullToRefresh_Pulling(object sender, PullingEventArgs e) { ICollection <ResourceDictionary> mergedDictionaries = null; #if COMMONSB var parent = (sender as SfPullToRefresh).Parent; while (parent != null) { if (parent is ThemesPage) { mergedDictionaries = (parent as Page).Resources.MergedDictionaries; break; } parent = parent.Parent; } #else mergedDictionaries = (((sender as SfPullToRefresh).Parent as Grid).Parent as SampleView).Resources.MergedDictionaries; #endif var darkTheme = (mergedDictionaries != null) ? mergedDictionaries.OfType <DarkTheme>().FirstOrDefault() : null; if (darkTheme != null) { typeof(SfPullToRefresh).GetRuntimeProperties().FirstOrDefault(propertyName => propertyName.Name == "HasShadow").SetValue(this.pullToRefresh, false); } else { typeof(SfPullToRefresh).GetRuntimeProperties().FirstOrDefault(propertyName => propertyName.Name == "HasShadow").SetValue(this.pullToRefresh, true); } mergedDictionaries = null; }
/// <summary> /// Fired when pulling occurs. /// </summary> /// <param name="sender">PullToRefresh_Refreshing event sender</param> /// <param name="e">PullToRefresh_Refreshing event args</param> private void PullToRefresh_Pulling(object sender, PullingEventArgs e) { this.progressbar.TrackInnerRadius = 0.8; this.progressbar.TrackOuterRadius = 0.1; this.progressbar.IsIndeterminate = false; this.progressbar.ProgressColor = Color.FromRgb(0, 124, 238); this.progressbar.TrackColor = Color.White; var absoluteProgress = Convert.ToInt32(Math.Abs(e.Progress)); this.progressbar.Progress = absoluteProgress; this.progressbar.SetProgress(absoluteProgress, 1, Easing.CubicInOut); }
/// <summary> /// Pulling event is triggered whenever you start pulling down on the PullableContent with /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void PullToRefresh_Pulling(object sender, PullingEventArgs args) { args.Cancel = false; var prog = args.Progress; }