当前位置: 首页>>代码示例>>C#>>正文


C# Controls.WrapPanel类代码示例

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


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

示例1: CreateTabItem

 public static TabItem CreateTabItem(WrapPanel headerPanel, Grid textBoxGrid)
 {
     TabItem tabItem = new TabItem();
     tabItem.Header = headerPanel;
     tabItem.Content = textBoxGrid;
     return tabItem;
 }
开发者ID:vasily-kirichenko,项目名称:vsClojure,代码行数:7,代码来源:ReplUserInterfaceFactory.cs

示例2: AddParameter

        private void AddParameter(int? paramId = null, string compareType = null, string paramValue = null)
        {
            editRule.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });

            var wp = new WrapPanel { Name = ParameterPanel};
            Grid.SetRow(wp, editRule.RowDefinitions.Count - 1);
            editRule.Children.Add(wp);

            var parameter = new ComboBox { Name = ParamCombo, MinWidth = 200 };
            FillParamCombo(parameter);
            wp.Children.Add(parameter);

            var comparison = new ComboBox { Name = CompareCombo, Width = 50, Margin = new Thickness(5, 0, 0, 0) };
            wp.Children.Add(comparison);

            var value = new ComboBox { IsEditable = true, MinWidth = 200, Name = ValueControl, Margin = new Thickness(5, 0, 0, 0)};
            FillValueCombo(paramId, value);
            wp.Children.Add(value);

            var deleteBox = new Button { Height = 20, Width = 20, Margin = new Thickness(10, 0, 0, 0) };
            deleteBox.Click += deleteBox_Click;
            deleteBox.Content = new Image { Source = Helpers.BitmapSourceFromBitmap(Properties.Resources.delete) };
            wp.Children.Add(deleteBox);

            parameter.SelectedIndex = paramId != null ? _parameters.IndexOf(_parameters.First(a => a.ParamId == paramId)) : 0;
            if (compareType != null)
                comparison.SelectedValue = compareType;
            if (paramValue != null)
               ((ComboBox) wp.Children.FindByName(ValueControl)).Text = paramValue;
        }
开发者ID:asdanilenk,项目名称:Exp1,代码行数:30,代码来源:RuleEditWindow.xaml.cs

示例3: DateRangePanel

        /// <summary>
        /// Definiert das DateRangePanel
        /// </summary>
        /// <param name="dateFromProcessingFunction">Funktion, die vom Start-DatePicker bei Änderung aufgerufen wird</param>
        /// <param name="dateToProcessingFunction">Funktion, die vom Ende-DatePicker bei Änderung aufgerufen wird</param>
        /// <param name="datePickerFrom">Referenz zum darzustellenden DatePicker für Start</param>
        /// <param name="datePickerTo">Referenz zum darzustellenden DatePicker für Ende</param>
        public DateRangePanel(Action<DateTime> dateFromProcessingFunction, Action<DateTime> dateToProcessingFunction, ref DatePicker datePickerFrom, ref DatePicker datePickerTo)
        {
            this.dateFromProcessingFunction = dateFromProcessingFunction;
            this.dateToProcessingFunction = dateToProcessingFunction;

            this.datePickerFrom = datePickerFrom;
            this.datePickerTo = datePickerTo;

            Label lbFrom = new Label();
            Label lbTo = new Label();
            lbFrom.Content = IniParser.GetSetting("APPSETTINGS", "dateRangeFrom");
            lbTo.Content = IniParser.GetSetting("APPSETTINGS", "dateRangeTo");
            lbTo.Margin = new Thickness(10, 0, 0, 0);

            this.datePickerFrom.Width = 95;
            this.datePickerTo.Width = 95;

            this.datePickerFrom.SelectedDate = BookingsHelper.getDateOfLastCashClosure();
            this.datePickerTo.SelectedDate = DateTime.Today;

            this.datePickerFrom.SelectedDateChanged += processDateFrom;
            this.datePickerTo.SelectedDateChanged += processDateTo;

            panel = new WrapPanel();
            panel.HorizontalAlignment = HorizontalAlignment.Right;
            panel.VerticalAlignment = VerticalAlignment.Top;
            panel.Margin = new Thickness(30, 10, 20, 0);     // links nur 30px wegen Platzmangel in Toolbar von Modul pSums

            panel.Children.Add(lbFrom);
            panel.Children.Add(this.datePickerFrom);
            panel.Children.Add(lbTo);
            panel.Children.Add(this.datePickerTo);
        }
开发者ID:ramteid,项目名称:KoeTaf,代码行数:40,代码来源:DateRangePanel.cs

