// go to chosen date
        private async void RaspDatePicker_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
        {
            await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ShowAsync();

            var progInd = Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ProgressIndicator;

            progInd.Text = "Подождите, идёт загрузка расписания";
            await progInd.ShowAsync();

            for (int i = 0; i < 6; i++)
            {
                Premds[i].Text  = "Загрузка ... ";
                Details[i].Text = string.Empty;
            }

            DateTime T = args.NewDate.Date;

            Y            = T.Year;
            M            = T.Month;
            D            = T.Day;
            TxtDate.Text = HelperClass.PrepodName + "\n" + T.ToString("dd MMMM yyyy", new CultureInfo("ru-RU")) + "\n" + T.ToString("dddd", new CultureInfo("ru-RU"));

            await FillRasp();

            await progInd.HideAsync();
        }
 private void EndDatePickerFlyout_OnDatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     if (!ViewModel.EndDateValid)
     {
         ViewModel.EndDateTimeOffset = ViewModel.EndDateTimeOffset;
     }
 }
        private void AddDayFlyout_Click(object sender, RoutedEventArgs e)
        {
            FrameworkElement senderElement = sender as FrameworkElement;
            DatePickerFlyout picker        = new DatePickerFlyout();

            picker.ShowAt(senderElement);
            picker.DatePicked += Picker_DatePicked;
        }
Beispiel #4
0
        private void PickerFlyout_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
        {
            Button button = (Button)sender.Target;

            if (button.Name == "since")
            {
                //Since = sender.Date.ToString("yyyy-MM-dd");
            }
            button.Content = sender.Date.ToString("dd/MM/yyyy");
        }
Beispiel #5
0
 private void Flyout_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     if (args.NewDate.Date > Element.MaximumDate)
     {
     }
     else
     {
         Control.Date = args.NewDate;
         ((MyDatePicker)Element).SelectedDate = (Control.Date.Month < 10 ? "0" + Control.Date.Month : Control.Date.Month + "") + "/" + (Control.Date.Day < 10 ? "0" + Control.Date.Day : Control.Date.Day + "") + "/" + Control.Date.Year;
     }
 }
Beispiel #6
0
        private void DoDatePickerFlyout_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
        {
            var dateTimePicker = sender;

            var secondTimepicker = new TimePickerFlyout();

            secondTimepicker.Placement = FlyoutPlacementMode.Full;
            secondTimepicker.ShowAt(OdButton);

            dateDo = new DateTime(dateTimePicker.Date.Year, dateTimePicker.Date.Month, dateTimePicker.Date.Day, 0, 0, 0);
            secondTimepicker.TimePicked += SecondTimepicker_TimePicked;
        }
Beispiel #7
0
        private async void DateContainer_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var flyout = new DatePickerFlyout();

            flyout.Date = ViewModel.SelectedDay;
            var selectedTime = await flyout.ShowAtAsync(DateControl);

            if (selectedTime != null)
            {
                ViewModel.SelectedDay = selectedTime.Value.LocalDateTime;
                ViewModel.SetBodyContentAsync();
            }
        }
Beispiel #8
0
        void OnDateFly(object sender, TappedRoutedEventArgs e)
        {
            if (ReadOnlyBinding)
            {
                return;
            }

            // 日期选择器
            DatePickerFlyout fly = new DatePickerFlyout();

            fly.Date        = Value;
            fly.DatePicked += (s, args) => Value = args.NewDate.DateTime;
            fly.ShowAt(_grid);
        }
