Exemplo n.º 1
0
 protected void ViewSubject(RoundButton button)
 {
     if (button.CommandParameter != null && !string.IsNullOrEmpty(button.CommandParameter.ToString()))
     {
         string url = "/Views/Subject/SubjectView.xaml?subjectId=" + button.CommandParameter.ToString() + "&type=" + SubjectType;
         NavigationService.Navigate(new Uri(url, UriKind.Relative));
     }
 }
Exemplo n.º 2
0
        public AboutPrompt()
        {
            DefaultStyleKey = typeof(AboutPrompt);

            var okButton = new RoundButton();

            okButton.Click += ok_Click;

            ActionPopUpButtons.Add(okButton);
        }
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/DnDNavigator.Runtime;component/ErrorMessageBox.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.OKButton = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("OKButton")));
     this.CancelButton = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("CancelButton")));
 }
Exemplo n.º 4
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Motywator;component/Pages/GuidePage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.btnBack    = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnBack")));
 }
Exemplo n.º 5
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Rocketwallet;component/Pages/CategoriesPage.xaml", System.UriKind.Relative));
     this.LayoutRoot       = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.txtCategoryName  = ((Microsoft.Phone.Controls.PhoneTextBox)(this.FindName("txtCategoryName")));
     this.btnCategoryColor = ((System.Windows.Controls.Button)(this.FindName("btnCategoryColor")));
     this.btnAddCategory   = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnAddCategory")));
 }
Exemplo n.º 6
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Motywator;component/ViewPage.xaml", System.UriKind.Relative));
     this.LayoutRoot   = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.stpTitle     = ((System.Windows.Controls.StackPanel)(this.FindName("stpTitle")));
     this.btnFavourite = ((Coding4Fun.Toolkit.Controls.RoundToggleButton)(this.FindName("btnFavourite")));
     this.btnShare     = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnShare")));
 }
Exemplo n.º 7
0
        protected UserPrompt()
        {
            var okButton = new RoundButton();

            _cancelButton = new RoundButton();

            okButton.Click      += OkClick;
            _cancelButton.Click += CancelledClick;

            ActionPopUpButtons.Add(okButton);
            ActionPopUpButtons.Add(_cancelButton);

            SetCancelButtonVisibility(IsCancelVisible);
        }
Exemplo n.º 8
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Motywator;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot        = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.panCitation       = ((Microsoft.Phone.Controls.Panorama)(this.FindName("panCitation")));
     this.stpCitation       = ((System.Windows.Controls.StackPanel)(this.FindName("stpCitation")));
     this.btnSortByCitation = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnSortByCitation")));
     this.btnSortByAuthor   = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnSortByAuthor")));
     this.btnOnlyFavorite   = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnOnlyFavorite")));
     this.lstCitations      = ((System.Windows.Controls.ListBox)(this.FindName("lstCitations")));
     this.btnRemoveAd       = ((System.Windows.Controls.Image)(this.FindName("btnRemoveAd")));
 }
Exemplo n.º 9
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Beem;component/Views/StationPlayer.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.btnPrevious = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnPrevious")));
     this.btnPlay = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnPlay")));
     this.btnNext = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnNext")));
     this.btnRecord = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnRecord")));
     this.btnRecordStop = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnRecordStop")));
     this.ContentPanel = ((System.Windows.Controls.StackPanel)(this.FindName("ContentPanel")));
     this.btnMarket = ((System.Windows.Controls.Button)(this.FindName("btnMarket")));
     this.btnPin = ((System.Windows.Controls.Button)(this.FindName("btnPin")));
     this.btnShare = ((System.Windows.Controls.Button)(this.FindName("btnShare")));
     this.btnCopy = ((System.Windows.Controls.Button)(this.FindName("btnCopy")));
     this.btnFavorite = ((System.Windows.Controls.Button)(this.FindName("btnFavorite")));
     this.imgFave = ((System.Windows.Controls.Image)(this.FindName("imgFave")));
     this.NameTranslation = ((System.Windows.Media.TranslateTransform)(this.FindName("NameTranslation")));
 }
