コード例 #1
0
        private void OnNoteLoaded(object sender, RoutedEventArgs e)
        {
#if WINDOWS_PHONE_APP
            if (!CanSwipeItems)
            {
                return;
            }

            FrameworkElement element = NotesGridView.ContainerFromItem((sender as FrameworkElement).DataContext) as FrameworkElement;
            if (element == null)
            {
                return;
            }

            EnableSwipeForElement(element);
#endif
        }
コード例 #2
0
        private async void CreateItemsSourceBindingIfNecessary()
        {
            var items = ItemsSource as IEnumerable <object>;

            if (items == null || NotesGridView.Items.Count > 0)
            {
                return;
            }

            foreach (var item in items)
            {
                NotesGridView.Items.Add(item);
            }

            await Task.Delay(1000);

            NotesGridView.SetBinding(ItemsControl.ItemsSourceProperty, new Binding()
            {
                Source = this, Path = new PropertyPath("ItemsSource"), Mode = BindingMode.OneWay
            });
        }