Beispiel #9
0
        /// 手机端后台代码
        /// 手机端后台代码

        private async void AppBarButton_Click(object sender, RoutedEventArgs e)
        {
            var lable = (sender as AppBarButton).Label;

            if (lable == "图片")
            {
                myFrame.Navigate(typeof(HomePage));
                AppTitle.Text = "One 一个";
            }
            else if (lable == "阅读")
            {
                myFrame.Navigate(typeof(ReadingPage));
                AppTitle.Text = "阅 读";
            }
            else if (lable == "音乐")
            {
                myFrame.Navigate(typeof(MusicPage));
                AppTitle.Text = "音 乐";
            }
            else if (lable == "电影")
            {
                myFrame.Navigate(typeof(MoviePage));
                AppTitle.Text = "电 影";
            }

            else if (lable == "日期")
            {
                AppTitle.Text = "选择日期";

                DatePickerFlyout datePickerFlyout = new DatePickerFlyout();
                datePickerFlyout.MinYear = DateTimeOffset.Now.AddYears(-4);
                datePickerFlyout.MaxYear = DateTimeOffset.Now;
                await datePickerFlyout.ShowAtAsync(myFrame);

                datePickerFlyout.Closed     += DatePickerFlyout_Closed;
                datePickerFlyout.DatePicked += DatePickerFlyout_DatePicked;
            }
            else if (lable == "设置")
            {
                myFrame.Navigate(typeof(SettingPage));
                AppTitle.Text = "设 置";
            }
            else if (lable == "分享")
            {
                Windows.ApplicationModel.DataTransfer.DataTransferManager.ShowShareUI();
            }
            else
            {
            }
        }
Beispiel #10
0
        /// 电脑端后台代码
        /// 电脑端后台代码
        /// 电脑端后台代码
        private async void ListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            var item = (e.ClickedItem as StackPanel).Name;

            if (item == "HamburgerButton")
            {
                mySplitView.IsPaneOpen = !mySplitView.IsPaneOpen;
            }
            else if (item == "Home")
            {
                myFrame.Navigate(typeof(HomePage));
                AppTitle.Text = "One 一个";
            }
            else if (item == "Reading")
            {
                myFrame.Navigate(typeof(ReadingPage));
                AppTitle.Text = "阅 读";
            }
            else if (item == "Setting")
            {
                myFrame.Navigate(typeof(SettingPage));
                AppTitle.Text = "关 于";
            }
            else if (item == "Movie")
            {
                myFrame.Navigate(typeof(MoviePage));
                AppTitle.Text = "电影";
            }
            else if (item == "Music")
            {
                myFrame.Navigate(typeof(MusicPage));
                AppTitle.Text = "音乐";
            }
            else if (item == "SetDate")
            {
                AppTitle.Text = "选择日期";
                //await myFrame.Blur(duration: 10, delay: 0, value: 5).StartAsync();
                DatePickerFlyout datePickerFlyout = new DatePickerFlyout();
                datePickerFlyout.DayVisible = false;
                datePickerFlyout.MinYear    = DateTimeOffset.Now.AddYears(-4);
                datePickerFlyout.MaxYear    = DateTimeOffset.Now;
                datePickerFlyout.Placement  = FlyoutPlacementMode.Full;
                await datePickerFlyout.ShowAtAsync(myFrame);

                datePickerFlyout.Closed     += DatePickerFlyout_Closed;
                datePickerFlyout.DatePicked += DatePickerFlyout_DatePicked;
            }
        }
        internal override void OnElementFocusChangeRequested(object sender, VisualElement.FocusRequestArgs args)
        {
            base.OnElementFocusChangeRequested(sender, args);

            // Show a picker fly out on focus to match iOS and Android behavior
            var flyout = new DatePickerFlyout {
                Placement = FlyoutPlacementMode.Bottom, Date = Control.Date
            };

            flyout.DatePicked += (p, e) => Control.Date = p.Date;
            if (!Element.IsVisible)
            {
                flyout.Placement = FlyoutPlacementMode.Full;
            }
            flyout.ShowAt(Control);
        }
 protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.DatePicker> e)
 {
     base.OnElementChanged(e);
     if (Control != null)
     {
         // TODO: Focus() doesn't open date picker popup on UWP, it's known issue
         // on Xamarin.Forms and should be fixed in 2.5. Had to open it manually.
         var flyout = new DatePickerFlyout()
         {
             Placement = FlyoutPlacementMode.Top
         };
         flyout.DatePicked += (s, args) =>
         {
             Control.Date = args.NewDate;
         };
         FlyoutBase.SetAttachedFlyout(Control, flyout);
     }
 }