Exemplo n.º 10
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Beem;component/StationPlayer.xaml", System.UriKind.Relative));
     this.LayoutRoot      = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.btnPrevious     = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnPrevious")));
     this.btnPlay         = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnPlay")));
     this.btnNext         = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnNext")));
     this.btnRecord       = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnRecord")));
     this.btnRecordStop   = ((Coding4Fun.Toolkit.Controls.RoundButton)(this.FindName("btnRecordStop")));
     this.ContentPanel    = ((System.Windows.Controls.StackPanel)(this.FindName("ContentPanel")));
     this.btnMarket       = ((System.Windows.Controls.Button)(this.FindName("btnMarket")));
     this.btnPin          = ((System.Windows.Controls.Button)(this.FindName("btnPin")));
     this.btnShare        = ((System.Windows.Controls.Button)(this.FindName("btnShare")));
     this.btnCopy         = ((System.Windows.Controls.Button)(this.FindName("btnCopy")));
     this.btnFavorite     = ((System.Windows.Controls.Button)(this.FindName("btnFavorite")));
     this.imgFave         = ((System.Windows.Controls.Image)(this.FindName("imgFave")));
     this.NameTranslation = ((System.Windows.Media.TranslateTransform)(this.FindName("NameTranslation")));
 }
        private void MessageSuperClick(object sender, RoutedEventArgs e)
        {
            InitializePrompt();

            _prompt.Title = "Advanced Message";
            _prompt.Background = _naturalBlueSolidColorBrush;
            _prompt.Foreground = _aliceBlueSolidColorBrush;
            _prompt.Overlay = _cornFlowerBlueSolidColorBrush;

            var btnHide = new RoundButton { Label = "Hide" };
            btnHide.Click += (o, args) => _prompt.Hide();

            var btnComplete = new RoundButton { Label = "Complete" };
            btnComplete.Click += (o, args) => _prompt.OnCompleted(new PopUpEventArgs<string, PopUpResult> { PopUpResult = PopUpResult.Ok, Result = "You clicked the Complete Button" });

            _prompt.ActionPopUpButtons.Clear();
            _prompt.ActionPopUpButtons.Add(btnHide);
            _prompt.ActionPopUpButtons.Add(btnComplete);

            _prompt.Show();
        }
        void Appointments_SearchCompleted(object sender, AppointmentsSearchEventArgs e)
        {
            try
            {
                List<Appointment> appointments = new List<Appointment>(e.Results);
                List<String> show = new List<String>();
                int i = 1;
                List<DateTime> alarmtimes = new List<DateTime>();
                DateTime temp = DateTime.Now;

                while (appointments.Count >= i || 8 > i)
                {
                    temp = temp.AddDays(1);

                    Appointment app = appointments.Find(item => item.StartTime.Hour != 0 && temp.Day == item.StartTime.Day);
                    if (app != null)
                    {
                        DateTime alarmtime = app.StartTime;
                        alarmtime = alarmtime.AddHours(-hour);
                        alarmtime = alarmtime.AddMinutes(-min);
                        alarmtimes.Add(alarmtime);
                        show.Add(alarmtime.ToString());

                        String AlarmName = System.Guid.NewGuid().ToString();
                        Alarm alarm = new Alarm(AlarmName);
                        alarm.Content = alarmtime.DayOfWeek + "! " + App.quotes.getQuote();
                        alarm.Sound = mediaplayer2.Source;
                        alarm.BeginTime = alarmtime;
                        alarm.ExpirationTime = alarmtime.AddSeconds(2);
                        alarm.RecurrenceType = RecurrenceInterval.None;
                        if (alarm.BeginTime.TimeOfDay > App.settings.DefaultLateTimeSetting.TimeOfDay)
                            lateAlarmsDisplay.Add(new ListItemAlarm(alarm.Name, alarm.BeginTime, alarm.Sound));
                        ScheduledActionService.Add(alarm);

                    }
                    i++;
                }
            }
            catch (System.Exception)
            {
                //That's okay, no results
            }
            if (lateAlarmsDisplay.Count() > 0)
            {
                messagePrompt = new MessagePrompt();
                messagePrompt.Background = (Brush)Application.Current.Resources["PhoneBackgroundBrush"];
                messagePrompt.IsCancelVisible = false;
                messagePrompt.Title = "Late Alarms";
                UserControl lateAlarms = new LateAlarmsPopup();
                ViolatingAlarms = lateAlarms.GetFirstLogicalChildByType<LongListMultiSelector>(true);
                lateAlarmsDisplay = new ObservableCollection<ListItemAlarm>(lateAlarmsDisplay.OrderBy(x => x.Date));
                ViolatingAlarms.ItemsSource = lateAlarmsDisplay;
                var result2 = lateAlarms.GetFirstLogicalChildByType<TextBlock>(true);
                result2.Text = "Alarms after " + App.settings.DefaultLateTimeSetting.ToShortTimeString();
                messagePrompt.Body = lateAlarms;
                RoundButton remove_btn = new RoundButton() {ImageSource = new BitmapImage(new Uri("Icons/appbar.delete.rest.png", UriKind.Relative)), Tag="remove"};
                remove_btn.Click += removeLate_Click;
                messagePrompt.ActionPopUpButtons.Add(remove_btn);
                messagePrompt.ActionPopUpButtons.ElementAt(0).Click += confirm_Click;
                messagePrompt.ActionPopUpButtons.ElementAt(0).Tag = "confirm";
                messagePrompt.ActionPopUpButtons.ElementAt(1).Tag = "cancel";
                ViolatingAlarms.SelectionChanged += ViolatingAlarms_SelectionChanged;
                foreach (ListItemAlarm alarm in lateAlarmsDisplay)
                {
                    ViolatingAlarms.SelectedItems.Add(alarm);
                }
                messagePrompt.Show();
            }
            else
                NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
        }
