Esempio n. 1
0
        private void TextBoxExt_func()
        {
            TXTSpace.Children.Clear();
            SfTextBoxExt textBox = new SfTextBoxExt();

            textBox.VerticalAlignment   = VerticalAlignment.Center;
            textBox.HorizontalAlignment = HorizontalAlignment.Stretch;
            textBox.Margin    = new Thickness(5);
            textBox.Watermark = "Esta es una prueba de la marca de agua de este control";
            TXTSpace.Children.Add(textBox);
        }
Esempio n. 2
0
        protected override void OnUnwireEditUIElement(SfDatePicker uiElement)
        {
            uiElement.ValueChanged -= OnValueChanged;
            SfTextBoxExt sfTextBoxExt = (SfTextBoxExt)GridUtil.FindDescendantChildByName(uiElement, "PART_TextBoxExt");

            if (sfTextBoxExt == null || !uiElement.AllowNull)
            {
                return;
            }
            sfTextBoxExt.TextChanged -= sfTextBoxExt_TextChanged;
        }
Esempio n. 3
0
        /// <summary>
        /// Invoked when the edit element(SfDatePicker) is unloaded on the cell in column
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        protected override void OnEditElementUnloaded(object sender, RoutedEventArgs e)
        {
            var sfDatePicker = ((SfDatePicker)sender);

            sfDatePicker.ValueChanged -= OnValueChanged;
            // Event hooked set the Null value to SfDatePicker.Value when AllowInlineEditing is enabled and delete the value.
            SfTextBoxExt sfTextBoxExt = (SfTextBoxExt)GridUtil.FindDescendantChildByName(sfDatePicker, "PART_TextBoxExt");

            if (sfTextBoxExt == null || !sfDatePicker.AllowNull)
            {
                return;
            }
            sfTextBoxExt.TextChanged -= sfTextBoxExt_TextChanged;
        }
Esempio n. 4
0
        protected override void OnApplyTemplate()
        {
            editorPage         = (CustomizationDemo)this.DataContext;
            AddStartTimeMonth  = GetTemplateChild("addstartmonth") as SfDateTimeCombo;
            AddStartTimeTime   = GetTemplateChild("addstarttime") as SfDateTimeCombo;
            AddEndTimeMonth    = GetTemplateChild("addendmonth") as SfDateTimeCombo;
            AddEndTimeTime     = GetTemplateChild("addendtime") as SfDateTimeCombo;
            EditStartTimeMonth = GetTemplateChild("editstartmonth") as SfDateTimeCombo;
            EditStartTimeTime  = GetTemplateChild("editstarttime") as SfDateTimeCombo;
            EditEndTimeMonth   = GetTemplateChild("editendmonth") as SfDateTimeCombo;
            EditEndTimeTime    = GetTemplateChild("editendtime") as SfDateTimeCombo;
            Subject            = GetTemplateChild("sub") as TextBox;
            Notes               = GetTemplateChild("notes") as TextBox;
            grid                = GetTemplateChild("mainGrid") as Grid;
            Location            = GetTemplateChild("where") as SfTextBoxExt;
            Close               = GetTemplateChild("close") as Button;
            Save                = GetTemplateChild("save") as Button;
            Reminder            = GetTemplateChild("reminder") as ComboBox;
            Delete              = GetTemplateChild("delete") as Button;
            eventDetails        = GetTemplateChild("eventDetails") as SfTabItem;
            timeDetails         = GetTemplateChild("timeDetails") as SfTabItem;
            startDateTabControl = GetTemplateChild("StartDateTabControl") as SfTabControl;
            ShowMorePanel       = GetTemplateChild("showmorepanel") as StackPanel;
            this.Visibility     = Visibility.Collapsed;

            Scroll1                   = GetTemplateChild("scroll1") as ScrollViewer;
            AddReminder               = GetTemplateChild("addreminder") as ComboBox;
            AppType                   = GetTemplateChild("AppType") as ComboBox;
            AddAppType                = GetTemplateChild("AddAppType") as ComboBox;
            Close.Click              += Close_Click;
            Save.Click               += Save_Click;
            Delete.Click             += Delete_Click;
            AddReminder.ItemsSource   = Reminder.ItemsSource = Enum.GetValues(typeof(ReminderTimeType));
            AddReminder.SelectedIndex = Reminder.SelectedIndex = 0;
            AppType.ItemsSource       = AddAppType.ItemsSource = Enum.GetValues(typeof(Appointment.AppointmentTypes));
            AppType.SelectedIndex     = AddAppType.SelectedIndex = 0;
            this.DataContext          = editorPage.AddDataContext;
            this.Visibility           = Visibility.Collapsed;
            base.OnApplyTemplate();
        }
        private void PopulateUI()
        {
            DateTime _today = DateTime.Today;

            HttpClient client = new HttpClient();

            client.BaseAddress = new Uri(@"http://api.tvmaze.com/");
            client.DefaultRequestHeaders.Add("ApiToken", AppSettings.MediaAPIKeyConfiguration.ApiKeyInfo.Where(x => x.Name == "TVMaze").FirstOrDefault().ApiToken);
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

            HttpResponseMessage response = client.GetAsync($@"schedule?country=US&date={ _today.Date.Year }-{ _today.Month }-{ _today.Day }").Result;

            if (response.IsSuccessStatusCode)
            {
                string str = response.Content.ReadAsStringAsync().Result;
                List <TheMovieDbEpisodeAiringResult> airingResults = JsonConvert.DeserializeObject <List <TheMovieDbEpisodeAiringResult> >(str);

                //List<TvMazeResult> showResults = response.Content.ReadAsAsync<List<TvMazeResult>>().Result;
                List <TvMazeShowResultViewModel> shows = new List <TvMazeShowResultViewModel>();

                foreach (TheMovieDbEpisodeAiringResult _episodeAiringToday in airingResults)
                {
                    var vm = _episodeAiringToday.show.GetViewModel();

                    vm.IsExistingShow = DoesShowExist(vm.Name, out int showPremiereYear, out string MatchedDirectoryName);

                    if (vm.IsExistingShow)
                    {
                        if (showPremiereYear < 0)
                        {
                            var x = _episodeAiringToday.show.premiered;
                            var y = x.StartsWith(showPremiereYear.ToString());

                            vm.IsExistingShow = _episodeAiringToday.show.premiered.StartsWith(showPremiereYear.ToString());
                        }
                    }

                    shows.Add(vm);
                }

                AiringTodayHeader.Text = $@"New Television Episodes Airing Today: { _today.DayOfWeek } { _today.Date.Month }/{ _today.Day }/{ _today.Year }";
                shows = shows.Where(x => x.AiringDay == _today.DayOfWeek.ToString()).ToList().OrderByDescending(x => x.IsExistingShow).ThenBy(x => x.Name).ToList();
                AiringTodayDataGrid.ItemsSource = shows;

                AutoCompleteTextBox = new SfTextBoxExt()
                {
                    AutoCompleteSource  = shows,
                    SearchItemPath      = "Name",
                    PopupDelay          = new TimeSpan(0, 0, 2),
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Width            = 300,
                    Height           = 25,
                    AutoCompleteMode = AutoCompleteMode.Suggest
                };
            }
            else
            {
                MessageBox.Show("Error Code" + response.StatusCode + " : Message - " + response.ReasonPhrase);
            }
        }