Beispiel #13
0
        protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.DatePicker> e)
        {
            base.OnElementChanged(e);

            if (Control != null)
            {
                ((MyDatePicker2)Element).ShowDatePicker = new Action(() =>
                {
                    if (((MyDatePicker2)Element).ManualMinDate)
                    {
                        flyout.MinYear = DateTime.SpecifyKind(((MyDatePicker2)Element).MinimumDate, DateTimeKind.Unspecified);
                    }
                    if (((MyDatePicker2)Element).ManualMaxDate)
                    {
                        flyout.MaxYear = DateTime.SpecifyKind(((MyDatePicker2)Element).MaximumDate, DateTimeKind.Unspecified);
                    }

                    flyout.DatePicked -= Flyout_DatePicked;
                    flyout.Date        = Control.Date;
                    flyout.DatePicked += Flyout_DatePicked;
                    FlyoutBase.ShowAttachedFlyout(Control);
                });
                var minYear = DateTime.SpecifyKind(new DateTime(1919, 01, 01), DateTimeKind.Unspecified);
                if (((MyDatePicker2)Element).ManualMinDate)
                {
                    minYear = DateTime.SpecifyKind(((MyDatePicker2)Element).MinimumDate, DateTimeKind.Unspecified);
                }
                var maxYear = DateTime.SpecifyKind(new DateTime(DateTime.MaxValue.Year, DateTime.MaxValue.Month, DateTime.MaxValue.Day), DateTimeKind.Unspecified);
                if (((MyDatePicker2)Element).ManualMaxDate)
                {
                    maxYear = DateTime.SpecifyKind(((MyDatePicker2)Element).MaximumDate, DateTimeKind.Unspecified);
                }
                // TODO: Focus() doesn't open date picker popup on UWP, it's known issue
                // on Xamarin.Forms and should be fixed in 2.5. Had to open it manually.
                flyout = new DatePickerFlyout()
                {
                    Placement = FlyoutPlacementMode.Bottom, MaxYear = maxYear, MinYear = minYear
                };
                flyout.DatePicked += Flyout_DatePicked;
                FlyoutBase.SetAttachedFlyout(Control, flyout);
            }
        }
Beispiel #14
0
        private void DatePickerFlyout_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
        {
            AppTitle.Text = "One 一个";
            var    date         = args.NewDate.DateTime.ToString("yyyy-MM");
            string currentFrame = myFrame.CurrentSourcePageType.ToString();

            if (currentFrame == "OneUWP.HomePage")
            {
                myFrame.Navigate(typeof(HomeMonthPage), date);
            }
            else if (currentFrame == "OneUWP.ReadingPage")
            {
                myFrame.Navigate(typeof(ReadingChoicePage), args.NewDate.DateTime);
            }
            else if (currentFrame == "OneUWP.SerialPage")
            {
                List <string> para = new List <string>();
                para.Add("连载");
                para.Add(date);
                DateTime serialDate = new DateTime(2016, 1, 1);
                if (args.NewDate.DateTime.CompareTo(serialDate) >= 0)
                {
                    myFrame.Navigate(typeof(ReadingMonthPage), para);
                }
            }
            else if (currentFrame == "OneUWP.EssayPage")
            {
                List <string> para = new List <string>();
                para.Add("短篇");
                para.Add(date);
                myFrame.Navigate(typeof(ReadingMonthPage), para);
            }
            else if (currentFrame == "OneUWP.QuestionPage")
            {
                List <string> para = new List <string>();
                para.Add("问题");
                para.Add(date);
                myFrame.Navigate(typeof(ReadingMonthPage), para);
            }
        }
