Example #1
0
        private void button_Click2(object sender, RoutedEventArgs e) //triangle
        {
            myFrame.Visibility = System.Windows.Visibility.Visible;
            Page2 p2 = new Page2();

            myFrame.NavigationService.Navigate(p2);
        }
Example #2
0
        public void Test2()
        {
            driver.Navigate().GoToUrl("https://the-internet.herokuapp.com/checkboxes");
            //IMyElement ez = new MyElement()
            Page2  page2 = new Page2(driver);
            string txt   = page2.FindSmth.Other.Text;

            Console.WriteLine(txt);
            page2.FindSmth.UnCheck();



            //driver.GetElement<IMyCheckBox>(By.XPath(".//*[@id='checkboxes']/input[2]")).UnCheck();
            //Thread.Sleep(3000);
            //driver.Navigate().GoToUrl("http://google.com");
            //driver.GetElement(By.Name("q")).SendKeys("terminator2");
            ////var test = driver.GetElement<IMyButton>(By.Name("btnK"), "testsd");
            ////test.Click();
            //driver.GetElement<IMyButton>(By.ClassName("lsb")).Click();
            //driver.GetElement(By.XPath("//a[contains(.,'Terminator 2: Judgment Day (1991) - IMDb')]")).Click();
            //driver.GetElement(By.XPath("//input[@name='q']")).SendKeys("terminator");
            //driver.GetElement(By.XPath("//button[@class='primary btn']")).Click();
            //driver.GetElement(By.XPath("//a[contains(.,'The Terminator')]")).Click();
            //driver.GetElement(By.XPath("//span[contains(.,'James Cameron')]")).Click();

            //driver.GetElement(By.Id("home_img")).Click();
            //driver.GetElement(By.Id("home_img")).Click();
            //driver.GetElement(By.Name("q")).SendKeys("terminator2");
            //driver.GetElement(By.Id("navbar-submit-button")).Click();
        }
Example #3
0
        public void OpenWindow(object objet)
        {
            Window fenetre = new Page2();

            fenetre.Show();
            fenetre.DataContext = this;
        }
Example #4
0
        private void Back_Arrow_Button_Click(object sender, EventArgs e)
        {
            Page2 pag2 = new Page2();

            pag2.Show();
            this.Hide();
        }
        /// <summary>
        /// Sets up the user interface.
        /// </summary>
        private void SetupUI()
        {
            RecursiveControlSetup(pnlmain);
            switch (page)
            {
            case 0:
                lbtitle.Text        = "Welcome!";
                lbldescription.Text = "This wizard will guide you through the creation of an Appscape Package which will be uploaded to Appscape for all to see. First, let's start with some basics.";
                Page0.BringToFront();
                btndone.Hide();
                btnback.Hide();
                break;

            case 1:
                lbtitle.Text        = "Packaged Files";
                lbldescription.Text = "Now that we have a name and description, it's time to get some files into your package. Namely, an icon and the app itself.";
                btnback.Show();
                Page1.BringToFront();
                break;

            case 2:
                lbtitle.Text        = "Ready!";
                lbldescription.Text = "That's all we need from you. Assuming everything is correct, as soon as you click 'Done!', the package will be generated and uploaded to Appscape quicker than you can say \"Appscape Package Manager is so freakin' awesome.\".";
                btnnext.Hide();
                btndone.Show();
                Page2.BringToFront();
                txtconfirm.Font = new Font(OSInfo.GetMonospaceFont(), 9);
                ConfirmPKG();
                break;
            }
        }
Example #6
0
        }// Page1


        protected override int WizSetActive(IntPtr hwnd)
        {
            // Find out which property page this is....
            switch (GetPropPage(hwnd))
            {
            // If this is the first page of our wizard, we want a
            // disabled next button to show
            case 0:
                if (Page1.Filename == null || Page1.Filename.Length == 0)
                {
                    TurnOnNext(false);
                }
                else
                {
                    TurnOnNext(true);
                }
                break;

            case 1:
                Page2.PutValuesinPage();
                TurnOnFinish(true);
                break;

            case 2:
                Page3.PutValuesinPage();
                TurnOnFinish(true);
                break;
            }
            return(base.WizSetActive(hwnd));
        }// WizSetActive
 private void EnterPage2()
 {
     Page2.Enter();
     GotItButton.gameObject.SetActive(false);
     EmployeesButton.interactable = true;
     SaveGameSystem.Instance.SetTutorialLevel(2);
 }
Example #8
0
    async void button1_Clicked(object sender, System.EventArgs e)
    {
        var page2 = new Page2();

        page2.PlayerSet += this.OnPlayerSet;
        await Navigation.PushAsync(page2);
    }
 public static void Init(JernejK.NextionNET.Driver.NextionDisplay display)
 {
     Page0.Init(display);
     Page1.Init(display);
     Page2.Init(display);
     Page3.Init(display);
 }
Example #10
0
    public static async Task <Page2> Create()
    {
        var page = new Page2();
        await page.getWritings();

        return(page);
    }
Example #11
0
 private void Awake()
 {
     rewardsHandler = GetComponent <RewardsHandler>();
     page2Handler   = GetComponent <Page2>();
     page3Handler   = GetComponent <Page3>();
     LoadAchievementDataToList();
     EnableRewardButtonsAndBadges();
 }
Example #12
0
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            if (page2 == null)
            {
                page2 = new Page2();
            }

            frame.Content = page2;
        }
Example #13
0
 public Page2ViewModel(Page2 page2)
 {
     this.User = new User()
     {
         Login = "******", Password = "******"
     };
     this.page2              = page2;
     this.page2.Btn.Clicked += Btn_Clicked;
 }
        public void OnTapped(Object o)

        {
            var nextPage = new Page2();

            nextPage.BindingContext = o;

            Navigation.PushAsync(nextPage);
        }
Example #15
0
        private void Page2_Click(object sender, EventArgs e)
        {
            Page2 page2 = new Page2()
            {
                Dock = DockStyle.Top
            };

            PagePanel.Controls.Clear();
            PagePanel.Controls.Add(page2);
        }
    // Sample code for building a localized ApplicationBar
    //private void BuildLocalizedApplicationBar()
    //{
    //    // Set the page's ApplicationBar to a new instance of ApplicationBar.
    //    ApplicationBar = new ApplicationBar();
    //    // Create a new button and set the text value to the localized string from AppResources.
    //    ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));
    //    appBarButton.Text = AppResources.AppBarButtonText;
    //    ApplicationBar.Buttons.Add(appBarButton);
    //    // Create a new menu item with the localized string from AppResources.
    //    ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
    //    ApplicationBar.MenuItems.Add(appBarMenuItem);
    //}
    protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
    {
        Page2 destinationpage = e.Content as Page2;

        if (destinationpage != null)
        {
            // Change property of destination page
            destinationpage.GetProduct = selectedItemData;
        }
    }
