• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Controls.StackPanel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Windows.UI.Xaml.Controls.StackPanel的典型用法代码示例。如果您正苦于以下问题:C# StackPanel类的具体用法?C# StackPanel怎么用?C# StackPanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StackPanel类属于Windows.UI.Xaml.Controls命名空间,在下文中一共展示了StackPanel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: InitializeComponent

        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///CommentPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (TheBellyofAuthority.Common.LayoutAwarePage)this.FindName("pageRoot");
            commentBar = (Windows.UI.Xaml.Controls.AppBar)this.FindName("commentBar");
            DeleteButton = (Windows.UI.Xaml.Controls.Button)this.FindName("DeleteButton");
            EditButton = (Windows.UI.Xaml.Controls.Button)this.FindName("EditButton");
            commentThread = (Windows.UI.Xaml.Controls.ListView)this.FindName("commentThread");
            commentLabel = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("commentLabel");
            commentBox = (Windows.UI.Xaml.Controls.TextBox)this.FindName("commentBox");
            postButton = (Windows.UI.Xaml.Controls.Button)this.FindName("postButton");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            UserPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("UserPanel");
            progBar = (Windows.UI.Xaml.Controls.ProgressBar)this.FindName("progBar");
            LabelBox = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("LabelBox");
            UserBox = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("UserBox");
            ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ApplicationViewStates");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
        }
开发者ID:abettadapur,项目名称:BellyofAuthorityMX,代码行数:28,代码来源:CommentPage.g.i.cs


示例2: HomeWorkList

        public HomeWorkList(double w, double h, string icon)
        {
            this.Width = w;
            this.Height = h;
            _icon = icon;
            _mainpanel = new StackPanel() 
            {
                Width = w,
                Orientation = Orientation.Vertical,
                VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top                 
            };

            _mainscroll = new ScrollViewer()
            {
                Width = w,
                Height =h ,
                HorizontalScrollMode = ScrollMode.Disabled,
                VerticalScrollMode = ScrollMode.Enabled,
                HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled,
                VerticalScrollBarVisibility = ScrollBarVisibility.Auto
            };

            this.Children.Add(_mainscroll);
            _mainscroll.Content = _mainpanel;
        }
开发者ID:Milton761,项目名称:mLearningCoreEN,代码行数:25,代码来源:HomeWorkList.cs


示例3: init

        void init()
        {
            Width = DeviceWidth;
            Height = DeviceHeight;
            _elements = new List<ISlideElement>();
            //Scrol view
            _mainscroll = new ScrollViewer()
            {
                HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled,
                VerticalScrollBarVisibility = ScrollBarVisibility.Hidden,
                VerticalScrollMode = ScrollMode.Auto,
                Width = DeviceWidth,
                Height = DeviceHeight,
                ZoomMode = ZoomMode.Enabled
            };
            Children.Add(_mainscroll);

            _paneltransform = new CompositeTransform();

            _contentpanel = new StackPanel()
            {
                Orientation = Orientation.Vertical,
                Width = DeviceWidth,
                RenderTransform = _paneltransform
            };
            _mainscroll.Content = _contentpanel;

        }
开发者ID:Milton761,项目名称:mLearningCoreEN,代码行数:28,代码来源:BackgroundScroll.cs


示例4: InitializeComponent

        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///Tweet.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (Mu_genotype1.Common.LayoutAwarePage)this.FindName("pageRoot");
            primaryColumn = (Windows.UI.Xaml.Controls.ColumnDefinition)this.FindName("primaryColumn");
            titlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("titlePanel");
            itemListScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer");
            itemListScrollViewer2 = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemListScrollViewer2");
            PeerTweets = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PeerTweets");
            itemListView2 = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView2");
            TweetBox = (Windows.UI.Xaml.Controls.TextBox)this.FindName("TweetBox");
            TweetIt = (Windows.UI.Xaml.Controls.Button)this.FindName("TweetIt");
            PinPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("PinPanel");
            itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView");
            PinTb = (Windows.UI.Xaml.Controls.TextBox)this.FindName("PinTb");
            VerifyPinButton = (Windows.UI.Xaml.Controls.Button)this.FindName("VerifyPinButton");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            pageSubtitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageSubtitle");
            FullScreenLandscape = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenLandscape");
            Filled = (Windows.UI.Xaml.VisualState)this.FindName("Filled");
            FullScreenPortrait = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait");
            FullScreenPortrait_Detail = (Windows.UI.Xaml.VisualState)this.FindName("FullScreenPortrait_Detail");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
            Snapped_Detail = (Windows.UI.Xaml.VisualState)this.FindName("Snapped_Detail");
            TwitterConnectBtn = (Windows.UI.Xaml.Controls.Button)this.FindName("TwitterConnectBtn");
            RefreshButton = (Windows.UI.Xaml.Controls.Button)this.FindName("RefreshButton");
        }