Exemplo n.º 13
0
		private void MessageSuperClick(object sender, RoutedEventArgs e)
		{
			var messagePrompt = new MessagePrompt
			{
				Title = "Advanced Message",
				Background = _naturalBlueSolidColorBrush,
				Foreground = _aliceBlueSolidColorBrush,
				Overlay = _cornFlowerBlueSolidColorBrush,
			};

			var btnHide = new RoundButton { Content = "Hide" };
			btnHide.Click += (o, args) => messagePrompt.Hide();

			var btnComplete = new RoundButton { Content = "Complete" };
			btnComplete.Click += (o, args) => messagePrompt.OnCompleted(new PopUpEventArgs<string, PopUpResult> { PopUpResult = PopUpResult.Ok, Result = "You clicked the Complete Button" });

			messagePrompt.ActionPopUpButtons.Clear();
			messagePrompt.ActionPopUpButtons.Add(btnHide);
			messagePrompt.ActionPopUpButtons.Add(btnComplete);

			messagePrompt.Completed += PopUpPromptStringCompleted;

			messagePrompt.Show();
		}
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            passwordBox = GetTemplateChild("passwordBox") as PasswordBox;
            if(passwordBox != null)
            {
                passwordBox.KeyUp += (sender, args) =>
                {
                    if(args.Key == Key.Enter)
                    {
                        DoLogin();
                    }
                };
            }

            loginButton = GetTemplateChild("loginButton") as RoundButton;
            if(loginButton != null)
            {
                loginButton.Click += (sender, args) => DoLogin();
            }

            checkBox = GetTemplateChild("chbxSaveUser") as CheckBox;
            if(checkBox != null)
            {
                checkBox.Tap += (sender, args) =>
                {
                    checkboxTapped = true;
                };
            }
        }