Exemplo n.º 1
0
        /// <summary>
        /// A Windows UI ComboBox
        /// </summary>
        /// <returns>ComboBox</returns>
        internal WUX.Controls.Control GetCombobox()
        {
            var comboBox = new WUX.Controls.ComboBox()
            {
                HorizontalAlignment = WUX.HorizontalAlignment.Left,
                Margin = new WUX.Thickness(0, 10, 0, 0)
            };

            comboBox.Items.Add("Apple");
            comboBox.Items.Add("Bannana");
            comboBox.Items.Add("Cedar");
            return(comboBox);
        }
Exemplo n.º 2
0
 public static void SetValueType(Windows.UI.Xaml.Controls.ComboBox attached, bool value)
 {
     attached.SetValue(ValueTypeProperty, value);
 }
Exemplo n.º 3
0
 public static bool GetValueType(Windows.UI.Xaml.Controls.ComboBox attached)
 {
     return((bool)attached.GetValue(ValueTypeProperty));
 }
        private void WindowsXamlHost_Loaded(object sender, RoutedEventArgs e)
        {
            windows.UI.Xaml.Controls.StackPanel stackPanel = new windows.UI.Xaml.Controls.StackPanel()
            {
                Background = new windows.UI.Xaml.Media.SolidColorBrush(windows.UI.Colors.Black),
            };

            stackPanel.Children.Add(new windows.UI.Xaml.Shapes.Rectangle()
            {
                Width  = 50,
                Height = 75,
                Fill   = new windows.UI.Xaml.Media.SolidColorBrush(windows.UI.Colors.Blue),
            });

            stackPanel.Children.Add(new windows.UI.Xaml.Shapes.Rectangle()
            {
                Width  = 200,
                Height = 30,
                Fill   = new windows.UI.Xaml.Media.SolidColorBrush(windows.UI.Colors.Red),
            });

            var button = new windows.UI.Xaml.Controls.Button()
            {
                Width  = 160,
                Height = 60,
                HorizontalAlignment = windows.UI.Xaml.HorizontalAlignment.Center,
                Content             = "ContentDialog UWP Button",
            };

            button.Tapped += Button_Tapped;
            stackPanel.Children.Add(button);

            stackPanel.Children.Add(new windows.UI.Xaml.Shapes.Rectangle()
            {
                Width  = 25,
                Height = 100,
                Fill   = new windows.UI.Xaml.Media.SolidColorBrush(windows.UI.Colors.Green),
            });

            windows.UI.Xaml.Controls.Flyout flyout = new windows.UI.Xaml.Controls.Flyout();
            flyout.Content = new windows.UI.Xaml.Controls.TextBlock()
            {
                Text = "Flyout content",
            };

            var button2 = new windows.UI.Xaml.Controls.Button()
            {
                Width  = 300,
                Height = 40,
                HorizontalAlignment = windows.UI.Xaml.HorizontalAlignment.Center,
                Content             = "Long UWP Button with Flyout",
                Flyout = flyout,
            };

            stackPanel.Children.Add(button2);

            var comboBox = new windows.UI.Xaml.Controls.ComboBox()
            {
                HorizontalAlignment = windows.UI.Xaml.HorizontalAlignment.Center,
            };

            comboBox.Items.Add("One");
            comboBox.Items.Add("Two");
            comboBox.Items.Add("Three");
            comboBox.Items.Add("Four");
            stackPanel.Children.Add(comboBox);

            windows.UI.Xaml.Controls.Grid grid = new windows.UI.Xaml.Controls.Grid();
            stackPanel.Children.Add(grid);

            _contentDialog         = new windows.UI.Xaml.Controls.ContentDialog();
            _contentDialog.Content = new windows.UI.Xaml.Controls.TextBlock()
            {
                Text = "ContentDialog content",
            };
            stackPanel.Children.Add(_contentDialog);

            var popup = new windows.UI.Xaml.Controls.Primitives.Popup()
            {
                Width  = 50,
                Height = 50,
                ShouldConstrainToRootBounds = false,
                Child = new windows.UI.Xaml.Controls.TextBlock()
                {
                    Text = "Popup child",
                },
            };

            grid.Children.Add(popup);

            windowsXamlHost.Child = stackPanel;
            popup.IsOpen          = true;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Gets the <see cref="DropDownPlacement"/> of a ComboBox. (cf. Remarks)
 /// </summary>
 /// <remarks>
 /// This is only the preferred placement, the combo will still ensure to keep its drop down in the visual bounds of the window
 /// (When content cannot be rendered out of the current window ...)
 /// </remarks>
 /// <param name="combo">The target ComboBox</param>
 /// <returns>The updates mode of the <paramref name="combo"/>.</returns>
 public static DropDownPlacement GetDropDownPreferredPlacement(Windows.UI.Xaml.Controls.ComboBox combo)
 => (DropDownPlacement)combo.GetValue(DropDownPreferredPlacementProperty);
Exemplo n.º 6
0
 /// <summary>
 /// Sets the preferred <see cref="DropDownPlacement"/> of a ComboBox. (cf. Remarks)
 /// </summary>
 /// <remarks>
 /// This is only the preferred placement, the combo will still ensure to keep its drop down in the visual bounds of the window
 /// (When content cannot be rendered out of the current window ...)
 /// </remarks>
 /// <param name="combo">The target ComboBox to configure</param>
 /// <param name="mode">The updates mode to set</param>
 public static void SetDropDownPreferredPlacement(Windows.UI.Xaml.Controls.ComboBox combo, DropDownPlacement mode)
 => combo.SetValue(DropDownPreferredPlacementProperty, mode);