示例4: Refresh

 public void Refresh()
 {
     _item = _items[_selectedIndex];
     var headerPanel = new WrapPanel
     {
         Orientation = Orientation.Horizontal,
         Children =
         {
             ToTextBlock(_item.PrefixDisplayParts),
         }
     };
     var contentPanel = new StackPanel();
     var docText = _item.DocumentationFactory(CancellationToken.None).ToTextBlock();
     if (docText != null && docText.Inlines.Count > 0)
     {
         contentPanel.Children.Add(docText);
     }
     if (!_item.Parameters.IsDefault)
     {
         for (var index = 0; index < _item.Parameters.Length; index++)
         {
             var param = _item.Parameters[index];
             AddParameterSignatureHelp(index, param, headerPanel, contentPanel);
         }
     }
     headerPanel.Children.Add(ToTextBlock(_item.SuffixDisplayParts));
     CurrentHeader = headerPanel;
     CurrentContent = contentPanel;
 }
开发者ID:mjheitland,项目名称:TableTweaker,代码行数:29,代码来源:RoslynOverloadProvider.cs

示例5: PageAirlinerAdvancedRoute

        public PageAirlinerAdvancedRoute(FleetAirliner airliner, PopUpAirlinerAutoRoutes parent, OnRouteChanged routeChanged)
        {
            this.ParentPage = parent;
            this.Airliner = airliner;
            this.RouteChanged += routeChanged;

            InitializeComponent();

            StackPanel panelMain = new StackPanel();

            panelMain.Children.Add(createNewEntryPanel());

            WrapPanel panelFlightTime = new WrapPanel();

            txtStopovers = UICreator.CreateTextBlock("");
            txtStopovers.Visibility = System.Windows.Visibility.Collapsed;
            txtStopovers.Margin = new Thickness(0, 0, 10, 0);
            panelFlightTime.Children.Add(txtStopovers);

            txtFlightTime = UICreator.CreateTextBlock("Flight time:");
            panelFlightTime.Children.Add(txtFlightTime);

            panelMain.Children.Add(panelFlightTime);

            this.Content = panelMain;

            cbOrigin.SelectedIndex = 0;
        }
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:28,代码来源:PageAirlinerAdvancedRoute.xaml.cs

示例6: createButtonsPanel

        //creates the buttons panel
        private WrapPanel createButtonsPanel()
        {
            WrapPanel buttonsPanel = new WrapPanel();
            buttonsPanel.Margin = new Thickness(0, 10, 0, 0);

            Button btnOk = new Button();
            btnOk.Uid = "100";
            btnOk.SetResourceReference(StyleProperty, "StandardButtonStyle");
            btnOk.Height = Double.NaN;
            btnOk.Width = Double.NaN;
            btnOk.Content = Translator.GetInstance().GetString("General", btnOk.Uid);
            btnOk.Click += new RoutedEventHandler(btnOk_Click);
            btnOk.IsDefault = true;

            buttonsPanel.Children.Add(btnOk);

            Button btnCancel = new Button();
            btnCancel.Uid = "101";
            btnCancel.SetResourceReference(StyleProperty, "StandardButtonStyle");
            btnCancel.Height = Double.NaN;
            btnCancel.Margin = new Thickness(5, 0, 0, 0);
            btnCancel.Width = Double.NaN;
            btnCancel.IsCancel = true;
            btnCancel.Click += new RoutedEventHandler(btnCancel_Click);
            btnCancel.Content = Translator.GetInstance().GetString("General", btnCancel.Uid);

            buttonsPanel.Children.Add(btnCancel);

            return buttonsPanel;
        }
开发者ID:TheAirlineProject,项目名称:tap-desktop,代码行数:31,代码来源:PopUpSingleElement.xaml.cs

示例7: PageTopMenu

        public PageTopMenu()
        {
            this.SetResourceReference(Page.BackgroundProperty, "BackgroundTop");

               panelMain = new WrapPanel();
            panelMain.Margin = new Thickness(1, 0, 0, 0);
            panelMain.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;

            TextBlock txtName = new TextBlock();
            txtName.FontSize = 16;
            txtName.FontWeight = FontWeights.Bold;
            txtName.Text = "Airline Project " + Settings.Default.Version;
            txtName.Margin = new Thickness(5, 0, 0, 0);

            panelMain.Children.Add(txtName);

            Image imgLogo = new Image();
            imgLogo.Source = new BitmapImage(new Uri(@"/Data/images/Airplane-white.png", UriKind.RelativeOrAbsolute));
            RenderOptions.SetBitmapScalingMode(imgLogo, BitmapScalingMode.HighQuality);

            imgLogo.Margin = new Thickness(10, 0, 50, 0);

            panelMain.Children.Add(imgLogo);

            this.Content = panelMain;
        }
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:26,代码来源:PageTopMenu.cs

