本文整理汇总了C#中ContainerContentChangingEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ContainerContentChangingEventArgs类的具体用法?C# ContainerContentChangingEventArgs怎么用?C# ContainerContentChangingEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContainerContentChangingEventArgs类属于命名空间,在下文中一共展示了ContainerContentChangingEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:kiwidev,项目名称:renderlib,代码行数:31,代码来源:Render.cs
示例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;
}
开发者ID:hippiehunter,项目名称:Baconography,代码行数:25,代码来源:CommentView.xaml.cs
示例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;
}
}
}
}
开发者ID:jj09,项目名称:ShoppingPad,代码行数:33,代码来源:EdgeTappedListView.cs
示例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;
}
开发者ID:prashanthganathe,项目名称:PersonalProjects,代码行数:29,代码来源:UserList.xaml.cs
示例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;
}
开发者ID:mbin,项目名称:Win81App,代码行数:40,代码来源:Scenario2.xaml.cs
示例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;
}
开发者ID:hoovejo,项目名称:ClutchWinBaseball.Win,代码行数:41,代码来源:TeamsDrillDown.xaml.cs
示例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);
}
开发者ID:chenjianwp,项目名称:WindowsUIDevLabs,代码行数:8,代码来源:ZoomWithPerspective.xaml.cs
示例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;
}
开发者ID:ali-hk,项目名称:Toolkit,代码行数:8,代码来源:IncrementalLoadingSamplePage.xaml.cs
示例9: OnContainerContentChanging
private void OnContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
var visual = ElementCompositionPreview.GetElementVisual(args.ItemContainer);
visual.ImplicitAnimations = args.InRecycleQueue
? null
: animations;
}
开发者ID:nigel-sampson,项目名称:talks,代码行数:8,代码来源:ImplicitAnimationsView.xaml.cs
示例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);
}
}
开发者ID:hippiehunter,项目名称:Baconography,代码行数:9,代码来源:Conversation.xaml.cs
示例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);
}
}
开发者ID:kiwidev,项目名称:renderlib,代码行数:11,代码来源:Render.cs
示例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);
}
}
开发者ID:MvvmCross,项目名称:MvvmCross-Samples,代码行数:17,代码来源:MenuView.xaml.cs
示例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;
}
}
}
开发者ID:huoxudong125,项目名称:Windows-universal-samples,代码行数:12,代码来源:MainPage.xaml.cs
示例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();
}
}
}
开发者ID:C-C-D-I,项目名称:Windows-universal-samples,代码行数:12,代码来源:Scenario2.xaml.cs
示例16: gridView_ContainerContentChanging
private void gridView_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
var elementVisual = ElementCompositionPreview.GetElementVisual(args.ItemContainer);
if (args.InRecycleQueue)
{
elementVisual.ImplicitAnimations = null;
}
else
{
//Add implicit animation to each visual
elementVisual.ImplicitAnimations = _elementImplicitAnimation;
}
}
开发者ID:chenjianwp,项目名称:WindowsUIDevLabs,代码行数:13,代码来源:Photos.xaml.cs
示例17: ApplyPhaseOne
private void ApplyPhaseOne(ContainerContentChangingEventArgs args)
{
var templateRoot = args.ItemContainer.ContentTemplateRoot as StackPanel;
var hockeyPlayerVM = args.Item as HockeyPlayerViewModel;
var numberTextBlock = templateRoot.Children[1] as TextBlock;
numberTextBlock.Text = hockeyPlayerVM.Number.ToString();
numberTextBlock.Opacity = 1;
var goalsTextBlock = templateRoot.Children[4] as TextBlock;
goalsTextBlock.Text = hockeyPlayerVM.Goals.ToString();
goalsTextBlock.Opacity = 1;
}
开发者ID:ali-hk,项目名称:Toolkit,代码行数:13,代码来源:IncrementalLoadingSamplePage.xaml.cs
示例18: PhaseLoad
internal void PhaseLoad(ListViewBase sender, ContainerContentChangingEventArgs args)
{
if (!args.InRecycleQueue)
{
switch (args.Phase)
{
case 0:
{
plainTextControl.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
markdownControl.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
markdownControl.Markdown = null;
args.Handled = true;
args.RegisterUpdateCallback(PhaseLoad);
break;
}
case 1:
{
plainTextControl.Visibility = Windows.UI.Xaml.Visibility.Visible;
if (args.Item is MessageActivityViewModel)
plainTextControl.Text = ((MessageActivityViewModel)args.Item).Body;
args.Handled = true;
args.RegisterUpdateCallback(PhaseLoad);
break;
}
case 2:
{
if (args.Item is MessageActivityViewModel)
{
var body = ((MessageActivityViewModel)args.Item).Body;
args.Handled = true;
var markdownBody = SnooStreamViewModel.MarkdownProcessor.Process(body);
if (!SnooStreamViewModel.MarkdownProcessor.IsPlainText(markdownBody))
{
plainTextControl.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
plainTextControl.Text = "";
markdownControl.Visibility = Windows.UI.Xaml.Visibility.Visible;
markdownControl.Markdown = markdownBody.MarkdownDom as SnooDom.SnooDom;
}
}
break;
}
}
}
else
{
}
}
开发者ID:hippiehunter,项目名称:Baconography,代码行数:50,代码来源:MessageControl.xaml.cs
示例19: Phase1Load
internal bool Phase1Load(ListViewBase sender, ContainerContentChangingEventArgs args)
{
if (!args.InRecycleQueue)
{
if (args.Item is CommentViewModel)
{
contentControl.MinHeight = 0;
contentControl.ContentTemplate = Resources["textTemplate"] as DataTemplate;
contentControl.Content = ((CommentViewModel)args.Item).Body;
args.Handled = true;
LoadPhase = 2;
return true;
}
else
throw new NotImplementedException();
}
return false;
}
开发者ID:hippiehunter,项目名称:Baconography,代码行数:18,代码来源:CommentView.xaml.cs
示例20: OnContainerContentChanging
private void OnContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
{
switch (args.Phase)
{
case 0:
args.RegisterUpdateCallback(OnContainerContentChanging);
break;
case 1:
ApplyPhaseOne(args);
args.RegisterUpdateCallback(OnContainerContentChanging);
break;
case 2:
ApplyPhaseTwo(args);
break;
default:
break;
}
// Set args.Handled = true if using x:Bind to skip apply DataContext
args.Handled = true;
}
开发者ID:ali-hk,项目名称:Toolkit,代码行数:21,代码来源:IncrementalLoadingSamplePage.xaml.cs
注:本文中的ContainerContentChangingEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论