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

C# Controls.Grid类代码示例

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

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



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

示例1: 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


示例2: GenerateChartStructure

        private void GenerateChartStructure()
        {
            // Main grid
            Grid root = new Grid { Margin = new Thickness(0, 10, 0, 10) }; // Vertical Margin for labels
            root.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(0, GridUnitType.Auto) }); // Column for labels
            root.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }); // Column for chart
            RootElement.Children.Add(root);

            // Grid for labels (column 0)
            _labels = new Grid();
            root.Children.Add(_labels);

            // Grid for chart (column 1)
            Grid chart = new Grid();
            Grid.SetColumn(chart, 1);
            root.Children.Add(chart);

            // Axis
            Border axisY = new Border
                           	{
                                BorderThickness = new Thickness(0.75),
                                BorderBrush = ForegroundColor,
                           		Opacity = 0.5,
                           		HorizontalAlignment = HorizontalAlignment.Left,
                           		VerticalAlignment = VerticalAlignment.Stretch,
                           		Margin = new Thickness(0, -5, 0, -5)
                            };
            chart.Children.Add(axisY);

            // Grid for series of points
            _series = new Grid();
            chart.Children.Add(_series);
        }
开发者ID:smarteatsmarties,项目名称:arcgis-portalviewer-dotnet,代码行数:33,代码来源:ColumnChart.cs


示例3: OnApplyTemplate

		protected override void OnApplyTemplate()
		{
			base.OnApplyTemplate();

			canvas = (Grid)GetTemplateChild("canvas");
			UpdateSource();
		}
开发者ID:fstn,项目名称:WindowsPhoneApps,代码行数:7,代码来源:FadingImage.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: OnLaunched

        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (rootFrame == null)
            {
                // Create a Frame to act as the navigation context and navigate to the first page
                rootFrame = new Frame();
                // Set the default language
                rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: Load state from previously suspended application
                }

                KinectRegion kinectRegion = new KinectRegion();
                Grid grid = new Grid();
                KinectUserViewer userViewer = new KinectUserViewer()

                {
                    Height = 100,
                    Width = 121,
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment = VerticalAlignment.Top,

                };
                grid.Children.Add(kinectRegion);
                grid.Children.Add(userViewer);
                kinectRegion.Content = rootFrame;




                // Place the frame in the current Window
                Window.Current.Content = grid;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(MainPage), e.Arguments);
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }
开发者ID:mhnd89,项目名称:Knowledge-playgroundv1,代码行数:65,代码来源:App.xaml.cs


示例7: 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


示例8: CreateControl

        private void CreateControl()
        {
            var grid = new Grid();

            var margin = new Thickness {Top = 24};

            grid.Margin = margin;

            var distinctEdgesCheckBox = new CheckBox {Margin = margin, VerticalAlignment = VerticalAlignment.Center};

            var padding = new Thickness {Left = 12, Right = 12};
            distinctEdgesCheckBox.Padding = padding;

            var textBlock = new TextBlock
            {
                VerticalAlignment = VerticalAlignment.Center,
                FontSize = FilterControlTitleFontSize,
                Text = _resourceLoader.GetString("DistinctEdges/Text")
            };

            distinctEdgesCheckBox.Content = textBlock;
            distinctEdgesCheckBox.IsChecked = Filter.DistinctEdges;
            distinctEdgesCheckBox.Checked += distinctEdgesCheckBox_Checked;
            distinctEdgesCheckBox.Unchecked += distinctEdgesCheckBox_Unchecked;

            var rowDefinition = new RowDefinition {Height = GridLength.Auto};
            grid.RowDefinitions.Add(rowDefinition);

            var columnDefinition = new ColumnDefinition {Width = GridLength.Auto};
            grid.ColumnDefinitions.Add(columnDefinition);

            grid.Children.Add(distinctEdgesCheckBox);

            Control = grid;
        }
开发者ID:JuannyWang,项目名称:filter-effects,代码行数:35,代码来源:MarvelFilter.cs


示例9: OnApplyTemplate

		protected override void OnApplyTemplate()
		{
			base.OnApplyTemplate();

			Body = GetTemplateChild(BodyName) as Grid;

			_horizontalSlider = GetTemplateChild(HorizontalSliderName) as SuperSlider;
			_verticalSlider = GetTemplateChild(VerticalSliderName) as SuperSlider;

			_horizontalSelectedColor = GetTemplateChild(HorizontalSelectedColorName) as Rectangle;
			_verticalSelectedColor = GetTemplateChild(VerticalSelectedColorName) as Rectangle;

			if (_horizontalSlider != null)
				_horizontalSlider.ApplyTemplate();

			if (_verticalSlider != null)
				_verticalSlider.ApplyTemplate();

			if (Color.A == 0 && Color.R == 0 && Color.G == 0 && Color.B == 0)
				Color = Windows.UI.Color.FromArgb(255, 6, 255, 0); // this should be theme accent brush I think.
			else
				UpdateLayoutBasedOnColor();

			if (Thumb == null)
				Thumb = new ColorSliderThumb();

			IsEnabledVisualStateUpdate();
		}
