示例#1
0
        /// <summary>
        /// Handle a button click from the wrap panel.
        /// </summary>
        /// <param name="sender">Event sender</param>
        /// <param name="e">Event arguments</param>
        private void ButtonClick(object sender, RoutedEventArgs e)
        {
            var            button         = (Button)e.OriginalSource;
            SampleDataItem sampleDataItem = button.DataContext as SampleDataItem;

            if (sampleDataItem != null && sampleDataItem.NavigationPage != null)
            {
                MyValue = sampleDataItem.ImageSource;
                int uniqueId = Int32.Parse(sampleDataItem.UniqueId);
                Console.WriteLine(Int32.Parse(sampleDataItem.UniqueId));
                PostureId = values[uniqueId - 1];

                this.Close();



                //this.Close();
                //      this.navigationRegion.
                //    backButton.Visibility = System.Windows.Visibility.Visible;
                //    navigationRegion.Content = Activator.CreateInstance(sampleDataItem.NavigationPage);
            }

            else
            {
                this.kinectRegion.InputPointerManager.CompleteGestures();

                e.Handled = true;
            }
        }
        private void btnMeteringOrSecureStop_Click(object sender, RoutedEventArgs e)
        {
            btnMeteringOrSecureStopButtonClicked = (Button)sender;
            MediaElement me = btnMeteringOrSecureStopButtonClicked.Name == "btnMeteringOrSecureStop1" ? myME : (btnMeteringOrSecureStopButtonClicked.Name == "btnMeteringOrSecureStop2" ? myME2 : myME3);

            SampleDataItem item = (SampleDataItem)btnMeteringOrSecureStopButtonClicked.DataContext;

            bMeteringOrSecureStopButtonClicked = true;
            PRUtilities prUtilities = new PRUtilities();

            if (item.MeteringCertFile != "null")
            {
                prUtilities.Test_ReportMeteringData(item.MeteringCertFile,
                                                    item.LaurlWithRights,
                                                    item.CustomData,
                                                    "null",
                                                    "null",
                                                    "1");
            }

            if (item.SecureStopCertFile != "null")
            {
                me.Stop();
                prUtilities.Test_ReportSecureStopData(item.SecureStopCertFile,
                                                      item.LaurlWithRights,
                                                      item.CustomData,
                                                      "null",
                                                      "null");
            }
        }
        /// <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="pageInfo">Information on the arguments and state passed to the page.</param>
        public async void Activate(PageInfo pageInfo)
        {
            // TODO: Create an appropriate data model for your problem domain to replace the sample data

            string itemId = pageInfo.GetArguments<string>();
            var item = await SampleDataSource.GetItemAsync(itemId);
            this.Item = item;
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (giv.IsFirst)
     {
         SampleDataItem sd = (SampleDataItem)(e.OriginalSource as Button).DataContext;
         giv.NavigateToMaster.Execute(sd.ItemId);
     }
 }
        // drag-and-drop to a new parent node
        protected void ASPxTreeList1_ProcessDragNode(object sender, TreeListNodeDragEventArgs e)
        {
            SampleDataItem child     = e.Node.DataItem as SampleDataItem;
            SampleDataItem newParent = e.NewParentNode.DataItem as SampleDataItem;

            child.Parent = newParent.Pk;
            e.Handled    = true;
        }
示例#6
0
        //újrajátszás
        private void Yes_Click(object sender, RoutedEventArgs e)
        {
            var navigationRegion = Window.GetWindow(this).FindName("navigationRegion") as ContentControl;

            SampleDataItem sampleDataItem = new SampleDataItem(typeof(Game));

            navigationRegion.Content = Activator.CreateInstance(sampleDataItem.NavigationPage);
        }
        private void detailLocGridClicked(object sender, ItemClickEventArgs e)
        {
            SampleDataItem clickedItem = e.ClickedItem as SampleDataItem;

            this.PID = (clickedItem.UniqueId);

            if (this.Frame != null)
            {
                this.Frame.Navigate(typeof(CreateNewVisit), PID);
            }
        }
示例#8
0
        public ActionResult TreeListNodeMove(int?key, int?parentKey)
        {
            if (key.HasValue && parentKey.HasValue)
            {
                SampleDataItem child     = dataHelper.Data.Find(i => i.Key == key);
                SampleDataItem newParent = dataHelper.Data.Find(i => i.Key == parentKey);
                child.ParentKey = newParent.Key;
            }

            return(PartialView("_TreeListPartial", dataHelper.Data));
        }
 public void NavigateToItemDetail(object sender, SampleDataItem item)
 {
     NavigationManager.NavigateTo("Item", item.UniqueId);
 }
示例#10
0
        /// <summary>
        /// Adds an item to the list when the app bar button is clicked.
        /// </summary>
        private void AddAppBarButton_Click(object sender, RoutedEventArgs e)
        {
            string groupName = this.pivot.SelectedIndex == 0 ? FirstGroupName : SecondGroupName;
            var group = this.DefaultViewModel[groupName] as SampleDataGroup;
            var nextItemId = group.Items.Count + 1;
            var newItem = new SampleDataItem(
                string.Format(CultureInfo.InvariantCulture, "Group-{0}-Item-{1}", this.pivot.SelectedIndex + 1, nextItemId),
                string.Format(CultureInfo.CurrentCulture, this.resourceLoader.GetString("NewItemTitle"), nextItemId),
                string.Empty,
                string.Empty,
                this.resourceLoader.GetString("NewItemDescription"),
                string.Empty);

            group.Items.Add(newItem);

            // Scroll the new item into view.
            var container = this.pivot.ContainerFromIndex(this.pivot.SelectedIndex) as ContentControl;
            var listView = container.ContentTemplateRoot as ListView;
            listView.ScrollIntoView(newItem, ScrollIntoViewAlignment.Leading);
        }
示例#11
0
 public SampleDataItem(SampleDataItem parent, string title, int quantity)
     : this(Guid.NewGuid(), parent.Pk, title, quantity)
 {
 }