本文整理汇总了C#中Windows.UI.Xaml.Navigation.NavigationEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# NavigationEventArgs类的具体用法?C# NavigationEventArgs怎么用?C# NavigationEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NavigationEventArgs类属于Windows.UI.Xaml.Navigation命名空间,在下文中一共展示了NavigationEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
if(e.Parameter != null)
{
//we got any parameter, insert it into the textfield
if (MainPage.position > -1)
{
//split string into [0,pos] and [pos+1,end]
// var firstpart = MainPage.code.Substring(0, MainPage.position);
//var secondpart = MainPage.code.Substring(MainPage.position, MainPage.code.Length - firstpart.Length);
//this.textBox.Document.SetText(Windows.UI.Text.TextSetOptions.ApplyRtfDocumentDefaults, firstpart + e.Parameter as string + secondpart);
this.textBox.Document.SetText(Windows.UI.Text.TextSetOptions.ApplyRtfDocumentDefaults, MainPage.code);
//this.textBox.Document.Selection.SetIndex(Windows.UI.Text.TextRangeUnit.Character, MainPage.position, false);
this.textBox.Document.Selection.SetRange(MainPage.position, MainPage.position);
this.textBox.Document.Selection.Text = e.Parameter as String + "\n";
}
else
{
this.textBox.Document.SetText(Windows.UI.Text.TextSetOptions.ApplyRtfDocumentDefaults, MainPage.code + e.Parameter as string + "\n");
}
}
}
示例2: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
history = new HistoriesViewModel();
histories = history.getHistory();
//listViewHistory.Items.Add(histories);
try
{
if (histories != null)
{
foreach (var hist in histories)
{
listViewHistory.Items.Add(hist.ID + " :Used :" + hist.USED_UNITS + " Remained " + hist.REMAINING_UNITS + " DATE: " + hist.DATE + "");
}
}
else
{
messageBox("No history in the database");
}
}
catch (Exception ex)
{
messageBox("error " + ex.Message);
}
base.OnNavigatedTo(e);
}
示例3: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
_dataTransferManager = DataTransferManager.GetForCurrentView();
_dataTransferManager.DataRequested += OnDataRequested;
base.OnNavigatedTo(e);
}
示例4: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
_args = e.Parameter as HistoryNavigationArgs;
if(_args == null)
ViewModelLocator.NavMgr.ResetMainBackNav();
base.OnNavigatedTo(e);
}
示例5: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
this.Items = new ObservableCollection<object>(PhotosDataSource.GetItems());
this.ItemTemplate = Resources["Hero"] as DataTemplate;
base.OnNavigatedTo(e);
}
示例6: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
Sqlite sqlData = new Sqlite();
var plan = (Plans)e.Parameter;
Days d;
//startDate.Text = "From " + plan.StartDate.Date.ToString("d", DateTimeFormatInfo.InvariantInfo) + " To " + plan.EndDate.Date.ToString("d", DateTimeFormatInfo.InvariantInfo);
startDate.Text = "From " + plan.StartDate.ToString("dd/MM/yyyy") + " To " + plan.EndDate.ToString("dd/MM/yyyy");
location.Text = "in " + plan.Location;
maxDay.Text = plan.MaxDay.ToString();
if (plan.MaxDay == 0)
{
addNewEvent.IsEnabled = false;
}
//DaysList = DayList.getDayList(plan.StartDate, plan.EndDate);
// Initialize date instance
var queryDay = from pd in sqlData.conn.Table<Days>()
where pd.PlanID_FK.Equals(plan.PlanID)
select pd;
// create date if there is no date
if (queryDay.Count<Days>() == 0)
{
for (int i = 1; i <= Convert.ToInt16(maxDay.Text); i++)
{
d = new Days(plan.PlanID, "No Activities on this day!", "Day " + i.ToString());
sqlData.conn.Insert(d);
}
}
DaysList = DayList.getDayList(plan);
}
示例7: OnNavigatedTo
protected override void OnNavigatedTo( NavigationEventArgs e )
{
base.OnNavigatedTo( e );
Logger.Log( ID, string.Format( "OnNavigatedTo: {0}", e.SourcePageType.Name ), LogType.INFO );
ViewFile( e.Parameter as StorageFile );
}
示例8: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
ScrollViewer.SetVerticalScrollMode(CategoryPageGridView, ScrollMode.Disabled);
CategoryPageViewModel categoryPageViewModel =
(CategoryPageViewModel)Resources["CategoryPageViewModel"];
NavigationItem navigationItem = e.Parameter as NavigationItem;
var task = Task.Factory.StartNew(async () =>
{
var bundle = await DownloadNavigationItem(navigationItem.ReferralId);
var navigationItems = await DownloadNavigationItemsAsync();
await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.High,
() =>
{
categoryPageViewModel.Content = bundle.Content[0];
var items = new List<Content>(bundle.Content);
items.RemoveAt(0);
bundle.Content = items.ToArray();
categoryPageViewModel.Bundle = bundle;
categoryPageViewModel.NavigationItems = navigationItems;
LoadingGrid.Visibility = Visibility.Collapsed;
MySplitView.Visibility = Visibility.Visible;
}
);
});
base.OnNavigatedTo(e);
}
示例9: OnNavigatedTo
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property is typically used to configure the page.</param>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
CompositionTarget.SurfaceContentsLost += CompositionTarget_SurfaceContentsLost;
DisplayInformation.GetForCurrentView().DpiChanged += OnDpiChanged;
rootPage.MainPageResized += rootPage_MainPageResized;
UpdateOutputLayout();
}
示例10: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
postInfo_list.ItemsSource = CommentList;
pid = (int)e.Parameter;
HttpRequestAsync(async () =>
{
string resourceAddress = postServer + pid;
string responseBody;
HttpResponseMessage response = await httpClient.GetAsync(new Uri(resourceAddress)).AsTask(cts.Token);
responseBody = await response.Content.ReadAsStringAsync().AsTask(cts.Token);
var serializer = new DataContractJsonSerializer(typeof(postInfo)); //将json字符串解析成class
var mStream = new MemoryStream(Encoding.Unicode.GetBytes(responseBody));
postinfo = (postInfo)serializer.ReadObject(mStream);
init_post(postinfo.post);
resourceAddress = commentServer + pid;
response = await httpClient.GetAsync(new Uri(resourceAddress)).AsTask(cts.Token);
responseBody = await response.Content.ReadAsStringAsync().AsTask(cts.Token);
serializer = new DataContractJsonSerializer(typeof(floorInfo)); //将json字符串解析成class
mStream = new MemoryStream(Encoding.Unicode.GetBytes(responseBody));
floors = (floorInfo)serializer.ReadObject(mStream);
init_comment(floors);
return responseBody;
});
}
示例11: OnNavigatedTo
/// <summary>
/// 在此页将要在 Frame 中显示时进行调用。
/// </summary>
/// <param name="e">描述如何访问此页的事件数据。
/// 此参数通常用于配置页。</param>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (e.Parameter != null)
{
GetContact(e.Parameter .ToString ());
}
}
示例12: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e) {
if (accounts == null) {
lvAccounts.Visibility = Visibility.Collapsed;
spLVHeader.Visibility = Visibility.Collapsed;
spCreateNewAccount.Visibility = Visibility.Visible;
}
}
示例13: OnNavigatedTo
/// <summary>
/// 在此页将要在 Frame 中显示时进行调用。
/// </summary>
/// <param name="e">描述如何访问此页的事件数据。
/// 此参数通常用于配置页。</param>
async protected override void OnNavigatedTo(NavigationEventArgs e)
{
EditAppbar.Visibility = Windows.UI.Xaml.Visibility.Visible;
AddAppbar.Visibility = Windows.UI.Xaml.Visibility.Visible;
FindAppbar.Visibility = Windows.UI.Xaml.Visibility.Visible;
DeleteAppbar.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
//if (e.Parameter != null)
//{
// cityname.city = e.Parameter.ToString();
// cityName.Add(cityname);
//}
//colCityName.ItemsSource = cityName;
Files.Items.Clear();
//创建文件夹
StorageFolder storage = await ApplicationData.Current.LocalFolder.CreateFolderAsync("CityList", CreationCollisionOption.OpenIfExists);
//获取当前文件夹中的文件
var files = await storage.GetFilesAsync();
//便利 每一个文件
foreach (StorageFile file in files)
{
XmlDocument doc=await XmlDocument.LoadFromFileAsync (file );
//cityname.city = doc.DocumentElement.Attributes.GetNamedItem ("city").NodeValue.ToString ();
cityname = new Citys();
cityname.city = file.DisplayName;
if (cityname.city == "City")
continue;
else
cityName.Add(cityname);
}
Files.ItemsSource = cityName;
}
示例14: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
var data = e.Parameter as string[];
uid = data[0];
rid = data[1];
LoadData();
}
示例15: OnNavigatedTo
protected override async void OnNavigatedTo(NavigationEventArgs navArgs)
{
Debug.WriteLine("MainPage::OnNavigatedTo");
byte adc = 0;
for (int i = 0; i < 50; i++)
{
int readVal = await mcp3008.ReadADC(adc);
// The raw voltage read
float voltage = readVal * SourceVoltage;
voltage /= MaxADCValue;
// Remove the TMP36 .5v offset
voltage -= VoltageOffset;
Debug.WriteLine("Read value: " + readVal.ToString());
var temperatureInC = voltage * 100;
var temperatureInF = temperatureInC * 9 / 5 + 32;
Debug.WriteLine(string.Format("V: {0} C: {1} F: {2}", voltage + VoltageOffset, temperatureInC, temperatureInF));
await Task.Delay(100);
}
}