private void Scroller_AnchorRequested(Scroller sender, ScrollerAnchorRequestedEventArgs args) { try { IList <UIElement> anchorCandidates = args.AnchorCandidates; if (chkLogScrollerEvents.IsChecked == true) { AppendAsyncEventMessage("AnchorRequested anchor=" + (args.AnchorElement == null ? "null" : "non-null") + ", count=" + anchorCandidates.Count); } if (anchorElement == null) { foreach (UIElement child in stackPanel.Children) { anchorCandidates.Add(child); } } else { args.AnchorElement = anchorElement; } } catch (Exception ex) { cmbAnchorElement.SelectedIndex = 0; BtnSetAnchorElement_Click(null, null); txtExceptionReport.Text = ex.ToString(); lstScrollerEvents.Items.Add(ex.ToString()); } }
private void Scroller_AnchorRequested(Scroller sender, ScrollerAnchorRequestedEventArgs args) { try { if (chkLogScrollerEvents.IsChecked == true) { IList <UIElement> anchorCandidates = args.AnchorCandidates; AppendAsyncEventMessage("AnchorRequested anchor=" + (args.AnchorElement == null ? "null" : "non-null") + ", count=" + anchorCandidates.Count); } args.AnchorElement = anchorElement; } catch (Exception ex) { txtExceptionReport.Text = ex.ToString(); lstScrollerEvents.Items.Add(ex.ToString()); } }