本文整理汇总了C#中ContainerContentChangingEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ContainerContentChangingEventArgs类的具体用法?C# ContainerContentChangingEventArgs怎么用?C# ContainerContentChangingEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContainerContentChangingEventArgs类属于命名空间,在下文中一共展示了ContainerContentChangingEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PerformNextPhase
private static bool PerformNextPhase(ContainerContentChangingEventArgs args)
{
args.Handled = false;
var phaseIndex = (int)args.Phase;
var controlChangingState = args.ItemContainer.Tag as ControlChangingState;
if (controlChangingState == null)
{
controlChangingState = new ControlChangingState();
args.ItemContainer.Tag = controlChangingState;
}
if (phaseIndex == 0)
{
controlChangingState.Initialise(args);
}
else
{
var itemsToShow = controlChangingState.GetControlsInPhase(phaseIndex-1);
foreach (var item in itemsToShow)
{
controlChangingState.ShowItem(args, item);
}
}
if (phaseIndex <= controlChangingState.MaxPhaseIndex+1)
{
return true;
}
return false;
}
示例2: Phase0Load
internal bool Phase0Load(ListViewBase sender, ContainerContentChangingEventArgs args)
{
if (!args.InRecycleQueue)
{
if (((CommentViewModel)args.Item).IsEditing)
{
var editContent = (Resources["editingTemplate"] as DataTemplate).LoadContent() as FrameworkElement;
editContent.DataContext = ((CommentViewModel)DataContext).ReplyViewModel;
contentControl.Content = editContent;
contentControl.MinHeight = 0;
return false;
}
else
{
contentControl.ContentTemplate = null;
contentControl.Content = null;
var body = ((CommentViewModel)args.Item).Body ?? "";
contentControl.MinHeight = Math.Max(25, body.Length / 2);
args.Handled = true;
LoadPhase = 1;
return true;
}
}
return false;
}
示例3: OnContainerContentChanging
private void OnContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
if (args.InRecycleQueue)
{
ListViewItem lvi = (args.ItemContainer as ListViewItem);
if (lvi != null)
{
UIElement element = VisualTreeHelper.GetChild(lvi, 0) as UIElement;
if (element != null)
{
element.PointerPressed -= OnPointerPressed;
element.PointerReleased -= OnPointerReleased;
element.PointerCaptureLost -= OnPointerCaptureLost;
element.PointerExited -= OnPointerExited;
}
}
}
else if (args.Phase == 0)
{
ListViewItem lvi = (args.ItemContainer as ListViewItem);
if (null != lvi)
{
UIElement element = VisualTreeHelper.GetChild(lvi, 0) as UIElement;
if (null != element)
{
element.PointerPressed += OnPointerPressed;
element.PointerReleased += OnPointerReleased;
element.PointerCaptureLost += OnPointerCaptureLost;
element.PointerExited += OnPointerExited;
}
}
}
}
示例4: ItemGridView_ContainerContentChanging
void ItemGridView_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
//ItemViewer iv = args.ItemContainer.ContentTemplateRoot as ItemViewer;
//if (args.InRecycleQueue == true)
//{
// iv.ClearData();
//}
//else if (args.Phase == 0)
//{
// iv.ShowPlaceholder(args.Item as Item);
// // Register for async callback to visualize Title asynchronously
// args.RegisterUpdateCallback(ContainerContentChangingDelegate);
//}
//else if (args.Phase == 1)
//{
// iv.ShowTitle();
// args.RegisterUpdateCallback(ContainerContentChangingDelegate);
//}
//else if (args.Phase == 2)
//{
// iv.ShowCategory();
// iv.ShowImage();
//}
//// For imporved performance, set Handled to true since app is visualizing the data item
//args.Handled = true;
}
示例5: ItemListView_ContainerContentChanging
/// <summary>
/// We will visualize the data item in asynchronously in multiple phases for improved panning user experience
/// of large lists. In this sample scneario, we will visualize different parts of the data item
/// in the following order:
///
/// 1) Title and placeholder for Image (visualized synchronously - Phase 0)
/// 2) Subtilte (visualized asynchronously - Phase 1)
/// 3) Image (visualized asynchronously - Phase 2)
///
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void ItemListView_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
Scenario2ItemViewer iv = args.ItemContainer.ContentTemplateRoot as Scenario2ItemViewer;
if (args.InRecycleQueue == true)
{
iv.ClearData();
}
else if (args.Phase == 0)
{
iv.ShowTitle(args.Item as Item);
// Register for async callback to visualize Title asynchronously
args.RegisterUpdateCallback(ContainerContentChangingDelegate);
}
else if (args.Phase == 1)
{
iv.ShowSubtitle();
args.RegisterUpdateCallback(ContainerContentChangingDelegate);
}
else if (args.Phase == 2)
{
iv.ShowImage();
}
// For imporved performance, set Handled to true since app is visualizing the data item
args.Handled = true;
}
示例6: Items_ContainerContentChanging
/// <summary>
/// We will visualize the data item in asynchronously in multiple phases for improved panning user experience
/// of large lists. In this sample scneario, we will visualize different parts of the data item
/// in the following order:
///
/// 1) Placeholders (visualized synchronously - Phase 0)
/// 2) Labels (visualized asynchronously - Phase 1)
/// 3) Values (visualized asynchronously - Phase 2)
///
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void Items_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
TeamsDrillDownItem iv = args.ItemContainer.ContentTemplateRoot as TeamsDrillDownItem;
if (args.InRecycleQueue == true)
{
iv.ClearData();
}
else if (args.Phase == 0)
{
iv.ShowPlaceholder(args.Item as TeamsDrillDownViewModel);
// Register for async callback to visualize Title asynchronously
args.RegisterUpdateCallback(ContainerContentChangingDelegate);
}
else if (args.Phase == 1)
{
iv.ShowLabels();
args.RegisterUpdateCallback(ContainerContentChangingDelegate);
}
else if (args.Phase == 2)
{
iv.ShowValues();
args.RegisterUpdateCallback(ContainerContentChangingDelegate);
}
// For improved performance, set Handled to true since app is visualizing the data item
args.Handled = true;
}
示例7: ListView_ContainerContentChanging
private void ListView_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
CompositionImage image = args.ItemContainer.ContentTemplateRoot.GetFirstDescendantOfType<CompositionImage>();
Thumbnail thumbnail = args.Item as Thumbnail;
// Update the image URI
image.Source = new Uri(thumbnail.ImageUrl);
}
示例8: ApplyPhaseTwo
private void ApplyPhaseTwo(ContainerContentChangingEventArgs args)
{
var templateRoot = args.ItemContainer.ContentTemplateRoot as StackPanel;
var hockeyPlayerVM = args.Item as HockeyPlayerViewModel;
var image = templateRoot.Children[0] as Image;
image.Source = new BitmapImage { UriSource = new Uri(hockeyPlayerVM.Photo), DecodePixelWidth = 50, DecodePixelHeight = 50 };
image.Opacity = 1;
}
示例9: OnContainerContentChanging
private void OnContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
var visual = ElementCompositionPreview.GetElementVisual(args.ItemContainer);
visual.ImplicitAnimations = args.InRecycleQueue
? null
: animations;
}
示例10: messageList_ContainerContentChanging
private void messageList_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
if (args.ItemContainer.ContentTemplateRoot is MessageControl)
{
var message = args.ItemContainer.ContentTemplateRoot as MessageControl;
message.DataContext = args.Item;
message.PhaseLoad(sender, args);
}
}
示例11: ListViewContainerContentChanging
private static void ListViewContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
// We need to leave this as false, otherwise data binding will not work
args.Handled = false;
bool hasMore = PerformNextPhase(args);
if (hasMore)
{
args.RegisterUpdateCallback(ListViewContainerContentChanging);
}
}
示例12: OnContainerContentChanging
private void OnContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
if (args.InRecycleQueue)
{
if (_index > _associatedObject.Items.Count - 1)
{
_index = _associatedObject.Items.Count - 1;
}
_associatedObject.SelectedIndex = _index;
}
}
开发者ID:madeinouweland,项目名称:windows-10-select-after-remove-item-behavior,代码行数:11,代码来源:SelectAfterRemoveBehavior.cs
示例13: NavMenuItemContainerContentChanging
/// <summary>
/// Enable accessibility on each nav menu item by setting the AutomationProperties.Name on each container
/// using the associated Label of each item.
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
private void NavMenuItemContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
if (!args.InRecycleQueue && args.Item != null && args.Item is NavMenuItem)
{
args.ItemContainer.SetValue(AutomationProperties.NameProperty, ((NavMenuItem)args.Item).Label);
}
else
{
args.ItemContainer.ClearValue(AutomationProperties.NameProperty);
}
}
示例14: SampleTreeView_ContainerContentChanging
private void SampleTreeView_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
var node = args.Item as TreeNode;
if (node != null)
{
var data = node.Data as FileSystemData;
if (data != null)
{
args.ItemContainer.AllowDrop = data.IsFolder;
}
}
}
示例15: Grid1_ContainerContentChanging
private void Grid1_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
if (!args.InRecycleQueue)
{
FrameworkElement ctr = (FrameworkElement)args.ItemContainer.ContentTemplateRoot;
if (ctr != null)
{
TextBlock t = (TextBlock)ctr.FindName("idx");
t.Text = args.ItemIndex.ToString();
}
}
}