开发者ID:sagar-sm,项目名称:Mu,代码行数:33,代码来源:Tweet.g.i.cs


示例5: AddExample

        private void AddExample(IpaSymbol ipaSymbol)
        {
            TextBlock letterBlock = new TextBlock();
            letterBlock.Style = this.Resources["LetterStyle"] as Style;
            letterBlock.Text = ipaSymbol.Value;

            TextBlock exampleBlock = new TextBlock();
            exampleBlock.Style = this.Resources["ExampleStyle"] as Style;
            IpaSymbol.SetExampleBlock(exampleBlock);

            StackPanel stackPanel = new StackPanel();
            stackPanel.VerticalAlignment = VerticalAlignment.Center;
            stackPanel.Children.Add(letterBlock);
            stackPanel.Children.Add(exampleBlock);

            Grid grid = new Grid();
            grid.Background = ipaSymbol.BackgroundBrush;
            grid.Height = Window.Current.Bounds.Height;
            grid.Children.Add(stackPanel);

            WordsPanel.Children.Add(grid);
            WordsPanel.InvalidateArrange();
            Debug.WriteLine(grid.ActualHeight);
            //Debug.WriteLine(WordsPanel.Children.Count);
        }
开发者ID:kiewic,项目名称:WindowsStoreApps,代码行数:25,代码来源:MainPage.xaml.cs


示例6: OnApplyTemplate

        /// <summary>
        /// Invoked whenever application code or internal processes (such as a rebuilding
        /// layout pass) call <see cref="OnApplyTemplate"/>. In simplest terms, this means the method
        /// is called just before a UI element displays in an application. Override this
        /// method to influence the default post-template logic of a class.
        /// </summary>
        protected override void OnApplyTemplate()
        {
            contentGrid = this.GetTemplateChild(PART_CONTENT_GRID) as Grid;
            commandContainer = this.GetTemplateChild(PART_COMMAND_CONTAINER) as Grid;
            leftCommandPanel = this.GetTemplateChild(PART_LEFT_COMMAND_PANEL) as StackPanel;
            rightCommandPanel = this.GetTemplateChild(PART_RIGHT_COMMAND_PANEL) as StackPanel;

            transform = contentGrid.RenderTransform as CompositeTransform;

            leftCommandTransform = leftCommandPanel.RenderTransform as CompositeTransform;
            rightCommandTransform = rightCommandPanel.RenderTransform as CompositeTransform;

            contentGrid.ManipulationDelta += ContentGrid_ManipulationDelta;
            contentGrid.ManipulationCompleted += ContentGrid_ManipulationCompleted;

            contentAnimation = new DoubleAnimation();
            Storyboard.SetTarget(contentAnimation, transform);
            Storyboard.SetTargetProperty(contentAnimation, "TranslateX");
            contentAnimation.To = 0;
            contentAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(100));

            contentStoryboard = new Storyboard();
            contentStoryboard.Children.Add(contentAnimation);

            commandContainer.Background = LeftBackground as SolidColorBrush;

            base.OnApplyTemplate();
        }
开发者ID:KooKiz,项目名称:comet,代码行数:34,代码来源:SlidableListItem.cs


