本文整理汇总了C#中PivotItem类的典型用法代码示例。如果您正苦于以下问题:C# PivotItem类的具体用法?C# PivotItem怎么用?C# PivotItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PivotItem类属于命名空间,在下文中一共展示了PivotItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnNavigatedTo
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
bool fileExists = await XmlFile.IsExists();
if (!fileExists)
{
await XmlFile.SaveAsync(XmlFile.Default);
}
ClearAppPivot();
_pillsXml = await XmlFile.Read();
List<string> periods = _pillsXml.Descendants("time").Select(x => x.Attribute("name").Value).ToList();
foreach (string period in periods)
{
PivotItem pivotItem = new PivotItem() { Header = period };
PillsListView pillListView = new PillsListView(DataHelper.GetPillsFromXML(_pillsXml, period));
pivotItem.Content = pillListView;
if (AppPivot.Items != null) AppPivot.Items.Add(pivotItem);
}
// Запускаем приложение с первого периода
if (e.NavigationMode == NavigationMode.New)
{
_activePivotHeader = periods.First();
}
if (_activePivotHeader != "")
{
AppPivot.SelectedItem = AppPivot.Items.FirstOrDefault(item =>
{
PivotItem pivotItem = item as PivotItem;
return (pivotItem != null && pivotItem.Header.ToString() == _activePivotHeader); // Выбираем PivotItem, у которого Header = _activePivotHeader
});
}
}
示例2: LearningPage
public LearningPage()
{
Animals animals = new Animals();
InitializeComponent();
for (int i = 0; i < animals.getSize(); i++)
{
PivotItem pivotItem = new PivotItem();
Image image = new Image();
image.Source = new BitmapImage(animals.getAnimalIndex(i).getAnimalImage());
pivotItem.Header = animals.getAnimalIndex(i).getAnimalName();
pivotItem.Content = image;
AnimalLearningPivot.Items.Add(pivotItem);
}
//on animal selection take them to a seperate scene with animal name, animal facts, and animal sounds.
//need to research animal facts and add them to xml files
//create image view with each animal in it
//add event when animal is clicked update thread
//
}
示例3: pvi_Tut_SelectionChanged
private void pvi_Tut_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
//TUT page
mySolidColorBrush.Color = Color.FromArgb(255, 46, 159, 255);
pivot = (PivotItem)(sender as Pivot).SelectedItem;
switch (pivot.Name.ToString())
{
case "pvi_Tut1":
el_Page1.Fill = mySolidColorBrush;
el_Page2.Fill = el_Page3.Fill = el_Page4.Fill = el_Page5.Fill = new SolidColorBrush(Colors.White);
break;
case "pvi_Tut2":
el_Page2.Fill = mySolidColorBrush;
el_Page1.Fill = el_Page3.Fill = el_Page4.Fill = el_Page5.Fill = new SolidColorBrush(Colors.White);
break;
case "pvi_Tut3":
el_Page3.Fill = mySolidColorBrush;
el_Page1.Fill = el_Page2.Fill = el_Page4.Fill = el_Page5.Fill = new SolidColorBrush(Colors.White);
break;
case "pvi_Tut4":
el_Page4.Fill = mySolidColorBrush;
el_Page1.Fill = el_Page2.Fill = el_Page3.Fill = el_Page5.Fill = new SolidColorBrush(Colors.White);
break;
case "pvi_Tut5":
el_Page5.Fill = mySolidColorBrush;
el_Page1.Fill = el_Page2.Fill = el_Page3.Fill = el_Page4.Fill = new SolidColorBrush(Colors.White);
break;
}
}
示例4: OnNavigatedTo
//When accessing page, refresh sprints and stories
protected override void OnNavigatedTo(NavigationEventArgs e)
{
//select sprints in selected project
string selectedProjectIdString = "";
if (NavigationContext.QueryString.TryGetValue("selectedProjectId", out selectedProjectIdString))
{
var selectedProjectSprints = from sprint in DataProvider.getSprints()
where sprint.projectId == int.Parse(selectedProjectIdString)
select sprint;
//make a panorama item for each sprint
foreach (Sprint sp in selectedProjectSprints)
{
PivotItem sprintView = new PivotItem() { Header = sp.name };
sprintView.Content = new Grid() { Margin = new Thickness(12, 0, 12, 0) };
App.ViewModel.LoadSprint(sp);
//create listBox
ListBox sprintList = new ListBox() { Margin = new Thickness(0, 0, -12, 0), ItemsSource = App.ViewModel.Sprints[sp.id] };
sprintList.SelectionChanged += new SelectionChangedEventHandler(tasksList_SelectionChanged);
sprintList.ItemTemplate = (DataTemplate)Resources["SprintsListBoxDataTemplate"];
((Grid)sprintView.Content).Children.Add(sprintList);
SprintsPivot.Items.Add(sprintView);
}
}
}
示例5: CategoryDetailPage
public CategoryDetailPage()
{
InitializeComponent();
var textblock = new TextBlock { Text = "header 1", FontSize = 36 };
var pivotItem = new PivotItem() { Header = textblock };
var grid = new Grid();
var listBox = new ListBox()
{
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Stretch,
Margin = new Thickness(0)
};
for (int i = 0; i < 10; i++)
{
var newsTitle = new NewsTitleControl();
listBox.Items.Add(newsTitle);
}
grid.Children.Add(listBox);
pivotItem.Content = grid;
PivotContainer.Items.Add(pivotItem);
var textblock2 = new TextBlock { Text = "header 2", FontSize = 36 };
var pivotItem2 = new PivotItem() { Header = textblock2 };
PivotContainer.Items.Add(pivotItem2);
}
示例6: TestBrokenRelatedLinks
public void TestBrokenRelatedLinks()
{
PivotCollection collection = new PivotCollection();
collection.FacetCategories.Add(new PivotFacetCategory("alpha", PivotFacetType.String));
PivotItem item = new PivotItem("0", collection);
item.AddFacetValues("alpha", "alpha");
item.AddRelatedLink(new PivotLink(null, "http://pauthor.codeplex.com"));
collection.Items.Add(item);
item = new PivotItem("1", collection);
item.AddFacetValues("alpha", "bravo");
item.AddRelatedLink(new PivotLink("charlie", null));
collection.Items.Add(item);
PivotCollectionBuffer buffer = new PivotCollectionBuffer(collection);
String targetPath = Path.Combine(WorkingDirectory, "sample.cxml");
LocalCxmlCollectionTarget target = new LocalCxmlCollectionTarget(targetPath);
target.Write(buffer);
AssertCxmlSchemaValid(targetPath);
CxmlCollectionSource targetAsSource = new CxmlCollectionSource(targetPath);
buffer.Write(targetAsSource);
AssertEqual("Related Link", buffer.Collection.Items[0].RelatedLinks.First().Title);
AssertEqual("http://pauthor.codeplex.com", buffer.Collection.Items[0].RelatedLinks.First().Url);
AssertEqual(0, buffer.Collection.Items[1].RelatedLinks.Count());
}
示例7: LoadData
public async Task LoadData()
{
SpreekwoordInstance = await SpreekwoordenWrapper.GetInstance();
MyItemsPivotItem = MyItems;
if (SpreekwoordInstance.MyItems.Count == 0)
{
SpreekwoordenPivot.Items.Remove(MyItems);
}
this.DataContext = SpreekwoordInstance;
LoadingControl.SetLoadingStatus(false);
LoadingControl.DisplayLoadingError(false);
LoadingControl.SetLoadingStatus(true);
await SpreekwoordInstance.GetRandomWoorden();
LoadingControl.SetLoadingStatus(false);
if (SpreekwoordInstance.ChangeLockscreen)
{
//NotificationHandler.Run("SpreekwoordenBackgroundTaskW.BackgroundTask", "ImageService", (uint)SpreekwoordInstance.IntervalArray[SpreekwoordInstance.SelectedInterval]);
}
int ID = await Task.Run(() => Datahandler.GetRandomSpreekwoordAndSaveImageToFile());
//await LockScreen.SetImageFileAsync(await ApplicationData.Current.LocalFolder.GetFileAsync("Tegeltje" + ID + ".jpg"));
}
示例8: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
// Set the page DataContext property to the ViewModel.
this.DataContext = App.ViewModel;
Pi = new ProgressIndicator();
Pi.IsIndeterminate = true;
Pi.IsVisible = false;
allPivotItem = new PivotItem();
allPivotItem.Header = new ToDoCategory { Name = "All", IconPath = "/Sticky-Notes-icon.png" };
ListBox listbox = new ListBox();
listbox.Margin = new Thickness(12, 0, 12, 0);
listbox.Width = 440;
listbox.ItemTemplate = ToDoListBoxItemTemplate;
listbox.Tap += Parent_Tap;
allPivotItem.Content = listbox;
searchResult = new PivotItem();
searchResult.Header = new ToDoCategory { Name = "Search result", IconPath = "/Images/CategoryIcons/SearchResult.png" };
ListBox lstbox = new ListBox();
lstbox.Margin = new Thickness(12, 0, 12, 0);
lstbox.Width = 440;
lstbox.ItemTemplate = ToDoListBoxItemTemplate;
lstbox.Tap += Parent_Tap;
searchResult.Content = lstbox;
App.ViewModel.OnDataBaseChange += ViewModel_onDataBaseChanged;
App.ViewModel.ReLoadData();
//TestData();
}
示例9: registerPivot
public void registerPivot()
{
Controller.Pages nav = Noxus.Instance().getController("Pages");
PivotItem new_pivot_item = new PivotItem();
new_pivot_item.Header = _title;
new_pivot_item.Content = this;
nav.addPage(_title, new_pivot_item);
}
示例10: LoadPivotItems
private void LoadPivotItems()
{
this.MainPivot.Items.Clear();
/*
var tablesPage = new TablesPage();
var tablesPivot = new PivotItem();
tablesPivot.Header = "tables list";
tablesPivot.Name = "TablesList";
tablesPivot.Content = tablesPage;
tablesPage.ViewModel = this.ViewModel.TablesPageViewModel;
this.MainPivot.Items.Add(tablesPivot);
*/
var sampleDataTablesPage = new SampleDataTablePage();
var sampleDataTablesPivot = new PivotItem();
sampleDataTablesPivot.Header = "Все Акции";
sampleDataTablesPivot.Name = "SampleDataRows";
sampleDataTablesPivot.Content = sampleDataTablesPage;
sampleDataTablesPage.ViewModel = this.ViewModel.SampleDataTablePageViewModel;
sampleDataTablesPage.Navigate += this.OnNavigatePage;
this.MainPivot.Items.Add(sampleDataTablesPivot);
var listBlobsPage = new ListBlobsPage();
var listBlobsPivot = new PivotItem();
listBlobsPivot.Header = "about us";
listBlobsPivot.Name = "ListBlobs";
listBlobsPivot.Content = listBlobsPage;
listBlobsPage.ViewModel = this.ViewModel.ListBlobsPageViewModel;
//listBlobsPage.TakePhoto += this.OnLaunchCamera;
this.MainPivot.Items.Add(listBlobsPivot);
var notificationsPage = new NotificationsPage();
var notificationsPivot = new PivotItem();
notificationsPivot.Header = "Оповещения";
notificationsPivot.Name = "PushNotifications";
notificationsPivot.Content = notificationsPage;
notificationsPage.ViewModel = this.ViewModel.NotificationsViewModel;
notificationsPage.BeginPushConnection += this.OnBeginPushConnection;
notificationsPage.EndPushConnection += this.OnEndPushConnection;
this.MainPivot.Items.Add(notificationsPivot);
/*
var listQueuesPage = new ListQueuesPage();
var listQueuesPivot = new PivotItem();
listQueuesPivot.Header = "queues";
listQueuesPivot.Name = "ListQueuesPage";
listQueuesPivot.Content = listQueuesPage;
listQueuesPage.ViewModel = this.ViewModel.ListQueuesPageViewModel;
listQueuesPage.Navigate += this.OnNavigatePage;
this.MainPivot.Items.Add(listQueuesPivot);
*/
this.MainPivot.SelectedItem = sampleDataTablesPivot;
}
示例11: UnHidePivotItem
public void UnHidePivotItem(PivotItem item)
{
if (item == null || false == headers.ContainsKey(item) || false == hiddenItems.Contains(item))
return;
item.Header = headers[item];
headers.Remove(item);
hiddenItems.Remove(item);
}
示例12: button_Click
private void button_Click(object sender, RoutedEventArgs e)
{
PivotItem pi = new PivotItem();
Rectangle r = new Rectangle();
r.Fill = new SolidColorBrush(Colors.Turquoise);
r.Margin = new Thickness(0, 0, 0, 0);
pi.Content = r;
BleepBloop.Items.Add(pi);
}
示例13: AddPivotItem
private void AddPivotItem(string header, object content)
{
// create the item
var item = new PivotItem();
// set properties and add
item.Style = (Style)Resources["AboutPivotItemStyle"];
item.Header = header;
item.Content = content;
PivotControl.Items.Add(item);
}
示例14: OnLoadingPivotItem
protected override async void OnLoadingPivotItem(PivotItem item)
{
//since this is going to take a non trivial amount of time we need to prevent
//any future loads from conflicting with what we're doing
//by taking an always increasing id we can check aginst it prior to continuing
//and implement a sort of cancel.
//this has the added side effect of making super rapid transitions of the pivot nearly free
//since no one pivot will be the current one for more then a few hundred milliseconds
using (_suspendableWorkQueue.HighValueOperationToken)
{
var loadIdAtStart = ++inflightLoadId;
inflightLoad = item;
base.OnLoadingPivotItem(item);
_viewModelContextService.PushViewModelContext(item.DataContext as ViewModelBase);
if (item.Content is RedditView)
{
return;
}
var imageControl = item.Content as Image;
if (imageControl != null)
await Task.Delay(400);
if (loadIdAtStart != inflightLoadId)
return;
var madeControl = MapViewModel(item.DataContext as ViewModelBase);
if (imageControl != null)
await Task.Yield();
if (loadIdAtStart != inflightLoadId)
return;
madeControl.DataContext = item.DataContext as ViewModelBase;
if (imageControl != null)
await Task.Yield();
if (loadIdAtStart != inflightLoadId)
return;
if (imageControl != null)
imageControl.Source = null;
item.Content = madeControl;
madeControl.LoadWithScroll();
}
}
示例15: CreatePivotItem
private PivotItem CreatePivotItem(string header, string name)
{
PivotItem Item = new PivotItem();
Item.Header = header;
Item.Foreground = Application.Current.Resources["PageNameColor"] as System.Windows.Media.Brush;
CoursePivotItem CoursesItem = new CoursePivotItem();
CoursesItem.Name = name;
CoursesItem.setBinding(CoursesItem.Name);
Item.Content = CoursesItem;
return Item;
}