Exemple #1
0
 public static void SetPageHeaderCommandsMergeTarget(CommandBar obj, bool value)
 => obj.SetValue(PageHeaderCommandsMergeTargetProperty, value);
 public static void SetSubtitle(this CommandBar commandBar, string subtitle)
 {
     commandBar.SetValue(SubtitleProperty, subtitle);
 }
Exemple #3
0
        private void createScheduleSkeleton()
        {
            for (int rows = 0; rows < 8; rows++)
            {
                RowDefinition rd = new RowDefinition();
                if (rows == 7)
                {
                    rd.Height = Windows.UI.Xaml.GridLength.Auto;
                }
                scheduleGrid.RowDefinitions.Add(rd);
            }
            for (int cols = 0; cols < 2; cols++)
            {
                scheduleGrid.ColumnDefinitions.Add(new ColumnDefinition());
            }
            TextBlock txt = new TextBlock();

            txt.Text       = "Max hours: ";
            txt.Foreground = new SolidColorBrush(Windows.UI.Colors.Black);
            txt.SetValue(Grid.ColumnProperty, 0);
            txt.SetValue(Grid.RowProperty, 0);
            scheduleGrid.Children.Add(txt);
            ComboBox comboBox = new ComboBox();

            comboBox.Name = "MaxHoursComboBox";
            for (int i = 1; i <= 10; i++)
            {
                comboBox.Items.Add(i);
            }
            comboBox.SelectionChanged += onMaxHoursChanged;
            comboBox.SetValue(Grid.ColumnProperty, 1);
            comboBox.SetValue(Grid.RowProperty, 0);
            scheduleGrid.Children.Add(comboBox);
            for (int i = 1; i < 7; i++)
            {
                string text = string.Empty;
                switch (i)
                {
                case 1: text = "Hour"; break;

                case 2: text = "Mon"; break;

                case 3: text = "Tue"; break;

                case 4: text = "Wed"; break;

                case 5: text = "Thu"; break;

                case 6: text = "Fri"; break;
                }
                TextBlock tb = new TextBlock();
                tb.Text                = text;
                tb.Foreground          = new SolidColorBrush(Windows.UI.Colors.Black);
                tb.VerticalAlignment   = Windows.UI.Xaml.VerticalAlignment.Center;
                tb.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center;
                tb.FontWeight          = Windows.UI.Text.FontWeights.SemiBold;
                Border b = new Border();
                b.Child           = tb;
                b.Background      = new SolidColorBrush(Windows.UI.Colors.LightGray);
                b.BorderBrush     = new SolidColorBrush(Windows.UI.Colors.Black);
                b.BorderThickness = new Thickness(1);
                b.SetValue(Grid.ColumnProperty, 0);
                b.SetValue(Grid.RowProperty, i);
                scheduleGrid.Children.Add(b);
                AppBarButton acceptBtn = new AppBarButton();
                acceptBtn.Icon   = new SymbolIcon(Symbol.Accept);
                acceptBtn.Label  = "Accept";
                acceptBtn.Click += onAcceptBtnClick;
                CommandBar cb = new CommandBar();
                cb.Name = "commandBar";
                cb.VerticalAlignment = VerticalAlignment.Bottom;
                cb.PrimaryCommands.Add(acceptBtn);
                cb.SetValue(Grid.RowProperty, 7);
                cb.SetValue(Grid.ColumnProperty, 0);
                cb.SetValue(Grid.ColumnSpanProperty, scheduleGrid.ColumnDefinitions.Count);

                scheduleGrid.Children.Add(cb);
            }
        }
 public static void SetHideMoreButton(CommandBar d, bool value)
 {
     d.SetValue(HideMoreButtonProperty, value);
 }