示例7: init

        void init()
        {
            Width = DeviceWidth;
            Height = DeviceHeight;
            _actualheight = DeviceHeight;

            _contentpanel = new StackPanel() { Orientation = Orientation.Vertical };
            _contentpanel.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Left;
            _contentpanel.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top;
            _contentpanel.RenderTransform = new CompositeTransform() { TranslateX = 320 };
            _contentpanel.SizeChanged += _contentpanel_SizeChanged;
            _contentpanel.Width = 586.0;
            
            Children.Add(_contentpanel);

            Grid header = new Grid() { Width = 100.0, Height = 214.0 };
            Grid footer = new Grid() { Width = 100.0, Height = 214.0 };
            Grid separation = new Grid() { Width = 100.0, Height = 66.0 };
            _titleblock = new TextBlock() { TextWrapping = Windows.UI.Xaml.TextWrapping.Wrap, FontSize = 56 };
            _titleblock.LayoutUpdated += _titleblock_LayoutUpdated;

            _itemspanel = new StackPanel() { Orientation = Orientation.Vertical };
            _itemspanel.LayoutUpdated += _itemspanel_LayoutUpdated;
            _itemspanel.Width = 560.0;

            //childrens of content
            _contentpanel.Children.Add(header);
            _contentpanel.Children.Add(_titleblock);
            _contentpanel.Children.Add(separation);
            _contentpanel.Children.Add(_itemspanel);
            _contentpanel.Children.Add(footer);
        }
开发者ID:Milton761,项目名称:mLearningCoreEN,代码行数:32,代码来源:ItemizeTextElement.cs


示例8: InitializeComponent

        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-resource://spotifyapp/Files/View/CollectionSummaryPage.xaml"));

            CollectionViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("CollectionViewSource");
            LayoutRoot = (Windows.UI.Xaml.Controls.Grid)this.FindName("LayoutRoot");
            OrientationStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("OrientationStates");
            Full = (Windows.UI.Xaml.VisualState)this.FindName("Full");
            Fill = (Windows.UI.Xaml.VisualState)this.FindName("Fill");
            Portrait = (Windows.UI.Xaml.VisualState)this.FindName("Portrait");
            Snapped = (Windows.UI.Xaml.VisualState)this.FindName("Snapped");
            ScrollViewer = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("ScrollViewer");
            CategoryPanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("CategoryPanel");
            HeaderTitlePanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("HeaderTitlePanel");
            ItemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("ItemGridView");
            ItemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView");
            Title = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("Title");
            Image = (Windows.UI.Xaml.Controls.Image)this.FindName("Image");
            DescriptionText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("DescriptionText");
            BackButton = (Windows.UI.Xaml.Controls.Button)this.FindName("BackButton");
            PageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PageTitle");
        }
开发者ID:beaugunderson,项目名称:Spotify-Metro-Style-App,代码行数:26,代码来源:CollectionSummaryPage.g.i.cs


示例9: BulletPoint

        public static StackPanel BulletPoint(string contents, string bulletCode)
        {
            StackPanel member = new StackPanel()
            {
                Orientation = Orientation.Horizontal
            };

            TextBlock bullet = new TextBlock()
            {
                Text = bulletCode,
                Width = 40,
                FontSize = 30
            };

            TextBlock content = new TextBlock()
            {
                Width = 300,
                TextWrapping = Windows.UI.Xaml.TextWrapping.WrapWholeWords,
                Text = contents,
                FontSize = 20
            };

            member.Children.Add(bullet);
            member.Children.Add(content);

            var margin = member.Margin;
            margin.Bottom = 10;
            member.Margin = margin;

            return member;
        }
开发者ID:KarthikMAM,项目名称:Paradigm,代码行数:31,代码来源:EventDetail.xaml.cs


示例10: EventItem

        public static StackPanel EventItem(string eventName, string imagePath)
        {
            StackPanel member = new StackPanel()
            {
                Name = eventName,
                Orientation = Orientation.Horizontal
            };

            Image photo = new Image()
            {
                Height = 50,
                Stretch = Stretch.Fill,
                Source = new BitmapImage(new Uri("ms-appx:///Assets/Sigil/" + imagePath))
            };

            member.Children.Add(photo);

            TextBlock eventsName = new TextBlock()
            {
                Width = 300,
                TextWrapping = Windows.UI.Xaml.TextWrapping.Wrap,
                Text = eventName,
                FontSize = 25
            };

            var margin = member.Margin;
            margin.Left = margin.Right = margin.Top = margin.Bottom = 5;
            eventsName.Margin = member.Margin = margin;

            member.Children.Add(eventsName);

            return member;
        }