示例8: PanelAirports

        public PanelAirports(PageAirports parent)
        {
            this.ParentPage = parent;

            WrapPanel buttonsPanel = new WrapPanel();

            ucSelectButton sbSearch = new ucSelectButton();
            sbSearch.Uid = "201";
            sbSearch.Content = Translator.GetInstance().GetString("PanelAirports", sbSearch.Uid);
            sbSearch.IsSelected = true;
            sbSearch.Click += new System.Windows.RoutedEventHandler(sbSearch_Click);
            buttonsPanel.Children.Add(sbSearch);

            ucSelectButton sbExtendedSearch = new ucSelectButton();
            sbExtendedSearch.Uid = "203";
            sbExtendedSearch.Content = Translator.GetInstance().GetString("PanelAirports", sbExtendedSearch.Uid);
            sbExtendedSearch.Click += new System.Windows.RoutedEventHandler(sbExtendedSearch_Click);
            buttonsPanel.Children.Add(sbExtendedSearch);

            ucSelectButton sbStatistics = new ucSelectButton();
            sbStatistics.Uid = "202";
            sbStatistics.Content = Translator.GetInstance().GetString("PanelAirports", sbStatistics.Uid);
            sbStatistics.Click += new System.Windows.RoutedEventHandler(sbStatistics_Click);
            buttonsPanel.Children.Add(sbStatistics);

            this.Children.Add(buttonsPanel);

            frameContent = new Frame();
            frameContent.NavigationUIVisibility = NavigationUIVisibility.Hidden;
            frameContent.Navigate(new PageSearchAirports(this.ParentPage));

            this.Children.Add(frameContent);
        }
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:33,代码来源:PanelAirports.cs

示例9: PluginDlg

        public PluginDlg()
        {
            InitializeComponent();

            foreach (PluginInfo info in PluginManager.inst().InstalledPlugins)
            {
                StackPanel content = new StackPanel();
                content.Margin = new Thickness(10, 0, 10, 0);

                content.Children.Add(new Label() { Content = info.Name, FontWeight = FontWeights.Bold });
                foreach (string s in info.Parts)
                {
                    if (s.Length > 0)
                    {
                        content.Children.Add(new Label() { Content = s });
                    }
                }

                if (info.Components.Count > 0)
                {
                    content.Children.Add(new Separator());
                    content.Children.Add(new Label { Content = "Components", FontWeight = FontWeights.Bold });
                    WrapPanel subStack = new WrapPanel();
                    subStack.MaxWidth = 160;
                    subStack.Orientation = Orientation.Horizontal;
                    content.Children.Add(subStack);
                    foreach (string s in info.Components)
                    {
                        subStack.Children.Add(new Label() { Content = s, HorizontalAlignment = System.Windows.HorizontalAlignment.Left, Margin = new Thickness(4) });
                    }
                }

                pluginStack.Children.Add(content);
            }
        }
开发者ID:nonconforme,项目名称:UrhoAngelscriptIDE,代码行数:35,代码来源:PluginDlg.xaml.cs

示例10: MainWindow

        public MainWindow()
        {
            InitializeComponent();
            GroupControl.Background =new SolidColorBrush(Colors.SandyBrown);
            // opretter dummy øl
            Product beer1 = new Product("Ceres top", 15);
            BeerProducts.Add(beer1);
            Product beer2 = new Product("Carlsberg", 15);
            BeerProducts.Add(beer2);
            Product beer3 = new Product("Grimbergen", 25);
            BeerProducts.Add(beer3);
            Product beer4 = new Product("Kasper ol!", 100);
            BeerProducts.Add(beer4);

            //Laver wrappanel knapper som skal ind under øl tab item
            WrapPanel ØlPanel = new WrapPanel();

            foreach (Product product in BeerProducts)
            {
                Button button = new Button
                {
                    Content = product.Name_,
                    MinHeight = 40,
                    MinWidth = 50

                };

                ØlPanel.Children.Add(button);
            }

            // Denne linje ødelægger det!
            Øl.Content = ØlPanel;
        }
开发者ID:KasperSK,项目名称:TripleA,代码行数:33,代码来源:MainWindow.xaml.cs

示例11: CalculationOfNumber

        //创建WrapPanel控件
        private void CalculationOfNumber()
        {
            int pageTotal = (dic.Count % MainConst.USB_INFO_NUMBER_BY_PAGE == 0) ? dic.Count / MainConst.USB_INFO_NUMBER_BY_PAGE : dic.Count / MainConst.USB_INFO_NUMBER_BY_PAGE + 1;

            CurrentCommon.page_total = pageTotal;

            Thickness thick = new Thickness(20, 99, 0, 0);

            for (int i = 0; i < pageTotal; i++)
            {
                //创建显示页
                WrapPanel panel = new WrapPanel()
                {
                    Width = this.width,
                    Height = this.height,
                    Visibility = Visibility.Hidden,
                    Name = "Page" + (i + 1),
                    Margin = thick,
                };

                //设定名称
                this.win.Grid_Container.RegisterName(panel.Name, panel);

                if (i == 0)
                {
                    panel.Visibility = Visibility.Visible;
                    CurrentCommon.wrapPanel_page = panel;
                }
                panels.Add(panel);

            }
        }
