public Header(Page pageUserControl, Category category, Classes.Page page)
 {
     this.InitializeComponent();
     this.pageUserControl = pageUserControl;
     this.category        = category;
     this.page            = page;
     Load();
 }
 public Page()
 {
     this.InitializeComponent();
     category            = new Category();
     page                = new Classes.Page();
     pageHistoryList     = new List <int>();
     category.categoryID = 1;
     LoadPage(category.categoryID);
     SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested;
 }
        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            string pageName     = txtPageName.Text.Trim();
            string pageDelayStr = txtDelay.Text.Trim();
            float  pageDelay    = 0;

            if (pageName == "" || pageDelayStr == "")
            {
                MessageBox.Show("You need to fill both fields in to continue", "Empty field", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return;
            }

            if (!float.TryParse(pageDelayStr, out pageDelay))
            {
                MessageBox.Show("You need to introduce a numeric value (in seconds) for the delay field", "Invalid number", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return;
            }

            if (pageDelay < 0)
            {
                MessageBox.Show("The delay has to be a value greater than zero!", "Invalid number", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return;
            }

            if (!edit)
            {
                if (pageDoesNotExist(pageName))
                {
                    Classes.Page page = new Classes.Page(pageName, pageDelay);
                    BookManager.getSingleton().Add(page);
                }
                else
                {
                    MessageBox.Show("A page with that name already exists. Choose a different name or edit that page.", "The page exists", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return;
                }
            }
            else
            {
                BookManager.getSingleton().ActivePage.Title = pageName;
                BookManager.getSingleton().ActivePage.Delay = pageDelay;
            }

            DialogResult = true;

            Close();
        }
 public Contact(Classes.Page page)
 {
     this.InitializeComponent();
     this.page = page;
     Init();
 }
Example #5
0
 public ImageText(Classes.Page page)
 {
     this.InitializeComponent();
     this.page = page;
     Init();
 }