private async void RefreshSoonItemPage_Click(object sender, RoutedEventArgs e) { var UpdatedInfo = await SampleDataSource.GetUpdatedItemAsync(); this.Image_SoonItem.Source = new BitmapImage(new Uri(UpdatedInfo.ImagePath)); this.Description_SoonItem.Text = UpdatedInfo.Description; this.Subtitle_SoonItem.Text = UpdatedInfo.Subtitle; this.Content_SoonItem.Text = UpdatedInfo.Content; }
private void AddToCartButton_Click(object sender, RoutedEventArgs e) { foreach (var item in itemGridView.SelectedItems) { var flower = item as SampleDataItem; SampleDataSource.AddToCart(new FlowerShop.Data.SampleCartItem(flower, 1, flower.Price)); } bottomAppBar.IsOpen = false; }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override async void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG // Show graphics profiling information while debugging. if (System.Diagnostics.Debugger.IsAttached) { // Display the current frame rate counters //this.DebugSettings.EnableFrameRateCounter = true; } #endif Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page rootFrame = new Frame(); //Associate the frame with a SuspensionManager key SuspensionManager.RegisterFrame(rootFrame, "AppFrame"); // Set the default language rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0]; rootFrame.NavigationFailed += OnNavigationFailed; if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { // Restore the saved session state only when appropriate try { await SuspensionManager.RestoreAsync(); } catch (SuspensionManagerException) { //Something went wrong restoring state. //Assume there is no state and continue } } //await SampleDataSource.LoadDataAsync(); SampleDataSource.LoadDataAsync(); // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter rootFrame.Navigate(typeof(GroupedItemsPage), e.Arguments); } // Ensure the current window is active Window.Current.Activate(); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var item = await SampleDataSource.GetItemAsync((String)e.NavigationParameter); this.DefaultViewModel["Item"] = item; LoadNumbers(); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="navigationParameter">The parameter value passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested. /// </param> /// <param name="pageState">A dictionary of state preserved by this page during an earlier /// session. This will be null the first time a page is visited.</param> protected override void LoadState(Object navigationParameter, Dictionary <String, Object> pageState) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var sampleDataGroups = SampleDataSource.GetGroups((String)navigationParameter); this.DefaultViewModel["Groups"] = sampleDataGroups; TealiumTagger.Instance.SetGlobalVariable("SampleGlobalVar2", "global-var-value"); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="navigationParameter">The parameter value passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested. /// </param> /// <param name="pageState">A dictionary of state preserved by this page during an earlier /// session. This will be null the first time a page is visited.</param> protected override void LoadState(Object navigationParameter, Dictionary <String, Object> pageState) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var sampleDataGroups = new SampleDataSource().ItemGroups; this.DefaultViewModel["Groups"] = sampleDataGroups; CreateLiveTile.ShowliveTile(true, "My Engagement Ceremony"); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data //var item = await SampleDataSource.GetItemAsync((string)e.NavigationParameter); var item = await SampleDataSource.GetRaceAsync(e.NavigationParameter.ToString()); this.DefaultViewModel["Race"] = item; this.DefaultViewModel["Results"] = item.RaceResultSet; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="navigationParameter">The parameter value passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested. /// </param> /// <param name="pageState">A dictionary of state preserved by this page during an earlier /// session. This will be null the first time a page is visited.</param> protected override void LoadState(Object navigationParameter, Dictionary <String, Object> pageState) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var sampleDataGroups = SampleDataSource.GetGroups((String)navigationParameter); this.DefaultViewModel["Groups"] = sampleDataGroups; EnableLiveTile.CreateLiveTile.ShowliveTile(true, "Gift Centre"); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var group = await SampleDataSource.GetItemAsync(e.NavigationParameter.ToString()); //var group = await SampleDataSource.GetItemAsync((string)e.NavigationParameter); this.DefaultViewModel["Group"] = group; //this.DefaultViewModel["Items"] = group.Items; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="navigationParameter">The parameter value passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested. /// </param> /// <param name="pageState">A dictionary of state preserved by this page during an earlier /// session. This will be null the first time a page is visited.</param> protected override void LoadState(Object navigationParameter, Dictionary <String, Object> pageState) { // TODO: Assign a bindable group to this.DefaultViewModel["Group"] // TODO: Assign a collection of bindable items to this.DefaultViewModel["Items"] var cart = SampleDataSource.GetCart(); this.DefaultViewModel["Group"] = cart; this.DefaultViewModel["Items"] = cart.Items; }
private void removeFromCart_Click(object sender, RoutedEventArgs e) { foreach (var item in itemGridView.SelectedItems) { var cartItem = item as SampleCartItem; SampleDataSource.RemoveFromCart(cartItem.Item); } bottomAppBar.IsOpen = false; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var item = await SampleDataSource.GetItemAsync((String)e.NavigationParameter); //this.DefaultViewModel["Item"] = item; ResultWebView.NavigateToString(await RssHelper.GetFeedTitleAsync()); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var group = await SampleDataSource.GetGroupAsync((string)e.NavigationParameter); DefaultViewModel["Group"] = group; DefaultViewModel["Items"] = group.Items; pageTitle.Text = group.Title; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var item = await SampleDataSource.GetItemAsync((string)e.NavigationParameter); this.DefaultViewModel["Item"] = item; this.SampleDataItem = item; //SampleDataItem.Content = "hello worlf"; }
/// <summary> /// Заполняет страницу содержимым, передаваемым в процессе навигации. Также предоставляется (при наличии) сохраненное состояние /// при повторном создании страницы из предыдущего сеанса. /// </summary> /// <param name="sender"> /// Источник события; как правило, <see cref="NavigationHelper"/>. /// </param> /// <param name="e">Данные события, предоставляющие параметр навигации, который передается /// <see cref="Frame.Navigate(Type, Object)"/> при первоначальном запросе этой страницы и /// словарь состояний, сохраненных этой страницей в ходе предыдущего /// сеанса. Состояние будет равно значению NULL при первом посещении страницы.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Создание соответствующей модели данных для области проблемы, чтобы заменить пример данных var sampleDataGroup = await SampleDataSource.GetGroupAsync("Group-1"); this.DefaultViewModel[FirstGroupName] = sampleDataGroup; //await Map.TrySetViewAsync(new Geopoint(new BasicGeoposition { Altitude = 0, Latitude = 55.75, Longitude = 37.62 }), 12); }
private void OnSearchedSamplesList() { SearchedSample = SampleDataSource.GetSearchedSample(NameandDosageText); currentSampleNo = SearchedSample[0].LotNum; currentSampleName = SearchedSample[0].NameandDosage; currentSampleCount = SearchedSample[0].Count; currentSampleExpDate = SearchedSample[0].ExpirationDate; DisplaySampleInformation(); isSampleSearched = false; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var sampleDataGroups = await SampleDataSource.GetGroupsAsync(); List <SampleDataGroup> groupsShown = new List <SampleDataGroup>(); groupsShown.Add(sampleDataGroups.First()); this.DefaultViewModel["Groups"] = groupsShown; }
/// <summary> /// Заполняет страницу содержимым, передаваемым в процессе навигации. Также предоставляется любое сохраненное состояние /// при повторном создании страницы из предыдущего сеанса. /// </summary> /// <param name="navigationParameter">Значение параметра, передаваемое /// <see cref="Frame.Navigate(Type, Object)"/> при первоначальном запросе этой страницы. /// </param> /// <param name="pageState">Словарь состояния, сохраненного данной страницей в ходе предыдущего /// сеанса. Это значение будет равно NULL при первом посещении страницы.</param> protected override void LoadState(Object navigationParameter, Dictionary <String, Object> pageState) { // TODO: Создание соответствующей модели данных для области проблемы, чтобы заменить пример данных var sampleDataGroups = SampleDataSource.GetGroups((String)navigationParameter); this.DefaultViewModel["Groups"] = sampleDataGroups; this.itemGridView.ItemsSource = sampleDataGroups.First().Items; this.itemListView.ItemsSource = sampleDataGroups.First().Items; }
static void Main(string[] args) { var ds = new SampleDataSource(); ds.InitializeDatabase(); ds.FillWithSampleData(); Console.WriteLine("Done populating the database"); Console.Read(); }
private async void RefreshItemPage_v2_Click(object sender, RoutedEventArgs e) { var UpdatedInfo = await SampleDataSource.GetUpdatedItemAsync(); this.Image_Item_v2.Source = new BitmapImage(new Uri(UpdatedInfo.ImagePath)); this.Description_Item_v2.Text = UpdatedInfo.Description; this.Subtitle_Item_v2.Text = UpdatedInfo.Subtitle; this.Content_Item_v2.Text = UpdatedInfo.Content; this.Schedule.Text = UpdatedInfo.ParkBulvarSchedule; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="navigationParameter">The parameter value passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested. /// </param> /// <param name="pageState">A dictionary of state preserved by this page during an earlier /// session. This will be null the first time a page is visited.</param> protected override void LoadState(Object navigationParameter, Dictionary <String, Object> pageState) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var group = SampleDataSource.GetGroup((String)navigationParameter); this.DefaultViewModel["Group"] = group; this.DefaultViewModel["Items"] = group.Items; //TealiumTagger.Instance.TrackScreenViewed("group-details", new Dictionary<string, string>() { { "group-id", group.UniqueId }, { "custom-1", "value-1" } }); }
private void listView_SelectionChanged(object sender, SelectionChangedEventArgs e) { // 選択されている項目を取得する SampleDataSource list = (SampleDataSource)listViewName.SelectedItem; // 選択項目を出力する String selectItem = String.Join(",", list.Title); textBlockName.Text = selectItem + "が選択されました"; }
//Обновление индикатора событий private void BadgeUpdaterForSecondaryTile() { string badgeXmlString = "<badge value='" + SampleDataSource.GroupUncheckedItemsCount() + "'/>"; Windows.Data.Xml.Dom.XmlDocument badgeDOM = new Windows.Data.Xml.Dom.XmlDocument(); badgeDOM.LoadXml(badgeXmlString); BadgeNotification badge = new BadgeNotification(badgeDOM); BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(SecondaryTileID).Update(badge); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="Common.NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var sampleDataGroups = await SampleDataSource.GetGroupsAsync(); this.DefaultViewModel["Groups"] = sampleDataGroups; // call this method each time the favourites page is loaded/navigated too readStuff(); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="navigationParameter">The parameter value passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested. /// </param> /// <param name="pageState">A dictionary of state preserved by this page during an earlier /// session. This will be null the first time a page is visited.</param> protected override void LoadState(Object navigationParameter, Dictionary <String, Object> pageState) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var group = SampleDataSource.GetGroup((String)navigationParameter); this.DefaultViewModel["Group"] = group; this.DefaultViewModel["Items"] = group.Items; CreateLiveTile.ShowliveTile(true, "Clean Energy"); }
private void setData(DotNetWikiBot.Page page) { SampleDataSource sampleDataSourceRoot = new SampleDataSource(); sampleDataSourceRoot.setDataSource(page); var sampleDataSource = SampleDataSource.GetGroup(page.pageId); this.itemsControl.ItemsSource = sampleDataSource; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { var drivers = await SampleDataSource.GetItemsAsync(); this.DefaultViewModel["Drivers"] = drivers; var races = await SampleDataSource.GetRacesAsync(); this.DefaultViewModel["Races"] = races; }
private async void geo_PositionChanged(Geolocator sender, PositionChangedEventArgs args) { currentGeoPosition = args.Position; double updateDistance = 0; var lat = currentGeoPosition.Coordinate.Point.Position.Latitude; var lng = currentGeoPosition.Coordinate.Point.Position.Longitude; if (Util.UserProfileData.StartPlace == null) { await cd.RunAsync(CoreDispatcherPriority.Normal, async() => { await SetLocationDetails(currentGeoPosition); }); } else { if (Util.UserProfileData.StartPlace.Latitude == -1 || Util.UserProfileData.StartPlace.Longitude == -1 || (Util.UserProfileData.StartPlace.Latitude == lat && Util.UserProfileData.StartPlace.Longitude == lng)) { updateDistance = 0; } else { updateDistance = CalculateDistance(Util.UserProfileData.StartPlace.Latitude, Util.UserProfileData.StartPlace.Longitude, lat, lng); } } if (updateDistance >= 200) //>=1km { await cd.RunAsync(CoreDispatcherPriority.Normal, async() => { if (string.Compare(Util.UserProfileData.CurrentPlace.CityLocation, Util.UserProfileData.StartPlace.CityLocation, StringComparison.OrdinalIgnoreCase) != 0) //User moved to different place { Util.UserProfileData.HasMoved = false; SampleDataSource.ClearGroups(); //this will trigger to load new data items, not from cache NavigationHelper.NavigateToPage(typeof(UserProfile)); await NotificationManager.HandleErrorMessageWithToaster("City or Region location has been changed, apps data has been reset", "City location has been changed"); } else { Util.UserProfileData.HasMoved = true; //call our service to get type/category details for this current lat, long position, if matched add to user visting places //restart timer, //calculate await time or duration stopWatch.Restart(); durationTimer.Stop(); durationTimer.Start(); } }); } }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="navigationParameter">The parameter value passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested. /// </param> /// <param name="pageState">A dictionary of state preserved by this page during an earlier /// session. This will be null the first time a page is visited.</param> protected override void LoadState(Object navigationParameter, Dictionary <String, Object> pageState) { // Allow saved page state to override the initial item to display if (pageState != null && pageState.ContainsKey("SelectedItem")) { navigationParameter = pageState["SelectedItem"]; } var item = SampleDataSource.GetItem((String)navigationParameter); this.flipView.SelectedItem = item; }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { // TODO: Create an appropriate data model for your problem domain to replace the sample data var users = await SampleDataSource.GetUsersAsync(); this.DefaultViewModel["Users"] = users; var sampleDataGroups = await SampleDataSource.GetGroupsAsync(); this.DefaultViewModel["Groups"] = sampleDataGroups; }
//SampleDataSource sds; public BlankPage1() { this.InitializeComponent(); //have we initialize the main source? SampleDataSource sds = new SampleDataSource(); for (int i = 1; i <= 3; i++) sds.AddGroup(i, 4); cvsMain.Source = sds.grps; }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used when the application is launched to open a specific file, to display /// search results, and so forth. /// </summary> /// <param name="args">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs args) { // TODO: Create a data model appropriate for your problem domain to replace the sample data var sampleData = new SampleDataSource(); if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: Load state from previously suspended application } // Create a Frame to act navigation context and navigate to the first page, // configuring the new page by passing required information as a navigation // parameter var rootFrame = new Frame(); // rootFrame.Navigate(typeof(GroupedItemsPage), sampleData.ItemGroups); rootFrame.Navigate(typeof(Dashboard)); // Place the frame in the current Window and ensure that it is active Window.Current.Content = rootFrame; Window.Current.Activate(); }