Example #17
0
        private void BtnNext_Click(object sender, EventArgs e)
        {
            BackLink.Visible = true;
            if (page == 1 && PanelContainer.Controls.ContainsKey("Page2"))
            {
                PanelContainer.Controls["Page2"].BringToFront();
                page = 2;
            }
            else if (page == 2 && PanelContainer.Controls.ContainsKey("Page3"))
            {
                // Set detect location settings
                Properties.Settings.Default.DetectLocation = Page2.DetectLocation;
                Properties.Settings.Default.Save();

                PanelContainer.Controls["Page3"].BringToFront();
                BtnNext.Enabled = false;
                page            = 3;
            }
            else if (page == 1 && PanelContainer.Controls.ContainsKey("Page2") == false)
            {
                Page2 page2 = new Page2();
                page2.Dock = DockStyle.Fill;
                PanelContainer.Controls.Add(page2);
                PanelContainer.Controls["Page2"].BringToFront();
                page = 2;
            }
            else if (page == 2 && PanelContainer.Controls.ContainsKey("Page3") == false)
            {
                Page3 page3 = new Page3();
                page3.Dock = DockStyle.Fill;

                // Set detect location settings
                Properties.Settings.Default.DetectLocation = Page2.DetectLocation;
                Properties.Settings.Default.Save();

                if (Page2.DetectLocation == false && Page2.CityName == null)
                {
                    MessageBox.Show("Error : Nama kota belum diisi", "An error occurred", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    PanelContainer.Controls.Add(page3);
                    PanelContainer.Controls["Page3"].BringToFront();
                    BtnNext.Enabled = false;
                    page            = 3;
                }
            }
            else if (page == 3)
            {
                Properties.Settings.Default.FirstLaunch = false;
                Main main = new Main();
                main.Show();
                Hide();
            }
        }
Example #18
0
 public void Simulate()
 {
     InitializeMonitoration();
     for (int i = 0; i < Input.Length; i++)
     {
         ChooseSpot(i, Input[i]).AddValue(Input[i]);
     }
     Page1.WriteHistory();
     Page2.WriteHistory();
     Page3.WriteHistory();
 }
Example #19
0
    // shows the relevant widget/page on screen
    private void showPage(int iPage)
    {
        Widget newPage = null;

        if (iPage == 0)
        {
            Page0 pp = new Page0();
            newPage            = pp;
            pp.parentGtkWindow = this;
        }
        if (iPage == 1)
        {
            newPage = new Page1();
        }
        if (iPage == 2)
        {
            newPage = new Page2();
        }
        if (iPage == 3)
        {
            Page3 pp = new Page3();
            newPage            = pp;
            pp.parentGtkWindow = this;
        }
        if (iPage == 4)
        {
            newPage = new Page4();
        }
        if (iPage == 5)
        {
            Page5 pp = new Page5();
            newPage            = pp;
            pp.parentGtkWindow = this;
        }

        if (newPage != null)
        {
            //widgetSpace.Destroy ();
            if (currentPage != null)
            {
                eventBox.Remove(currentPage);
                currentPage.Destroy();
            }

            eventBox.Add(newPage);
            newPage.Show();

            labelPage.Text = "Page " + iPage + "/5";

            currentPage   = newPage;
            i_CurrentPage = iPage;
        }
    }
Example #20
0
 private void BtnCreate_Click(object sender, RoutedEventArgs e)
 {
     ShowHide();
     isCreate = true;
     selectedUID = -1;
     Page2 p2 = new Page2(selectedUID);
     FrmContent.Navigate(p2);
     Btnp2.Visibility = Visibility.Visible;
     Btnp2.Background = System.Windows.Media.Brushes.Green;
     LblPersonalInformation.Visibility = Visibility.Hidden;
     Btnp2.Content = "Save";
 }
Example #21
0
        public void Simulate()
        {
            InitializeMonitoration();
            foreach (var character in Input)
            {
                ChooseSpot(character).AddValue(character);
            }

            Page1.WriteHistory();
            Page2.WriteHistory();
            Page3.WriteHistory();
        }
Example #22
0
 private void Verify()
 {
     Page1.SetActive(false);
     if (EmptyConstructor.isOn && !FilledConstructor.isOn)
     {
         Page2.SetActive(true);
     }
     else
     {
         Page3.SetActive(true);
     }
 }
Example #23
0
 protected override void OnAppearing()
 {
     MessagingCenter.Subscribe <Class1.OpenMyPageMessage>(this, Class1.OpenMyPageMessage.Key, (sender) =>
     {
         Detail = new Page1 {
             Padding = Device.OnPlatform(50, 100, 100)
         };
     });
     MessagingCenter.Subscribe <Class1.OpenPage2>(this, Class1.OpenPage2.Key, (sender) =>
     {
         Detail = new Page2();
     });
 }
Example #24
0
        private void OpenPage(string Name)
        {
            switch (Name)
            {
            case "客户下单":  Page = new Page1();
                break;

            case "订单汇总": Page = new Page2();
                break;

            case "工厂接单": Page = new Page3();
                break;
            }
        }
Example #25
0
        public void GetDataTest()
        {
            Page2 page2 = new Page2();

            string[][] data     = page2.GetData();
            string[][] expected =
            {
                new string[] { "John", "Doe", "25"  },
                new string[] { "Jane", "Doe", "50"  },
                new string[] { "Jim",  "Doe", "75"  },
                new string[] { "Joy",  "Doe", "100" },
            };
            Assert.AreEqual(data.ToString(), expected.ToString());
        }
Example #26
0
        private void BtnPage2_Click(object sender, RoutedEventArgs e)
        {
            // Find the frame.
            Frame pageFrame = null;
            DependencyObject currParent = VisualTreeHelper.GetParent(this);
            while (currParent != null && pageFrame == null)
            {
                pageFrame = currParent as Frame;
                currParent = VisualTreeHelper.GetParent(currParent);
            }

            // Change the page of the frame.
            if (pageFrame != null)
            {
                Page2 p2 = new Page2(uid);
                pageFrame.Navigate(p2);
                //pageFrame.Source = new Uri("Page2.xaml", UriKind.Relative);
            }
        }
        public MainPage()
        {
            Title = "Xamarin Forms pages test";

            var page1Button = new Button { Text = "push page 1" };

            page1Button.Clicked += (sender, e) =>
            {
                var page1 = new Page1();
                this.Navigation.PushAsync(page1);
            };

            var page2Button = new Button { Text = "push page 2" };

            page2Button.Clicked += (sender, e) =>
            {
                var page2 = new Page2();
                this.Navigation.PushAsync(page2);
            };

            var gcButton = new Button { Text = "GC Collect" };

            gcButton.Clicked += (sender, e) =>
            {
                System.Diagnostics.Debug.WriteLine("Running GC.Collect()");
                GC.Collect();
            };

            var stackLayout = new StackLayout()
            {
                Padding = 20,
                Spacing = 40,
                Children =
                {
                    page1Button,
                    page2Button,
                    gcButton
                }
            };

            Content = stackLayout;
        }
Example #28
0
        private void OpenPage(string name)
        {
            //
            this.TestName = name;

            //页面导航(切换)
            switch (name)
            {
            case "功能1":
                Page = new Page1();
                break;

            case "功能2":
                Page = new Page2();
                break;

            case "功能3":
                Page = new Page3();
                break;
            }
        }
Example #29
0
        public void OpenPage(string name)
        {
            Name = name;
            switch (name)
            {
            case "Module1":
                Page = new Page1();
                break;

            case "Module2":
                Page = new Page2();
                break;

            case "Module3":
                Page = new Page3();
                break;

            default:
                break;
            }
        }
Example #30
0
        /// <summary>
        /// 保存前检查
        /// </summary>
        /// <returns></returns>
        protected override bool SavePre()
        {
            int m = 0;

            if (base.SavePre() == false)
            {
                return(false);
            }
            DataRow drItem = ((DataRowView)binData.Current).Row;

            binUnit.EndEdit();
            int intCnt = binUnit.Count;

            binUnit.MoveFirst();
            for (int i = 0; i < intCnt; i++)
            {
                DataRow dr = ((DataRowView)binUnit.Current).Row;
                if (dr["F_Name"] == DBNull.Value)
                {
                    MessageBox.Show("单位名称不能为空!!");
                    Page2.Focus();
                    return(false);
                }
                if (Convert.ToBoolean(dr["F_Main"]) == true)
                {
                    m = m + 1;
                }
                dr["F_ItemID"] = drItem["F_ID"];
                binUnit.MoveNext();
            }
            if (m > 1)
            {
                MessageBox.Show("不能同时存在多个主单位!!", "提示");
                xtraTabControl1.SelectedTabPageIndex = 1;
                return(false);
            }
            return(true);
        }
        private void AppendCategoryContent(string storageName, string itemGuid)
        {
            //DateTime trackLoadingTime = DateTime.Now;

            var categoryItem = MiscHelpers.GetCatergoryItemFromIsolatedStorage(storageName + ".xml");

            var channelList = categoryItem.ChannelItems;

            if (channelList != null && channelList.Count > 0)
            {
                if ("search".Equals(_categoryName))
                {
                    HeaderBox.Text = channelList[0].FeedTitle;
                    //string icon = "http://s2.googleusercontent.com/s2/favicons?domain=" + channelList[0].FeedLink;
                    //HeaderIcon.Source = new BitmapImage(new Uri(icon, UriKind.RelativeOrAbsolute));
                }

                var favouriteChannelItem = MiscHelpers.GetChannelItemFromIsolatedStorage("fbd-favorites.xml");
                var readLaterChannelItem = MiscHelpers.GetChannelItemFromIsolatedStorage("fbd-readlater.xml");

                var newsItems = new ObservableCollection<Page2>();
                Page2 thisP = null;

                DataModel.UIContextItem tempSingle = null;

                foreach (var item in channelList)
                {
                    if (item.NewsItems != null && item.NewsItems.Count > 0)
                    {

                        DataModel.NewsItem newsItem = item.NewsItems[0];

                        var uItem = MiscHelpers.CreateUINewsItem(newsItem);

                        uItem.ImageFavourite = _m.IsNewsItemInList(favouriteChannelItem, uItem.Tag.ToString())
                                                       ? _m.imageFavouriteOn
                                                       : _m.imageFavouriteOff;
                        uItem.ImageReadLater = _m.IsNewsItemInList(readLaterChannelItem, uItem.Tag.ToString())
                                                   ? _m.imageReadLaterOn
                                                   : _m.imageReadLaterOff;

                        if (item.NewsImages != null && item.NewsImages.Count > 0 && item.NewsImages[0] != null)
                        {
                            Analytics.GetInstance().TrackHasImage("fullImageNews-hasImageYes", "y");

                            uItem.NewsImageSource = new BitmapImage(new Uri(item.NewsImages[0], UriKind.Absolute));
                            uItem.NewsImageSource.CreateOptions = BitmapCreateOptions.BackgroundCreation;
                            uItem.NewsImageSource.ImageOpened += delegate
                            {
                                if (tempSingle != null)
                                {
                                    var p2 = CreatePage2Item(tempSingle, null);
                                    newsItems.Add(p2);
                                }
                                thisP = CreatePage2Item(uItem, null);
                                newsItems.Add(thisP);
                                tempSingle = null;

                                if (thisP != null && itemGuid.Equals(item.Tag.ToString()))
                                {
                                    SlideView.SelectedItem = thisP;
                                    _currentViewingItem = thisP;
                                }
                            };
                            uItem.NewsImageSource.ImageFailed += delegate
                            {
                                uItem.NewsImageSource = null;
                                uItem.BackgroundColor = new SolidColorBrush(Colors.LightGray);

                                if (tempSingle != null)
                                {
                                    thisP = CreatePage2Item(tempSingle, uItem);
                                    newsItems.Add(thisP);
                                    tempSingle = null;
                                }
                                else
                                {
                                    tempSingle = uItem;
                                }

                                if (thisP != null && itemGuid.Equals(item.Tag.ToString()))
                                {
                                    SlideView.SelectedItem = thisP;
                                    _currentViewingItem = thisP;
                                }
                            };
                        }
                        else
                        {
                            Analytics.GetInstance().TrackHasImage("fullImageNews-hasImageNo", "n");

                            uItem.NewsImageSource = null;
                            uItem.BackgroundColor = new SolidColorBrush(Colors.Gray);

                            if (tempSingle != null)
                            {
                                thisP = CreatePage2Item(tempSingle, uItem);
                                newsItems.Add(thisP);
                                tempSingle = null;
                            }
                            else
                            {
                                tempSingle = uItem;
                            }

                            if (thisP != null && itemGuid.Equals(item.Tag.ToString()))
                            {
                                SlideView.SelectedItem = thisP;
                                _currentViewingItem = thisP;
                            }
                        }
                    }
                }
                if (tempSingle != null)
                {
                    thisP = CreatePage2Item(tempSingle, null);
                    newsItems.Add(thisP);
                    tempSingle = null;
                }

                SlideView.ItemsSource = newsItems;
            }
            else
            {
                //ToDo: Handle empty list
            }

            //Analytics.GetInstance().TrackLoadingTime("NewsItem-AppendCategoryContent", trackLoadingTime);
        }
        private void AppendContent(string storageName, string itemGuid)
        {
            //DateTime trackLoadingTime = DateTime.Now;

            var channelItem = MiscHelpers.GetChannelItemFromIsolatedStorage(storageName + ".xml");

            //ToDo: Handle null
            if (channelItem == null) return;

            if ("search".Equals(_categoryName))
            {
                HeaderBox.Text = channelItem.FeedTitle;
                //string icon = "http://s2.googleusercontent.com/s2/favicons?domain=" + channelList[0].FeedLink;
                //HeaderIcon.Source = new BitmapImage(new Uri(icon, UriKind.RelativeOrAbsolute));
            }

            //Change add icon to remove icon if true
            if (storageName.Contains("fbd-channel-"))
            {
                var homeTileList = MiscHelpers.GetItemFromIsolatedStorage<List<PinTile>>("fbd-pintiles.xml");
                var decodedStorageName = HttpUtility.UrlDecode(storageName);
                var existingHomeTile = GeneralHelper.GetHomeTile(decodedStorageName, homeTileList);
                if (existingHomeTile != null)
                {
                    var button = (ApplicationBarIconButton)ApplicationBar.Buttons[1];
                    button.IconUri = new Uri("/Images/General/AppBar/btn_unsubscibe_w.png", UriKind.RelativeOrAbsolute);
                    _isSubscribed = true;
                }
            }
            if (HomePagePinTiles.IsFull())
            {
                var button = (ApplicationBarIconButton)ApplicationBar.Buttons[1];
                button.IsEnabled = false;
            }

            _numOfNewNewsItem = channelItem.NumOfNewNewsItems;

            var newsItemList = channelItem.NewsItems;

            if (newsItemList != null)
            {
                var favouriteChannelItem = MiscHelpers.GetChannelItemFromIsolatedStorage("fbd-favorites.xml");
                var readLaterChannelItem = MiscHelpers.GetChannelItemFromIsolatedStorage("fbd-readlater.xml");

                var newsItems = new ObservableCollection<Page2>();
                Page2 thisP = null;

                DataModel.UIContextItem tempSingle = null;

                for (int i=0; i < newsItemList.Count; i++)
                {
                    var item = newsItemList[i];

                    var uItem = MiscHelpers.CreateUINewsItem(item);

                    uItem.ImageFavourite = _m.IsNewsItemInList(favouriteChannelItem, uItem.Tag.ToString())
                                                   ? _m.imageFavouriteOn
                                                   : _m.imageFavouriteOff;
                    uItem.ImageReadLater = _m.IsNewsItemInList(readLaterChannelItem, uItem.Tag.ToString())
                                               ? _m.imageReadLaterOn
                                               : _m.imageReadLaterOff;

                    if (item.NewsImages != null && item.NewsImages.Count > 0 && item.NewsImages[0] != null)
                    {
                        Analytics.GetInstance().TrackHasImage("fullImageNews-hasImageYes", "y");

                        uItem.NewsImageSource = new BitmapImage(new Uri(item.NewsImages[0], UriKind.Absolute));
                        uItem.NewsImageSource.CreateOptions = BitmapCreateOptions.BackgroundCreation;
                        uItem.NewsImageSource.ImageOpened += delegate
                            {
                                if (tempSingle != null) {
                                    var p2 = CreatePage2Item(tempSingle, null);
                                    newsItems.Add(p2);
                                }
                                thisP = CreatePage2Item(uItem, null);
                                newsItems.Add(thisP);
                                tempSingle = null;

                                if (thisP != null && itemGuid.Equals(item.Tag.ToString()))
                                {
                                    SlideView.SelectedItem = thisP;
                                    _currentViewingItem = thisP;
                                }
                            };
                        uItem.NewsImageSource.ImageFailed += delegate
                            {
                                uItem.NewsImageSource = null;
                                uItem.BackgroundColor = new SolidColorBrush(Colors.LightGray);

                                if (tempSingle != null) {
                                    thisP = CreatePage2Item(tempSingle, uItem);
                                    newsItems.Add(thisP);
                                    tempSingle = null;
                                }else {
                                    tempSingle = uItem;
                                }

                                if (thisP != null && itemGuid.Equals(item.Tag.ToString()))
                                {
                                    SlideView.SelectedItem = thisP;
                                    _currentViewingItem = thisP;
                                }
                            };
                    }
                    else
                    {

                        Analytics.GetInstance().TrackHasImage("fullImageNews-hasImageNo", "n");
                        uItem.NewsImageSource = null;
                        uItem.BackgroundColor = new SolidColorBrush(Colors.Gray);

                        if (tempSingle != null) {
                            thisP = CreatePage2Item(tempSingle, uItem);
                            newsItems.Add(thisP);
                            tempSingle = null;
                        }else {
                            tempSingle = uItem;
                        }

                        if (thisP != null && itemGuid.Equals(item.Tag.ToString()))
                        {
                            SlideView.SelectedItem = thisP;
                            _currentViewingItem = thisP;
                        }
                    }

                }
                if (tempSingle != null)
                {
                    thisP = CreatePage2Item(tempSingle, null);
                    newsItems.Add(thisP);
                    tempSingle = null;
                }

                SlideView.ItemsSource = newsItems;

                if (_adsTimer != null)
                {
                    _adsTimer.Stop();
                }
            }
            else
            {
                //ToDo: Handle empty list
            }

            //Analytics.GetInstance().TrackLoadingTime("NewsItem-AppendContent", trackLoadingTime);
        }
        private void SlideViewSlided(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            var view = sender as RadSlideView;
            var newsItem = view.SelectedItem as Page2;

            _currentViewingItem = newsItem;
        }
Example #34
0
        /// <summary>
        /// Gets a data form containing editable parameters from an object.
        /// </summary>
        /// <param name="Client">Client</param>
        /// <param name="e">IQ Event Arguments describing the request.</param>
        /// <param name="EditableObject">Object whose parameters will be edited.</param>
        /// <param name="Title">Title of form.</param>
        /// <returns>Data form containing editable parameters.</returns>
        public static async Task <DataForm> GetEditableForm(XmppClient Client, IqEventArgs e, object EditableObject, string Title)
        {
            Type     T = EditableObject.GetType();
            string   DefaultLanguageCode = GetDefaultLanguageCode(T);
            DataForm Parameters          = new DataForm(Client, FormType.Form, e.To, e.From);
            Language Language            = await ConcentratorServer.GetLanguage(e.Query, DefaultLanguageCode);

            Namespace    Namespace = null;
            List <Field> Fields    = new List <Field>();
            List <Page>  Pages     = new List <Page>();
            Dictionary <string, Page>             PageByLabel = new Dictionary <string, Page>();
            Dictionary <string, Section>          SectionByPageAndSectionLabel = null;
            List <KeyValuePair <string, string> > Options = null;
            string                     NamespaceStr;
            string                     LastNamespaceStr = null;
            string                     Header;
            string                     ToolTip;
            string                     PageLabel;
            string                     SectionLabel;
            string                     s;
            int                        StringId;
            int                        PagePriority;
            int                        PageOrdinal = 0;
            int                        FieldPriority;
            int                        FieldOrdinal = 0;
            bool                       Required;
            bool                       ReadOnly;
            bool                       Masked;
            bool                       Alpha;
            bool                       DateOnly;
            bool                       Nullable;
            HeaderAttribute            HeaderAttribute;
            ToolTipAttribute           ToolTipAttribute;
            PageAttribute              PageAttribute;
            SectionAttribute           SectionAttribute;
            OptionAttribute            OptionAttribute;
            TextAttribute              TextAttribute;
            RegularExpressionAttribute RegularExpressionAttribute;
            LinkedList <TextAttribute> TextAttributes;
            RangeAttribute             RangeAttribute;
            ValidationMethod           ValidationMethod;
            Type                       PropertyType;
            Field                      Field;
            Page                       DefaultPage = null;
            Page                       Page;

            if (Namespace is null)
            {
                Namespace = await Language.CreateNamespaceAsync(T.Namespace);
            }

            LinkedList <KeyValuePair <PropertyInfo, FieldInfo> > Properties = new LinkedList <KeyValuePair <PropertyInfo, FieldInfo> >();

            foreach (PropertyInfo PI in T.GetRuntimeProperties())
            {
                if (PI.CanRead)
                {
                    Properties.AddLast(new KeyValuePair <PropertyInfo, FieldInfo>(PI, null));
                }
            }

            foreach (FieldInfo FI in T.GetRuntimeFields())
            {
                Properties.AddLast(new KeyValuePair <PropertyInfo, FieldInfo>(null, FI));
            }

            foreach (KeyValuePair <PropertyInfo, FieldInfo> Rec in Properties)
            {
                PropertyInfo PropertyInfo = Rec.Key;
                FieldInfo    FieldInfo    = Rec.Value;

                NamespaceStr = (PropertyInfo?.DeclaringType ?? FieldInfo.DeclaringType).Namespace;
                if (Namespace is null || NamespaceStr != LastNamespaceStr)
                {
                    Namespace = await Language.GetNamespaceAsync(NamespaceStr);

                    LastNamespaceStr = NamespaceStr;
                }

                Header           = ToolTip = PageLabel = SectionLabel = null;
                TextAttributes   = null;
                ValidationMethod = null;
                Options          = null;
                Required         = Masked = Alpha = DateOnly = false;
                ReadOnly         = PropertyInfo != null && !PropertyInfo.CanWrite;
                PagePriority     = PageAttribute.DefaultPriority;
                FieldPriority    = HeaderAttribute.DefaultPriority;

                foreach (Attribute Attr in (PropertyInfo?.GetCustomAttributes() ?? FieldInfo.GetCustomAttributes()))
                {
                    if ((HeaderAttribute = Attr as HeaderAttribute) != null)
                    {
                        Header        = HeaderAttribute.Header;
                        StringId      = HeaderAttribute.StringId;
                        FieldPriority = HeaderAttribute.Priority;
                        if (StringId > 0)
                        {
                            Header = await Namespace.GetStringAsync(StringId, Header);
                        }
                    }
                    else if ((ToolTipAttribute = Attr as ToolTipAttribute) != null)
                    {
                        ToolTip  = ToolTipAttribute.ToolTip;
                        StringId = ToolTipAttribute.StringId;
                        if (StringId > 0)
                        {
                            ToolTip = await Namespace.GetStringAsync(StringId, ToolTip);
                        }
                    }
                    else if ((PageAttribute = Attr as PageAttribute) != null)
                    {
                        PageLabel    = PageAttribute.Label;
                        StringId     = PageAttribute.StringId;
                        PagePriority = PageAttribute.Priority;
                        if (StringId > 0)
                        {
                            PageLabel = await Namespace.GetStringAsync(StringId, PageLabel);
                        }
                    }
                    else if ((SectionAttribute = Attr as SectionAttribute) != null)
                    {
                        SectionLabel = SectionAttribute.Label;
                        StringId     = SectionAttribute.StringId;
                        if (StringId > 0)
                        {
                            SectionLabel = await Namespace.GetStringAsync(StringId, SectionLabel);
                        }
                    }
                    else if ((TextAttribute = Attr as TextAttribute) != null)
                    {
                        if (TextAttributes is null)
                        {
                            TextAttributes = new LinkedList <TextAttribute>();
                        }

                        TextAttributes.AddLast(TextAttribute);
                    }
                    else if ((OptionAttribute = Attr as OptionAttribute) != null)
                    {
                        if (Options is null)
                        {
                            Options = new List <KeyValuePair <string, string> >();
                        }

                        StringId = OptionAttribute.StringId;
                        if (StringId > 0)
                        {
                            Options.Add(new KeyValuePair <string, string>(OptionAttribute.Option.ToString(),
                                                                          await Namespace.GetStringAsync(StringId, OptionAttribute.Label)));
                        }
                        else
                        {
                            Options.Add(new KeyValuePair <string, string>(OptionAttribute.Option.ToString(), OptionAttribute.Label));
                        }
                    }
                    else if ((RegularExpressionAttribute = Attr as RegularExpressionAttribute) != null)
                    {
                        ValidationMethod = new RegexValidation(RegularExpressionAttribute.Pattern);
                    }
                    else if ((RangeAttribute = Attr as RangeAttribute) != null)
                    {
                        ValidationMethod = new RangeValidation(RangeAttribute.Min, RangeAttribute.Max);
                    }
                    else if (Attr is OpenAttribute)
                    {
                        ValidationMethod = new OpenValidation();
                    }
                    else if (Attr is RequiredAttribute)
                    {
                        Required = true;
                    }
                    else if (Attr is ReadOnlyAttribute)
                    {
                        ReadOnly = true;
                    }
                    else if (Attr is MaskedAttribute)
                    {
                        Masked = true;
                    }
                    else if (Attr is AlphaChannelAttribute)
                    {
                        Alpha = true;
                    }
                    else if (Attr is DateOnlyAttribute)
                    {
                        DateOnly = true;
                    }
                }

                if (Header is null)
                {
                    continue;
                }

                PropertyType = PropertyInfo?.PropertyType ?? FieldInfo.FieldType;
                Field        = null;
                Nullable     = false;

                if (PropertyType.GetTypeInfo().IsGenericType)
                {
                    Type GT = PropertyType.GetGenericTypeDefinition();
                    if (GT == typeof(Nullable <>))
                    {
                        Nullable     = true;
                        PropertyType = PropertyType.GenericTypeArguments[0];
                    }
                }

                string PropertyName  = PropertyInfo?.Name ?? FieldInfo.Name;
                object PropertyValue = (PropertyInfo?.GetValue(EditableObject) ?? FieldInfo.GetValue(EditableObject));

                if (PropertyType == typeof(string[]))
                {
                    if (ValidationMethod is null)
                    {
                        ValidationMethod = new BasicValidation();
                    }

                    if (Options is null)
                    {
                        Field = new TextMultiField(Parameters, PropertyName, Header, Required, (string[])PropertyValue,
                                                   null, ToolTip, StringDataType.Instance, ValidationMethod, string.Empty, false, ReadOnly, false);
                    }
                    else
                    {
                        Field = new ListMultiField(Parameters, PropertyName, Header, Required, (string[])PropertyValue,
                                                   Options.ToArray(), ToolTip, StringDataType.Instance, ValidationMethod, string.Empty, false, ReadOnly, false);
                    }
                }
                else if (PropertyType.GetTypeInfo().IsEnum)
                {
                    if (ValidationMethod is null)
                    {
                        ValidationMethod = new BasicValidation();
                    }

                    if (Options is null)
                    {
                        Options = new List <KeyValuePair <string, string> >();

                        foreach (string Option in Enum.GetNames(PropertyType))
                        {
                            Options.Add(new KeyValuePair <string, string>(Option, Option));
                        }
                    }

                    s = PropertyValue?.ToString();
                    if (Nullable && s is null)
                    {
                        s = string.Empty;
                    }

                    Field = new ListSingleField(Parameters, PropertyName, Header, Required, new string[] { s },
                                                Options.ToArray(), ToolTip, null, ValidationMethod, string.Empty, false, ReadOnly, false);
                }
                else if (PropertyType == typeof(bool))
                {
                    if (ValidationMethod is null)
                    {
                        ValidationMethod = new BasicValidation();
                    }

                    if (Nullable && PropertyValue is null)
                    {
                        s = string.Empty;
                    }
                    else
                    {
                        s = CommonTypes.Encode((bool)PropertyValue);
                    }

                    Field = new BooleanField(Parameters, PropertyName, Header, Required, new string[] { s },
                                             Options?.ToArray(), ToolTip, BooleanDataType.Instance, ValidationMethod,
                                             string.Empty, false, ReadOnly, false);
                }
                else
                {
                    DataType DataType;

                    if (PropertyType == typeof(string))
                    {
                        DataType = StringDataType.Instance;
                    }
                    else if (PropertyType == typeof(sbyte))
                    {
                        DataType = ByteDataType.Instance;
                    }
                    else if (PropertyType == typeof(short))
                    {
                        DataType = ShortDataType.Instance;
                    }
                    else if (PropertyType == typeof(int))
                    {
                        DataType = IntDataType.Instance;
                    }
                    else if (PropertyType == typeof(long))
                    {
                        DataType = LongDataType.Instance;
                    }
                    else if (PropertyType == typeof(byte))
                    {
                        DataType = ShortDataType.Instance;

                        if (ValidationMethod is null)
                        {
                            ValidationMethod = new RangeValidation(byte.MinValue.ToString(), byte.MaxValue.ToString());
                        }
                    }
                    else if (PropertyType == typeof(ushort))
                    {
                        DataType = IntDataType.Instance;

                        if (ValidationMethod is null)
                        {
                            ValidationMethod = new RangeValidation(ushort.MinValue.ToString(), ushort.MaxValue.ToString());
                        }
                    }
                    else if (PropertyType == typeof(uint))
                    {
                        DataType = LongDataType.Instance;

                        if (ValidationMethod is null)
                        {
                            ValidationMethod = new RangeValidation(uint.MinValue.ToString(), uint.MaxValue.ToString());
                        }
                    }
                    else if (PropertyType == typeof(ulong))
                    {
                        DataType = IntegerDataType.Instance;

                        if (ValidationMethod is null)
                        {
                            ValidationMethod = new RangeValidation(ulong.MinValue.ToString(), ulong.MaxValue.ToString());
                        }
                    }
                    else if (PropertyType == typeof(DateTime))
                    {
                        if (DateOnly)
                        {
                            DataType = DateDataType.Instance;
                        }
                        else
                        {
                            DataType = DateTimeDataType.Instance;
                        }
                    }
                    else if (PropertyType == typeof(decimal))
                    {
                        DataType = DecimalDataType.Instance;
                    }
                    else if (PropertyType == typeof(double))
                    {
                        DataType = DoubleDataType.Instance;
                    }
                    else if (PropertyType == typeof(float))
                    {
                        DataType = DoubleDataType.Instance;                            // Use xs:double anyway
                    }
                    else if (PropertyType == typeof(TimeSpan))
                    {
                        DataType = TimeDataType.Instance;
                    }
                    else if (PropertyType == typeof(Uri))
                    {
                        DataType = AnyUriDataType.Instance;
                    }
                    else if (PropertyType == typeof(SKColor))
                    {
                        if (Alpha)
                        {
                            DataType = ColorAlphaDataType.Instance;
                        }
                        else
                        {
                            DataType = ColorDataType.Instance;
                        }
                    }
                    else
                    {
                        DataType = StringDataType.Instance;
                    }

                    if (ValidationMethod is null)
                    {
                        ValidationMethod = new BasicValidation();
                    }

                    s = PropertyValue?.ToString();
                    if (Nullable && s is null)
                    {
                        s = string.Empty;
                    }

                    if (Masked)
                    {
                        Field = new TextPrivateField(Parameters, PropertyName, Header, Required, new string[] { s },
                                                     Options?.ToArray(), ToolTip, DataType, ValidationMethod,
                                                     string.Empty, false, ReadOnly, false);
                    }
                    else if (Options is null)
                    {
                        Field = new TextSingleField(Parameters, PropertyName, Header, Required, new string[] { s },
                                                    null, ToolTip, DataType, ValidationMethod, string.Empty, false, ReadOnly, false);
                    }
                    else
                    {
                        Field = new ListSingleField(Parameters, PropertyName, Header, Required, new string[] { s },
                                                    Options.ToArray(), ToolTip, DataType, ValidationMethod, string.Empty, false, ReadOnly, false);
                    }
                }

                if (Field is null)
                {
                    continue;
                }

                if (string.IsNullOrEmpty(PageLabel))
                {
                    if (DefaultPage is null)
                    {
                        DefaultPage = new Page(Parameters, string.Empty)
                        {
                            Priority = PageAttribute.DefaultPriority,
                            Ordinal  = PageOrdinal++
                        };
                        Pages.Add(DefaultPage);
                        PageByLabel[string.Empty] = DefaultPage;
                    }

                    Page      = DefaultPage;
                    PageLabel = string.Empty;
                }
                else
                {
                    if (!PageByLabel.TryGetValue(PageLabel, out Page))
                    {
                        Page = new Page(Parameters, PageLabel)
                        {
                            Priority = PagePriority,
                            Ordinal  = PageOrdinal++
                        };
                        Pages.Add(Page);
                        PageByLabel[PageLabel] = Page;
                    }
                }

                Field.Priority = FieldPriority;
                Field.Ordinal  = FieldOrdinal++;
                Fields.Add(Field);

                if (string.IsNullOrEmpty(SectionLabel))
                {
                    if (TextAttributes != null)
                    {
                        foreach (TextAttribute TextAttr in TextAttributes)
                        {
                            if (TextAttr.Position == TextPosition.BeforeField)
                            {
                                StringId = TextAttr.StringId;
                                if (StringId > 0)
                                {
                                    Page.Add(new TextElement(Parameters, await Namespace.GetStringAsync(StringId, TextAttr.Label)));
                                }
                                else
                                {
                                    Page.Add(new TextElement(Parameters, TextAttr.Label));
                                }
                            }
                        }
                    }

                    Page.Add(new FieldReference(Parameters, Field.Var));

                    if (TextAttributes != null)
                    {
                        foreach (TextAttribute TextAttr in TextAttributes)
                        {
                            if (TextAttr.Position == TextPosition.AfterField)
                            {
                                StringId = TextAttr.StringId;
                                if (StringId > 0)
                                {
                                    Page.Add(new TextElement(Parameters, await Namespace.GetStringAsync(StringId, TextAttr.Label)));
                                }
                                else
                                {
                                    Page.Add(new TextElement(Parameters, TextAttr.Label));
                                }
                            }
                        }
                    }
                }
                else
                {
                    if (SectionByPageAndSectionLabel is null)
                    {
                        SectionByPageAndSectionLabel = new Dictionary <string, Section>();
                    }

                    s = PageLabel + " \xa0 " + SectionLabel;
                    if (!SectionByPageAndSectionLabel.TryGetValue(s, out Section Section))
                    {
                        Section = new Section(Parameters, SectionLabel);
                        SectionByPageAndSectionLabel[s] = Section;

                        Page.Add(Section);
                    }

                    if (TextAttributes != null)
                    {
                        foreach (TextAttribute TextAttr in TextAttributes)
                        {
                            if (TextAttr.Position == TextPosition.BeforeField)
                            {
                                StringId = TextAttr.StringId;
                                if (StringId > 0)
                                {
                                    Section.Add(new TextElement(Parameters, await Namespace.GetStringAsync(StringId, TextAttr.Label)));
                                }
                                else
                                {
                                    Section.Add(new TextElement(Parameters, TextAttr.Label));
                                }
                            }
                        }
                    }

                    Section.Add(new FieldReference(Parameters, Field.Var));

                    if (TextAttributes != null)
                    {
                        foreach (TextAttribute TextAttr in TextAttributes)
                        {
                            if (TextAttr.Position == TextPosition.AfterField)
                            {
                                StringId = TextAttr.StringId;
                                if (StringId > 0)
                                {
                                    Section.Add(new TextElement(Parameters, await Namespace.GetStringAsync(StringId, TextAttr.Label)));
                                }
                                else
                                {
                                    Section.Add(new TextElement(Parameters, TextAttr.Label));
                                }
                            }
                        }
                    }
                }
            }

            if (EditableObject is IPropertyFormAnnotation PropertyFormAnnotation)
            {
                FormState State = new FormState()
                {
                    Form        = Parameters,
                    PageByLabel = PageByLabel,
                    SectionByPageAndSectionLabel = SectionByPageAndSectionLabel,
                    DefaultPage  = DefaultPage,
                    LanguageCode = Language.Code,
                    Fields       = Fields,
                    Pages        = Pages,
                    FieldOrdinal = FieldOrdinal,
                    PageOrdinal  = PageOrdinal
                };

                await PropertyFormAnnotation.AnnotatePropertyForm(State);
            }

            Fields.Sort(OrderFields);
            Parameters.Title  = Title;
            Parameters.Fields = Fields.ToArray();

            if (Pages != null)
            {
                Pages.Sort(OrderPages);

                foreach (Page Page2 in Pages)
                {
                    Page2.Sort();
                }
            }

            Parameters.Pages = Pages.ToArray();

            return(Parameters);
        }
Example #35
0
 private void ChangePage2(object sender, EventArgs args)
 {
     Detail      = new Page2();
     IsPresented = false;
 }
Example #36
0
 private async void Button_Click(object sender, RoutedEventArgs e)
 {
     Button b = sender as Button;
     bool navigate = true;
     if (FrmContent.Content.GetType() == typeof(Page2))
     {
         Page2 p2 = (Page2)FrmContent.Content;
         if (await p2.Savep2())
         {
             navigate = true;
             if (isCreate)
             {
                 LblPersonalInformation.Content = p2.TxtbxFirstName.Text.CapitalizeFirst() + " " + p2.TxtbxLastName.Text.CapitalizeFirst();
                 LblTags.Content = "";
                 selectedUID = p2.getUID();
             }
         }
     }
     if (navigate)
     {
         b.Background = System.Windows.Media.Brushes.Green;
         isCreate = false;
         switch (b.Name)
         {
             case "Btnp2":
                 Page2 p2 = new Page2(selectedUID);
                 FrmContent.Navigate(p2);
                 Btnp3.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp4.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp5.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp2.Content = "Personal";
                 break;
             case "Btnp3":
                 Page3 p3 = new Page3(selectedUID);
                 FrmContent.Navigate(p3);
                 Btnp2.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp4.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp5.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 break;
             case "Btnp4":
                 Page4 p4 = new Page4(selectedUID);
                 FrmContent.Navigate(p4);
                 Btnp2.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp3.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp5.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 break;
             case "Btnp5":
                 Page5 p5 = new Page5(selectedUID);
                 FrmContent.Navigate(p5);
                 Btnp2.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp3.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 Btnp4.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                 break;
         }
         dgContentList.UpdateGrid();
         ShowHide();
     }
 }
 public static DataModel.UIContextItem CreatePage2ToUIContextItem(Page2 p)
 {
     var uItem = new DataModel.UIContextItem()
     {
         Tag = p.Tag1,
         FeedTitle = p.FeedTitle1,
         FeedUrl = p.FeedUrl1,
         //FeedLink = p.FeedLink1,
         //FeedAuthor = p.FeedAuthor1,
         //FeedDescription = p.FeedDescription1,
         NewsTitle = p.NewsTitle1,
         //NewsLink = p.NewsLink1,
         //NewsAuthor = p.NewsAuthor1,
         NewsSnippet = p.NewsSnippet1,
         //NewsContent = p.NewsContent1,
         NewsImages = p.NewsImages1,
         NewsPublishedDateDisplay = p.NewsPublishedDateDisplay1,
         //NewsPublishedDateTimeStamp = p.NewsPublishedDateTimeStamp1,
         NewsImageSource = p.NewsImageSource1,
         ImageFavourite = p.ImageFavourite1,
         ImageReadLater = p.ImageReadLater1
     };
     return uItem;
 }
Example #38
0
        void page0_MainDataCreated(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            page1 = new Page1(page0.MainData);

            page2 = new Page2(page0.MainData);
        }
Example #39
0
        public OpennInWindow()
        {
            InitializeComponent();

            WindowXCaption.SetBackground(this, baseColora.Bg);
            WindowXCaption.SetForeground(this, baseColora.Fg);

            BG.BeginInit();
            BG.Source = baseColora.Bgp;
            BG.EndInit();

            switch (Main.NowChoice)
            {
            case 1:
            {
                Page1 page1 = new Page1();
                Page.Content = new Frame()
                {
                    Content = page1
                };
            }
            break;

            case 2:
            {
                Page2 page2 = new Page2();
                Page.Content = new Frame()
                {
                    Content = page2
                };
            }
            break;

            case 3:
            {
                Page3 page3 = new Page3();
                Page.Content = new Frame()
                {
                    Content = page3
                };
            }
            break;

            case 4:
            {
                Page4 page4 = new Page4();
                Page.Content = new Frame()
                {
                    Content = page4
                };
            }
            break;

            case 5:
            {
                Page5 page5 = new Page5();
                Page.Content = new Frame()
                {
                    Content = page5
                };
            }
            break;

            case 6:
            {
                Page6 page6 = new Page6();
                Page.Content = new Frame()
                {
                    Content = page6
                };
            }
            break;

            case 7:
            {
                Page7 page7 = new Page7();
                Page.Content = new Frame()
                {
                    Content = page7
                };
            }
            break;

            case -1:
            {
                PageHD1 pageHD1 = new PageHD1();
                Page.Content = new Frame()
                {
                    Content = pageHD1
                };
            }
            break;

            default:
            {
                PageNone pageNone = new PageNone();
                Page.Content = new Frame()
                {
                    Content = pageNone
                };
            }
            break;
            }
            Topmost = true;
        }
Example #40
0
        private void dgContentList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (dgContentList.SelectedIndex >= 0)
            {
                var obj = dgContentList.SelectedItem;
                DataGridColumn column = dgContentList.Columns[0];

                if (column.GetCellContent(obj) is TextBlock)
                {
                    TextBlock cellContent = column.GetCellContent(obj) as TextBlock;
                    string content = cellContent.Text.ToLower();
                    selectedUID = Convert.ToInt32(content);
                }
                System.Type type = obj.GetType();
                if (type != null)
                {
                    FillDetails(selectedUID);
                    string first = "";
                    string last = "";
                    DataGridColumn columnF = dgContentList.Columns[1];
                    if (columnF.GetCellContent(obj) is TextBlock)
                    {
                        TextBlock cellContent = columnF.GetCellContent(obj) as TextBlock;
                        first = cellContent.Text;
                    }
                    DataGridColumn columnL = dgContentList.Columns[2];
                    if (columnL.GetCellContent(obj) is TextBlock)
                    {
                        TextBlock cellContent = columnL.GetCellContent(obj) as TextBlock;
                        last = cellContent.Text;
                    }
                    LblPersonalInformation.Content = first.CapitalizeFirst() + " " + last.CapitalizeFirst();
                    txtbxtest.Text = selectedUID.ToString();
                    GetImage();
                    LblTags.Content = FillLabelTags(selectedUID);
                    ShowHide();
                    Btnp2.Background = System.Windows.Media.Brushes.Green;
                    Btnp3.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                    Btnp4.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                    Btnp5.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom("#FFDDDDDD"));
                    Page2 p2 = new Page2(selectedUID);
                    FrmContent.Navigate(p2);
                }
            }
        }