Beispiel #15
0
        void OnDateTimeFly(object sender, TappedRoutedEventArgs e)
        {
            if (ReadOnlyBinding)
            {
                return;
            }

            // uno无法给出相对位置
            TextBlock tb = _grid.Children[0] as TextBlock;
            var       pt = e.GetPosition(null);

            // 无文本内容时按Grid计算
            MatrixTransform trans = string.IsNullOrEmpty(tb.Text) ? _grid.TransformToVisual(null) as MatrixTransform : tb.TransformToVisual(null) as MatrixTransform;

            if (trans == null)
            {
                return;
            }

            bool showDateFly = (pt.X <= trans.Matrix.OffsetX + tb.ActualWidth / 2 + 10) && !_dateInTail;

            if (showDateFly)
            {
                // 日期选择器
                DatePickerFlyout fly = new DatePickerFlyout();
                fly.Date        = Value;
                fly.DatePicked += (s, args) => Value = args.NewDate.DateTime.Date + (Value - Value.Date);
                fly.ShowAt(_grid);
            }
            else
            {
                // 时间选择器
                TimePickerFlyout tf = new TimePickerFlyout();
                tf.Time        = Value - Value.Date;
                tf.TimePicked += (s, args) => Value = Value.Date + args.NewTime;
                tf.ShowAt(_grid);
            }
        }
 private void DatePickerFlyout_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     if (CurrentDate != args.NewDate)
         JumpToDate(args.NewDate);
     sender.DatePicked -= DatePickerFlyout_DatePicked;
 }
Beispiel #17
0
 private async void Radio_Checked(object sender, RoutedEventArgs e) {
     ActiveRadio = (RadioButton)sender;
     if(ActiveRadio == DateRadio) {
         var dpfo = new DatePickerFlyout();
         var result = await dpfo.ShowAtAsync(ContentRoot);
         PriceRadio.IsChecked = true;
         if(result.HasValue) DateField.Text = result.Value.DateTime.ToString("d");
     }
 }
 private void DatePickerFlyout_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     System.DateTime dt = args.NewDate.Date;
     dt = new DateTime(dt.Year, dt.Month, dt.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
     _TaskViewModel.SetExpireDate(dt);
 }
Beispiel #19
0
        //private void TextBlock_Tapped(object sender, TappedRoutedEventArgs e)
        //{
        //    FrameworkElement element = sender as FrameworkElement;
        //    if (element != null)
        //    {
        //        FlyoutBase.ShowAttachedFlyout(element);
        //    }
        //}

        private async void DatePickerFlyout_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
        {
            await new MessageDialog(args.NewDate.ToString()).ShowAsync();
        }
