in XamlControlsGallery/ControlPages/PullToRefreshPage.xaml.cs [42:114]
public PullToRefreshPage()
{
this.InitializeComponent();
if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 6))
{
rc2 = new RefreshContainer();
rc2.RefreshRequested +=
new TypedEventHandler<RefreshContainer, RefreshRequestedEventArgs>(rc2_RefreshRequested);
rv2 = new RefreshVisualizer();
rv2.RefreshStateChanged +=
new TypedEventHandler<RefreshVisualizer, RefreshStateChangedEventArgs>(rv2_RefreshStateChanged);
Image ptrImage = new Image();
AccessibilitySettings accessibilitySettings = new AccessibilitySettings();
// Checking light theme
if ((ThemeHelper.RootTheme == ElementTheme.Light || Application.Current.RequestedTheme == ApplicationTheme.Light)
&& !accessibilitySettings.HighContrast)
{
ptrImage.Source = new BitmapImage(new Uri("ms-appx:///Assets/SunBlack.png"));
}
// Checking high contrast theme
else if (accessibilitySettings.HighContrast
&& accessibilitySettings.HighContrastScheme.Equals("High Contrast Black"))
{
ptrImage.Source = new BitmapImage(new Uri("ms-appx:///Assets/SunBlack.png"));
}
else
{
ptrImage.Source = new BitmapImage(new Uri("ms-appx:///Assets/SunWhite.png"));
}
ptrImage.Width = 35;
ptrImage.Height = 35;
rv2.Content = ptrImage;
rc2.Visualizer = rv2;
ListView lv2 = new ListView
{
Width = 200,
Height = 200,
BorderThickness = new Thickness(1),
HorizontalAlignment = HorizontalAlignment.Center,
BorderBrush = (Brush)Application.Current.Resources["TextControlBorderBrush"]
};
rc2.Content = lv2;
Ex2Grid.Children.Add(rc2);
Grid.SetRow(rc2, 1);
Grid.SetRow(lv2, 1);
timer1.Interval = new TimeSpan(0, 0, 0, 0, 500);
timer1.Tick += Timer1_Tick;
timer2.Interval = new TimeSpan(0, 0, 0, 0, 800);
timer2.Tick += Timer2_Tick;
foreach (var c in @"AcrylicBrush ColorPicker NavigationView ParallaxView PersonPicture PullToRefreshPage RatingsControl RevealBrush TreeView".Split(' '))
items1.Add(c);
lv.ItemsSource = items1;
foreach (var c in @"Mike Ben Barbra Claire Justin Shawn Drew Lili".Split(' '))
items2.Add(c);
lv2.ItemsSource = items2;
this.Loaded += PullToRefreshPage_Loaded;
}
}