开发者ID:KarthikMAM,项目名称:Paradigm,代码行数:33,代码来源:EventList.xaml.cs


示例11: IndiagramView

 public IndiagramView()
 {
     Orientation = Orientation.Vertical;
     var indiaSize = SettingsService.IndiagramDisplaySize;
     var margin = indiaSize / 10;
     Width = indiaSize + 2 * margin;
     Children.Clear();
     _image = new Image()
     {
         Margin = new Thickness(0, margin, 0, 0),
         Height = SettingsService.IndiagramDisplaySize,
         Width = SettingsService.IndiagramDisplaySize,
     };
     _textBlock = new TextBlock()
     {
         Margin = new Thickness(margin, 0, margin, 0),
         FontSize = SettingsService.FontSize,
         TextWrapping = TextWrapping.Wrap,
         HorizontalAlignment = HorizontalAlignment.Center,
         FontFamily = new FontFamily(SettingsService.FontName)
     };
     _redRect = new StackPanel()
     {
         Margin = new Thickness(0, margin, 0, 0),
         Height = SettingsService.IndiagramDisplaySize,
         Width = SettingsService.IndiagramDisplaySize,
         Background = new SolidColorBrush(Colors.Red)
     };
     Children.Insert(0, _image);
     Children.Add(_textBlock);
 }
开发者ID:india-rose,项目名称:xamarin-indiarose,代码行数:31,代码来源:IndiagramView.cs


示例12: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            try
            {
                ObservableCollection<MalfunctionGroup> malfunctionGroupItems = ReadDataHelper.GetAll<MalfunctionGroup>();
                ObservableCollection<Malfunction> malfunctions = ReadDataHelper.GetAll<Malfunction>();

                foreach (MalfunctionGroup item in malfunctionGroupItems)
                {
                    var stackPanel = new StackPanel();
                    int itemId = item.Id;
                    foreach (Malfunction malfunction in malfunctions.Where(i => i.GroupId == itemId))
                    {
                        stackPanel.Children.Add(LayoutObjectFactory.CreateTextBlock(malfunction.Text));
                    }

                    if (MalfunctionBlock.Items != null)
                    {
                        MalfunctionBlock.Items.Add(LayoutObjectFactory.CreatePivotItem(item.Text, stackPanel));
                    }
                }

                LayoutObjectFactory.AddBottomAppBar(this);
            }
            catch (Exception)
            {
                Frame.Navigate(typeof (ErrorPage));
            }
        }
开发者ID:nastachka,项目名称:pdd,代码行数:29,代码来源:MalfunctionPage.xaml.cs


示例13: showDialog

        private async void showDialog()
        {
            dialog = new ContentDialog()
            {
                Title = "Authenticeren met de Hue Bridge",
                MaxWidth = this.ActualWidth,
                Background = new SolidColorBrush(Color.FromArgb(0xff, 0xff, 0xff, 0xff))
            };

            var panel = new StackPanel();

            panel.Children.Add(new TextBlock
            {
                Text = "Druk op de link knop op uw Hue bridge om verbinding te maken.",
                TextWrapping = TextWrapping.Wrap
            });

            BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/smartbridge.jpg"));

            panel.Children.Add(new Image
            {
                Source = bitmapImage
            });

            dialog.Content = panel;
            var result = await dialog.ShowAsync();
        }
开发者ID:Intrexion,项目名称:UWP-Hue,代码行数:27,代码来源:ListPage.xaml.cs


示例14: ChangeButtonsAmount

        public void ChangeButtonsAmount(int amount)
        {
            ButtonsPanel.Children.Clear();

            for (int i = 0; i < amount; i++)
            {
                TextBlock tempTextBlock = new TextBlock();
                Button tempButton = new Button();
                StackPanel tempPanel = new StackPanel();

                tempTextBlock.Text = (i + 1).ToString();
                tempTextBlock.TextAlignment = TextAlignment.Center;
                tempTextBlock.Width = tempButton.Width;

                tempButton.Name = "AdditionalButton";
                tempButton.Template = ButtonTemplate;
                tempButton.Content = i + 1;
                tempButton.Click += ButtonPressed;

                tempPanel.Children.Add(tempTextBlock);
                tempPanel.Children.Add(tempButton);
                tempPanel.Width = tempButton.Width;

                ButtonsPanel.Children.Add(tempPanel);
                ButtonsPanel.Width += tempButton.Width;
            }
        }