Beispiel #20
0
 private async void DatePickerFlyout_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     await new MessageDialog(args.NewDate.ToString()).ShowAsync();
 }
        public financesPage()
        {
            this.InitializeComponent();
            this.NavigationCacheMode = NavigationCacheMode.Enabled;
            moduleInfo = CloureManager.GetModuleInfo();

            grdFilters.Visibility = Visibility.Collapsed;
            grdFiltersContent.Children.Clear();

            /*
             * foreach (GlobalCommand globalCommand in moduleInfo.globalCommands)
             * {
             *  if (globalCommand.Name != "filters")
             *  {
             *      Button globalCommandButton = new Button();
             *      globalCommandButton.Name = globalCommand.Name;
             *      globalCommandButton.HorizontalContentAlignment = HorizontalAlignment.Center;
             *      globalCommandButton.Style = (Style)Application.Current.Resources["CloureButton"];
             *      globalCommandButton.Content = globalCommand.Title;
             *      //Windows.UI.Xaml.Shapes.Path path = new Windows.UI.Xaml.Shapes.Path();
             *      ToolBar.Children.Add(globalCommandButton);
             *      globalCommandButton.Click += GlobalCommand_Click;
             *  }
             * }
             */

            txtIngresosPrompt.Text   = moduleInfo.locales.GetNamedString("incoming_prompt");
            txtGastosPrompt.Text     = moduleInfo.locales.GetNamedString("outcoming_prompt");
            txtSaldoPrompt.Text      = moduleInfo.locales.GetNamedString("balance_prompt");
            txtSearch.Text           = moduleInfo.locales.GetNamedString("search");
            txtNoRegistersFound.Text = moduleInfo.locales.GetNamedString("no_registers_found");

            foreach (ModuleFilter moduleFilters in moduleInfo.moduleFilters)
            {
                TextBlock textBlock = new TextBlock();
                textBlock.Text = moduleFilters.Title;
                textBlock.HorizontalAlignment = HorizontalAlignment.Stretch;
                textBlock.VerticalAlignment   = VerticalAlignment.Top;
                textBlock.Margin     = new Thickness(5, 5, 5, 0);
                textBlock.Height     = 20;
                textBlock.Foreground = new SolidColorBrush(Colors.White);
                textBlock.FontSize   = 14;
                grdFiltersContent.Children.Add(textBlock);

                if (moduleFilters.Type == "combo")
                {
                    //showDialog(moduleFilters.Default);
                    ComboBox comboFilter = new ComboBox();
                    comboFilter.Name = moduleFilters.Name;
                    comboFilter.HorizontalAlignment = HorizontalAlignment.Stretch;
                    comboFilter.Margin            = new Thickness(5, 0, 5, 10);
                    comboFilter.ItemsSource       = moduleFilters.FilterItems;
                    comboFilter.SelectedValuePath = "Id";
                    comboFilter.DisplayMemberPath = "Title";
                    //comboBox.SelectedIndex = 0;
                    comboFilter.SelectionChanged += ComboFilter_SelectionChanged;
                    grdFiltersContent.Children.Add(comboFilter);
                    comboFilter.SelectedValue = moduleFilters.Default;
                }
                if (moduleFilters.Type == "date")
                {
                    Button           button       = new Button();
                    DatePickerFlyout pickerFlyout = new DatePickerFlyout();
                    button.Flyout              = pickerFlyout;
                    button.Content             = moduleInfo.locales.GetNamedString("select_date");
                    button.Name                = moduleFilters.Name;
                    button.Foreground          = new SolidColorBrush(Colors.White);
                    button.HorizontalAlignment = HorizontalAlignment.Stretch;
                    button.Margin              = new Thickness(5, 0, 5, 10);
                    pickerFlyout.DatePicked   += PickerFlyout_DatePicked;
                    pickerFlyout.Closed       += PickerFlyout_Closed;
                    grdFiltersContent.Children.Add(button);
                }
            }

            Button applybutton = new Button();

            applybutton.Content             = moduleInfo.locales.GetNamedString("apply");
            applybutton.HorizontalAlignment = HorizontalAlignment.Center;
            applybutton.Style  = (Style)Application.Current.Resources["CloureFilterButton"];
            applybutton.Click += Applybutton_Click;
            grdFiltersContent.Children.Add(applybutton);

            LoadData();
        }
 private void Picker_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     Historic.Historic.AddDay(args.NewDate.DateTime);
 }
 private void setDatePicker(CALENDAR_DISPLAY calendarDisplay, DatePickerFlyout datePickerFlyout)
 {
     datePickerFlyout.DayVisible   = calendarDisplay == CALENDAR_DISPLAY.DAY_ONLY;
     datePickerFlyout.MonthVisible = calendarDisplay == CALENDAR_DISPLAY.MONTH_ONLY;
     datePickerFlyout.YearVisible  = calendarDisplay == CALENDAR_DISPLAY.YEAR_ONLY;
 }
 private void DatePickerFlyout_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     timebox.Text = args.NewDate.UtcDateTime.ToString().Substring(0, args.NewDate.UtcDateTime.ToString().Length - 7);
 }
 /// <summary>
 /// 截止日期选择器选择
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private async void DueDatePicker_Picked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     var newDate = args.NewDate;
     if (newDate < DateTime.Now)
     {
         //最好提示用户时间早于当前
         await MessageDialogHelper.MessageDialogShowAsync("日期不得小于当前日期", "截止日期");
         return;
     }
     //ViewModel.Tasks.DueDate.Value.AddMilliseconds = newDate.Date;
     this.txtDueDate.Text = newDate.Date.ToStringDateMDY();
     sender.Hide();
 }
Beispiel #26
0
 private void datePicker0_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
 }