开发者ID:selaromdotnet,项目名称:Coding4FunToolkit,代码行数:28,代码来源:ColorSlider2.cs


示例10: InitializeComponent

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

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///SearchResultsPage1.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (Fashionizer2.Common.LayoutAwarePage)this.FindName("pageRoot");
            resultsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("resultsViewSource");
            filtersViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("filtersViewSource");
            resultsPanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("resultsPanel");
            noResultsTextBlock = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("noResultsTextBlock");
            typicalPanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("typicalPanel");
            snappedPanel = (Windows.UI.Xaml.Controls.Grid)this.FindName("snappedPanel");
            resultsListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("resultsListView");
            filtersItemsControl = (Windows.UI.Xaml.Controls.ItemsControl)this.FindName("filtersItemsControl");
            resultsGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("resultsGridView");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            resultText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("resultText");
            queryText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("queryText");
            ApplicationViewStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ApplicationViewStates");
            ResultStates = (Windows.UI.Xaml.VisualStateGroup)this.FindName("ResultStates");
            ResultsFound = (Windows.UI.Xaml.VisualState)this.FindName("ResultsFound");
            NoResultsFound = (Windows.UI.Xaml.VisualState)this.FindName("NoResultsFound");
            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:BCNWIN8HATFashion,项目名称:Fashionizer,代码行数:31,代码来源:SearchResultsPage1.g.i.cs


示例11: 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


示例12: OnApplyTemplate

 protected override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     _rootGrid = GetTemplateChild("RootGrid") as Grid;
     _contentGrid = GetTemplateChild("ContentGrid") as Grid;
     if(_layout==LayoutEnum.Stretch)
     {
         _contentGrid.HorizontalAlignment = HorizontalAlignment.Stretch;
         _contentGrid.VerticalAlignment = VerticalAlignment.Stretch;
     }
     else if(_layout==LayoutEnum.Bottom)
     {
         _contentGrid.HorizontalAlignment = HorizontalAlignment.Stretch;
         _contentGrid.VerticalAlignment = VerticalAlignment.Bottom;
     }
     _contentGrid.Children.Add(_rootFramework);
     _inStory = _rootGrid.Resources["InStory"] as Storyboard;
     _outStory = _rootGrid.Resources["OutStory"] as Storyboard;
     _maskBorder = GetTemplateChild("MaskBorder") as Border;
     _outStory.Completed += ((sender,e)=>
     {
         _currentPopup.IsOpen = false;
     });
     _maskBorder.Tapped += ((sendert, et) =>
     {
         if (!_isOpen)
         {
             return;
         }
         Hide();
     });
     _tcs.TrySetResult(0);
 }
开发者ID:JuniperPhoton,项目名称:JP.Utils.UWP,代码行数:33,代码来源:ContentPopupEx.cs


示例13: OnApplyTemplate

        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            // make sure we listen at the right time to add/remove the back button event handlers
            if(_backButton != null)
            {
                _backButton.Tapped -= OnBackButtonTapped;
            }
            _backButton = GetTemplateChild("SettingsBackButton") as Button;
            if(_backButton != null)
            {
                _backButton.Tapped += OnBackButtonTapped;
            }

            // need to get these grids in order to set the offsets correctly in RTL situations
            if (_contentGrid == null)
            {
                _contentGrid = GetTemplateChild("SettingsFlyoutContentGrid") as Grid;
            }
            _contentGrid.Transitions = new TransitionCollection();
            _contentGrid.Transitions.Add(new EntranceThemeTransition()
            {
                FromHorizontalOffset = CONTENT_HORIZONTAL_OFFSET // TODO: if left edge need to multiply by -1
            });
        }
开发者ID:WillemGijsbers,项目名称:callisto,代码行数:26,代码来源:SettingsFlyout.cs


示例14: Convert

        public object Convert(object value, Type targetType, object parameter, string language)
        {
            var layers = (IList<PageLayer>)value;
            var grd = new Grid();
            foreach (var layer in layers.Where(x=>x.IsEnabled)) {
                
                var xaml = "";
                foreach (var xamlFragment in layer.XamlFragments.Where(x=>x.IsEnabled)) {
                    xaml += xamlFragment.Xaml;
                }

                var nsXaml = string.Empty;
                if (layer.HasChildContainerCanvas) nsXaml = $"<Canvas>{xaml}</Canvas>";
                else nsXaml = xaml;

                var nsTemplate = $"<Grid xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" HorizontalAlignment=\"Stretch\" xmlns:xuip=\"using:X.UI.Path\" xmlns:lc=\"using:X.Viewer.SketchFlow.Controls\" xmlns:lcs=\"using:X.Viewer.SketchFlow.Controls.Stamps\" VerticalAlignment=\"Stretch\" >{nsXaml}</Grid>";
                //todo: create then inject the converter "ExtensionToImageSourceConverter"  <-- after much fucking around i added it to apps root resource dict ... wont work if injected in..

                if (xaml.Length > 0) { 
                    var xamlFe = (FrameworkElement)XamlReader.Load(UnescapeString(nsTemplate));
                    grd.Children.Add(xamlFe);
                }
            }

            if (grd.Children.Count > 0) return grd;

            return null;
        }
开发者ID:liquidboy,项目名称:X,代码行数:28,代码来源:XamlFragmentsToContentConverter.cs


示例15: OnApplyTemplate

 protected override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     textBlockStatus = GetTemplateChild("textBlockStatus") as TextBlock;
     LayoutRoot = GetTemplateChild("LayoutRoot") as Grid;
     InitializeProgressType();
 }
开发者ID:x01673,项目名称:dreaming,代码行数:7,代码来源:NotifyControl.cs


示例16: ItemContainerGenerator_ItemsChanged

        private void ItemContainerGenerator_ItemsChanged(object sender, ItemsChangedEventArgs e)
        {
            if (e.Action == 1)
            {
                Position item = lstPositions.Items.Last() as Position;
                layers = new MapLayer();
                image = new BitmapImage();
                image.UriSource = (new Uri(SelectedFriend.Picture, UriKind.Absolute));

                grid = new Grid();
                grid.DataContext = item;
                grid.RightTapped += grid_RightTapped;
                textBlock = new TextBlock();
                textBlock.Text = item.Counter.ToString();
                textBlock.VerticalAlignment = VerticalAlignment.Bottom;
                textBlock.HorizontalAlignment = HorizontalAlignment.Center;
                brush = new ImageBrush();
                brush.ImageSource = image;
                ellipse = new Ellipse();
                ellipse.Height = 100;
                ellipse.Width = 100;
                ellipse.Fill = brush;
                grid.Children.Add(ellipse);
                grid.Children.Add(textBlock);
                layers.Children.Add(grid);
                MapLayer.SetPosition(grid, new Location(item.Latitude, item.Longitude));
                myMap.Children.Add(layers);
            }
        }
开发者ID:JorgeCupi,项目名称:SmartGuard,代码行数:29,代码来源:FriendInfoView.xaml.cs


示例17: SetFontSize

        public static void SetFontSize(Grid container, double fontSize)
        {
            ((TextBlock) container.Children[0]).FontSize = fontSize;

            // trigger SizeChanged event (see UpdateMargin)
            container.Margin = new Thickness(0);
        }
开发者ID:Catrobat,项目名称:CatrobatForWindows,代码行数:7,代码来源:FormulaTokenTemplate.cs


示例18: GetAvatarControl

 private void GetAvatarControl()
 {
     if (this.avatarGrid == null)
     {
         this.avatarGrid = this.GetTemplateChild("AvatarGrid") as Grid;
     }
 }
开发者ID:CuiXiaoDao,项目名称:cnblogs-UAP,代码行数:7,代码来源:PostControl.cs


示例19: OnApplyTemplate

        protected override void OnApplyTemplate()
        {
            _frame = base.GetTemplateChild("frame") as Panel;
            _panel = base.GetTemplateChild("panel") as CarouselPanel;

            _arrows = base.GetTemplateChild("arrows") as Grid;
            _left = base.GetTemplateChild("left") as Button;
            _right = base.GetTemplateChild("right") as Button;

            _gradient = base.GetTemplateChild("gradient") as LinearGradientBrush;
            _clip = base.GetTemplateChild("clip") as RectangleGeometry;

            _frame.ManipulationDelta += OnManipulationDelta;
            _frame.ManipulationCompleted += OnManipulationCompleted;
            _frame.ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.System;

            _frame.PointerMoved += OnPointerMoved;
            _left.Click += OnLeftClick;
            _right.Click += OnRightClick;
            _left.PointerEntered += OnArrowPointerEntered;
            _left.PointerExited += OnArrowPointerExited;
            _right.PointerEntered += OnArrowPointerEntered;
            _right.PointerExited += OnArrowPointerExited;

            base.OnApplyTemplate();
        }
开发者ID:ridomin,项目名称:waslibs,代码行数:26,代码来源:Carousel.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.Left;
            _contentpanel.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top;
            _contentpanel.RenderTransform = new CompositeTransform() { TranslateX = 320.0 };
            _contentpanel.Width = 560.0;
            _contentpanel.SizeChanged += _contentpanel_SizeChanged;
            Children.Add(_contentpanel);

            Grid header = new Grid() { Width = 100.0, Height = 250.0 };
            Grid footer = new Grid() { Width = 100.0, Height = 250.0 };
            Grid separation = new Grid() { Width = 100.0, Height = 78.0 };
            _titleblock = new TextBlock() { TextWrapping = Windows.UI.Xaml.TextWrapping.Wrap, FontSize = 26, FontWeight = Windows.UI.Text.FontWeights.Light };
            _titleblock.LayoutUpdated += _titleblock_LayoutUpdated;
            _contentblock = new TextBlock() { TextWrapping = Windows.UI.Xaml.TextWrapping.Wrap, FontSize = 33, FontWeight = Windows.UI.Text.FontWeights.Light, FontStyle = Windows.UI.Text.FontStyle.Italic };
            _contentblock.LayoutUpdated += _contentblock_LayoutUpdated;

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Controls.ItemClickEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Controls.Frame类代码示例发布时间: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