开发者ID:GudoshnikovaAnna,项目名称:qreal,代码行数:27,代码来源:GamepadPage.xaml.cs


示例15: showPopup_Click

        private void showPopup_Click(object sender, RoutedEventArgs e)
        {
            // Create some content to show in the popup. Typically you would // create a user control.
            Border border = new Border();
            border.BorderThickness = new Thickness(5.0);

            StackPanel panel1 = new StackPanel();

            Button button1 = new Button();
            button1.Content = "Close";
            button1.Margin = new Thickness(5.0);
            button1.Click += new RoutedEventHandler(button1_Click);
            TextBlock textblock1 = new TextBlock();
            textblock1.Text = "The popup control";
            textblock1.Margin = new Thickness(5.0);
            panel1.Children.Add(textblock1);
            panel1.Children.Add(button1);
            border.Child = panel1;

            MoviePlayer MovieFrame = new MoviePlayer(ref p);

            // Set the Child property of Popup to the border // which contains a stackpanel, textblock and button.
            p.Child = MovieFrame;

            // Set where the popup will show up on the screen.
            p.VerticalOffset = 110;
            p.HorizontalOffset = 0;

            // Open the popup.
            p.IsLightDismissEnabled = true;
            p.IsOpen = true;
        }
开发者ID:alexsb92,项目名称:TheMovieTrailerApp,代码行数:32,代码来源:StartPage.xaml.cs


示例16: ColorButtons

 /// <summary>
 /// This method will change the style of each AppBarButton to use a green foreground color
 /// </summary>
 /// <param name="panel"></param>
 private void ColorButtons(StackPanel panel)
 {
     int count = 0;
     foreach (var item in panel.Children)
     {
         // For AppBarButton, change the style
         if (item.GetType() == typeof(AppBarButton))
         {
             if (count == 0)
             {
                 originalButtonStyle = ((AppBarButton)item).Style;
             }
             ((AppBarButton)item).Style = rootPage.Resources["GreenAppBarButtonStyle"] as Style;
             count++;
         }
         else
         {
             // For AppBarSeparator(s), just change the foreground color
             if (item.GetType() == typeof(AppBarSeparator))
             {
                 originalSeparatorBrush = ((AppBarSeparator)item).Foreground;
                 ((AppBarSeparator)item).Foreground = new SolidColorBrush(Color.FromArgb(255, 90, 200, 90));
             }
         }
     }
 }
开发者ID:ckc,项目名称:WinApp,代码行数:30,代码来源:Scenario2_CustomizeColor.xaml.cs


示例17: MainPage

        public MainPage()
        {
            this.InitializeComponent();

            for (var i = 0; i < 5; i++) // The 5 here could be any number
            {
                StackPanel sp = new StackPanel
                {
                    Name = "myPanel" + i,
                    Orientation = Orientation.Horizontal
                };
                myStackPanel.Children.Add(sp);

                for (var j = 0; j < 10; j++) // The 10 here could be any number
                {
                    sp.Children.Add(new Rectangle
                    {
                        Name = "myRectangle" + i + "-" + j,
                        Fill = new SolidColorBrush(Colors.Black),
                        Width = 20,
                        Height = 20,
                        Margin = new Thickness(1)
                    });
                }
            }
        }
开发者ID:Myfreedom614,项目名称:UWP-Samples,代码行数:26,代码来源:MainPage.xaml.cs


示例18: Scan

        public async void Scan()
        {
            var access = await WiFiAdapter.RequestAccessAsync();
            var result = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(WiFiAdapter.GetDeviceSelector());
            if (result.Count >= 1)
            {
                 nwAdapter = await WiFiAdapter.FromIdAsync(result[0].Id);
                await nwAdapter.ScanAsync();

                sp.Children.Clear();
                foreach (var item in nwAdapter.NetworkReport.AvailableNetworks)
                {
                    StackPanel s = new StackPanel();
                    s.Orientation = Orientation.Horizontal;
                    Button b = new Button();
                    TextBlock t = new TextBlock();
                    t.Text = $"{item.NetworkRssiInDecibelMilliwatts} {item.ChannelCenterFrequencyInKilohertz} {item.IsWiFiDirect} {item.NetworkKind} {item.SecuritySettings.NetworkAuthenticationType} {item.SecuritySettings.NetworkAuthenticationType} {item.SignalBars} {item.Uptime}";
                    b.Content += item.Ssid;
                    
                    b.Click += B_Click;
                    s.Children.Add(b);
                    s.Children.Add(t);
                    sp.Children.Add(s);

                }
            }
        }