Beispiel #27
0
        public BankChecksPage()
        {
            this.InitializeComponent();
            this.moduleInfo = CloureManager.GetModuleInfo();

            txtSearch.PlaceholderText = moduleInfo.locales.GetNamedString("search");
            txtNoResults.Text         = moduleInfo.locales.GetNamedString("no_results");

            foreach (ModuleFilter moduleFilters in moduleInfo.moduleFilters)
            {
                TextBlock textBlock = new TextBlock();
                textBlock.Text = moduleFilters.Title;
                textBlock.HorizontalAlignment = HorizontalAlignment.Stretch;
                textBlock.VerticalAlignment   = VerticalAlignment.Top;
                textBlock.Margin     = new Thickness(5, 5, 5, 0);
                textBlock.Height     = 20;
                textBlock.Foreground = new SolidColorBrush(Colors.White);
                textBlock.FontSize   = 14;
                grdFiltersContent.Children.Add(textBlock);

                if (moduleFilters.Type == "combo")
                {
                    //showDialog(moduleFilters.Default);
                    ComboBox comboFilter = new ComboBox();
                    comboFilter.Name = moduleFilters.Name;
                    comboFilter.HorizontalAlignment = HorizontalAlignment.Stretch;
                    comboFilter.Margin            = new Thickness(5, 0, 5, 10);
                    comboFilter.ItemsSource       = moduleFilters.FilterItems;
                    comboFilter.SelectedValuePath = "Id";
                    comboFilter.DisplayMemberPath = "Title";
                    //comboBox.SelectedIndex = 0;
                    comboFilter.SelectionChanged += ComboFilter_SelectionChanged;
                    grdFiltersContent.Children.Add(comboFilter);
                    comboFilter.SelectedValue = moduleFilters.Default;
                }
                if (moduleFilters.Type == "date")
                {
                    Button           button       = new Button();
                    DatePickerFlyout pickerFlyout = new DatePickerFlyout();
                    button.Flyout              = pickerFlyout;
                    button.Content             = "Seleccione una fecha";
                    button.Name                = moduleFilters.Name;
                    button.Foreground          = new SolidColorBrush(Colors.White);
                    button.HorizontalAlignment = HorizontalAlignment.Stretch;
                    button.Margin              = new Thickness(5, 0, 5, 10);
                    pickerFlyout.DatePicked   += PickerFlyout_DatePicked;
                    pickerFlyout.Closed       += PickerFlyout_Closed;
                    grdFiltersContent.Children.Add(button);
                }
            }

            Button applybutton = new Button();

            applybutton.Content             = moduleInfo.locales.GetNamedString("apply");
            applybutton.HorizontalAlignment = HorizontalAlignment.Center;
            applybutton.Style  = (Style)Application.Current.Resources["CloureFilterButton"];
            applybutton.Click += Applybutton_Click;
            grdFiltersContent.Children.Add(applybutton);

            LoadData();
        }
 private void AddDateTimeGrid_Tapped(object sender, TappedRoutedEventArgs e)
 {
     DatePickerFlyout datePickerFlyout = new DatePickerFlyout();
     datePickerFlyout.MinYear = DateTime.Now;
     datePickerFlyout.DatePicked += datePickerFlyout_DatePicked;
     datePickerFlyout.ShowAt(Frame);
 }
 private void datePickerFlyout_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     TimePickerFlyout timePickerFlyout = new TimePickerFlyout();
     timePickerFlyout.TimePicked += timePickerFlyout_TimePicked;
     timePickerFlyout.ShowAt(Frame);
     addDate = args.NewDate;
     Debug.WriteLine(addDate.Date.ToString());
 }
Beispiel #30
0
        public PhotographersPerformancePage()
        {
            this.InitializeComponent();

            this.NavigationCacheMode = NavigationCacheMode.Enabled;
            moduleInfo = CloureManager.GetModuleInfo();

            grdFilters.Visibility = Visibility.Collapsed;
            grdFiltersContent.Children.Clear();

            foreach (ModuleFilter moduleFilters in moduleInfo.moduleFilters)
            {
                TextBlock textBlock = new TextBlock();
                textBlock.Text = moduleFilters.Title;
                textBlock.HorizontalAlignment = HorizontalAlignment.Stretch;
                textBlock.VerticalAlignment   = VerticalAlignment.Top;
                textBlock.Margin     = new Thickness(5, 5, 5, 0);
                textBlock.Height     = 20;
                textBlock.Foreground = new SolidColorBrush(Colors.White);
                textBlock.FontSize   = 14;
                grdFiltersContent.Children.Add(textBlock);

                if (moduleFilters.Type == "combo")
                {
                    //showDialog(moduleFilters.Default);
                    ComboBox comboFilter = new ComboBox();
                    comboFilter.Name = moduleFilters.Name;
                    comboFilter.HorizontalAlignment = HorizontalAlignment.Stretch;
                    comboFilter.Margin            = new Thickness(5, 0, 5, 10);
                    comboFilter.ItemsSource       = moduleFilters.FilterItems;
                    comboFilter.SelectedValuePath = "Id";
                    comboFilter.DisplayMemberPath = "Title";
                    //comboBox.SelectedIndex = 0;
                    comboFilter.SelectionChanged += ComboFilter_SelectionChanged;
                    grdFiltersContent.Children.Add(comboFilter);
                    comboFilter.SelectedValue = moduleFilters.Default;
                }
                if (moduleFilters.Type == "date")
                {
                    Button           button       = new Button();
                    DatePickerFlyout pickerFlyout = new DatePickerFlyout();
                    button.Flyout              = pickerFlyout;
                    button.Content             = "Seleccione una fecha";
                    button.Name                = moduleFilters.Name;
                    button.Foreground          = new SolidColorBrush(Colors.White);
                    button.HorizontalAlignment = HorizontalAlignment.Stretch;
                    button.Margin              = new Thickness(5, 0, 5, 10);
                    pickerFlyout.DatePicked   += PickerFlyout_DatePicked;
                    pickerFlyout.Closed       += PickerFlyout_Closed;
                    grdFiltersContent.Children.Add(button);
                }
            }

            Button applybutton = new Button();

            applybutton.Content             = "Aplicar";
            applybutton.HorizontalAlignment = HorizontalAlignment.Center;
            applybutton.Style  = (Style)Application.Current.Resources["CloureSecondaryButton"];
            applybutton.Click += Applybutton_Click;
            grdFiltersContent.Children.Add(applybutton);

            LoadData();
        }
 private void DatePickerFlyout_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     this.btnDatePicker.Content = this.datePicker.Date.ToString();//"you have click the datePicker";
 }
Beispiel #32
0
        private void DataPicked_Event(DatePickerFlyout sender, DatePickedEventArgs args)
        {
            var Memo_Date = sender.Date.Year.ToString() + "年" + sender.Date.Month.ToString() + "月" + sender.Date.Day.ToString() + "日";

            Calendar_TextBlock.Text = Memo_Date;
        }
 private void Picker_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     Historic.Historic.AddDay(args.NewDate.DateTime);
 }
 private void DateButton_Click(object sender, RoutedEventArgs e)
 {
     _datePickerFlyout = new DatePickerFlyout();
     _datePickerFlyout.Date = CurrentDate;
     _datePickerFlyout.DatePicked += DatePickerFlyout_DatePicked;
     _datePickerFlyout.ShowAt(dateDisplayButton);
 }
 private void AddDayFlyout_Click(object sender, RoutedEventArgs e)
 {
     FrameworkElement senderElement = sender as FrameworkElement;
     DatePickerFlyout picker = new DatePickerFlyout();
     picker.ShowAt(senderElement);
     picker.DatePicked += Picker_DatePicked;
 }
 private void EndDatePickerFlyout_OnDatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     if (!ViewModel.EndDateValid)
         ViewModel.EndDateTimeOffset = ViewModel.EndDateTimeOffset;
 }
 public DatePickerFlyoutEvents(DatePickerFlyout This)
     : base(This)
 {
     this.This = This;
 }
Beispiel #38
0
        private void PickerFlyout_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
        {
            Button button = (Button)sender.Target;

            button.Content = sender.Date.ToString("dd/MM/yyyy");
        }
 private void dpfCoreDate_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     btnCoreDate.Content = dpfCoreDate.Date.Date.ToShortDateString();
 }
 private void dpfBirthdate_DatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     btnBirthdate.Content = CalculateAge();
 }
Beispiel #41
0
 private async void OnDatePicked(DatePickerFlyout sender, DatePickedEventArgs args)
 {
     await new MessageDialog($"date changed to {args.NewDate}").ShowAsync();
 }