开发者ID:LongQin,项目名称:DAMS,代码行数:33,代码来源:WrapPanelControl.cs

示例12: AddCredit_Click

        private void AddCredit_Click(object sender, RoutedEventArgs e)
        {
            Credits.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto });

            WrapPanel wp = new WrapPanel();
            Grid.SetRow(wp, Credits.RowDefinitions.Count - 1);
            Credits.Children.Add(wp);

            TextBox nameBox = new TextBox();
            nameBox.Name = creditname;
            nameBox.MinWidth = 170;
            wp.Children.Add(nameBox);

            Button saveButton = new Button();
            saveButton.Name = savebutton;
            saveButton.Height = 20;
            saveButton.Width = 20;
            saveButton.Margin = new Thickness(10, 0, 0, 0);
            saveButton.Click += new RoutedEventHandler(saveButton_Click);
            Image okImage = new Image();
            okImage.Source = Helpers.BitmapSourceFromBitmap(Exp1.Properties.Resources.ok);
            saveButton.Content = okImage;
            wp.Children.Add(saveButton);

            Button cancelButton = new Button();
            cancelButton.Name = cancelbutton;
            cancelButton.Height = 20;
            cancelButton.Width = 20;
            cancelButton.Margin = new Thickness(10, 0, 0, 0);
            cancelButton.Click += new RoutedEventHandler(cancelButton_Click);
            Image cancelImage = new Image();
            cancelImage.Source = Helpers.BitmapSourceFromBitmap(Exp1.Properties.Resources.cancel);
            cancelButton.Content = cancelImage;
            wp.Children.Add(cancelButton);
        }
开发者ID:asdanilenk,项目名称:Exp1,代码行数:35,代码来源:MainWindow.xaml.cs

示例13: CreateHeaderPanel

 public static WrapPanel CreateHeaderPanel(Label replName, Button closeButton)
 {
     WrapPanel headerPanel = new WrapPanel();
     headerPanel.Children.Add(replName);
     headerPanel.Children.Add(closeButton);
     return headerPanel;
 }
开发者ID:vasily-kirichenko,项目名称:vsClojure,代码行数:7,代码来源:ReplUserInterfaceFactory.cs

示例14: PageSelectLanguage

        public PageSelectLanguage()
        {
            InitializeComponent();

            StackPanel panelContent = new StackPanel();
            panelContent.Margin = new Thickness(10, 0, 10, 0);
            panelContent.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;

            WrapPanel panelButtons = new WrapPanel();
            panelButtons.Margin = new Thickness(0, 100, 0, 0);

            panelContent.Children.Add(panelButtons);

            foreach (Language language in Languages.GetLanguages().FindAll(l => l.IsEnabled))
            {
                ContentControl ccLanguage = new ContentControl();
                ccLanguage.ContentTemplate = this.Resources["LanguageItem"] as DataTemplate;
                ccLanguage.Content = language;
                ccLanguage.Margin = new Thickness(0, 0, 20, 0);

                panelButtons.Children.Add(ccLanguage);
            }

            base.setTopMenu(new PageTopMenu());

            base.hideNavigator();

            base.hideBottomMenu();

            base.setContent(panelContent);

            base.setHeaderContent("Select language");

            showPage(this);
        }
开发者ID:pedromorgan,项目名称:theairlineproject-cs,代码行数:35,代码来源:PageSelectLanguage.xaml.cs

示例15: DrawSudoku

 public void DrawSudoku(WrapPanel panel)
 {
     for (var i = 0; i < _sudokuSize; i++)
     {
         for (var j = 0; j < _sudokuSize; j++)
         {
             var text = new TextBlock
             {
                 Text = _gameField[i, j].ToString(CultureInfo.InvariantCulture),
                 FontSize = 30,
                 TextAlignment = TextAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center
             };
             var border = new Border
             {
                 Width = 60,
                 Height = 60,
                 Child = text,
                 Background = new SolidColorBrush(Colors.DeepSkyBlue),
                 BorderBrush = new SolidColorBrush(Colors.Blue),
                 BorderThickness = new Thickness(1),
                 Margin = new Thickness(2),
                 Tag = new Point(i, j)
             };
             border.MouseLeftButtonUp +=
                 (sender, args) => { MessageBox.Show((sender as Border).Tag.ToString()); };
             _wrapAreas[j / _areaSize + ((i / _areaSize) * _areaSize)].Children.Add(border);
         }
     }
 }
开发者ID:pashkados,项目名称:Sudoku,代码行数:30,代码来源:Field.cs


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