开发者ID:n01d,项目名称:w10demoking,代码行数:27,代码来源:wifi.xaml.cs


示例19: ColorList1Page

        public ColorList1Page() {
            this.InitializeComponent();

            IEnumerable<PropertyInfo> properties = typeof(Colors).GetTypeInfo().DeclaredProperties;

            foreach (PropertyInfo property in properties) {
                Color clr = (Color)property.GetValue(null);

                StackPanel vertStackPanel = new StackPanel { VerticalAlignment = VerticalAlignment.Center };
                TextBlock txtblkName = new TextBlock {
                    Text = property.Name,
                    FontSize = 24 };
                TextBlock txtblkRgb = new TextBlock {
                    Text = String.Format("{0:X2}-{1:X2}-{2:X2}-{3:X2}", clr.A, clr.R, clr.G, clr.B),
                    FontSize = 18
                };
                vertStackPanel.Children.Add(txtblkName);
                vertStackPanel.Children.Add(txtblkRgb);

                StackPanel horzStackPanel = new StackPanel { Orientation = Orientation.Horizontal };
                Rectangle rectangle = new Rectangle {
                    Width = 72,
                    Height = 72,
                    Fill = new SolidColorBrush(clr),
                    Margin = new Thickness(6)
                };
                horzStackPanel.Children.Add(rectangle);
                horzStackPanel.Children.Add(vertStackPanel);
                stackPanel.Children.Add(horzStackPanel);

            }

        }
开发者ID:ronlemire2,项目名称:UWP-Testers,代码行数:33,代码来源:ColorList1Page.xaml.cs


示例20: init

        void init()
        {
            Width = 1600.0;
            Height = 900.0;
            _currentHeight = 900.0;

            _contentpanel = new StackPanel() { Orientation = Orientation.Vertical };
            _contentpanel.HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Right;
            _contentpanel.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top;
            _contentpanel.RenderTransform = new CompositeTransform() { TranslateX = -160.0 };
            _contentpanel.Width = 560.0;
            //_contentpanel.Background = new SolidColorBrush(Colors.YellowGreen);
            _contentpanel.SizeChanged += _contentpanel_SizeChanged;
            Children.Add(_contentpanel);

            Grid header = new Grid() { Width = 100.0, Height = 182.0 };
            Grid footer = new Grid() { Width = 100.0, Height = 182.0 };
            Grid separation = new Grid() { Width = 100.0, Height = 66.0 };
            _titleblock = new TextBlock() { TextWrapping = Windows.UI.Xaml.TextWrapping.Wrap, FontSize = 56 , TextAlignment = Windows.UI.Xaml.TextAlignment.Right};
            _titleblock.LayoutUpdated +=_titleblock_LayoutUpdated;
            _contentblock = new TextBlock() { TextWrapping = Windows.UI.Xaml.TextWrapping.Wrap, FontSize = 33, FontWeight = Windows.UI.Text.FontWeights.Light, TextAlignment = Windows.UI.Xaml.TextAlignment.Right };
            _contentblock.LayoutUpdated += _contentblock_LayoutUpdated;

            //childrens of content
            _contentpanel.Children.Add(header);
            _contentpanel.Children.Add(_titleblock);
            _contentpanel.Children.Add(separation);
            _contentpanel.Children.Add(_contentblock);
            _contentpanel.Children.Add(footer);
        }
开发者ID:Milton761,项目名称:mLearningCoreEN,代码行数:30,代码来源:RigthTextElement.cs



注:本文中的Windows.UI.Xaml.Controls.StackPanel类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Controls.TextBlock类代码示例发布时间:2022-05-26
下一篇:
C# Controls.SelectionChangedEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap