Inheritance: Panel, IGrid
コード例 #1
0
        private void Initialize(bool disableContextMenu, LayoutScale scale)
        {
            Image.HorizontalAlignment = HorizontalAlignment.Center;
            Image.VerticalAlignment   = VerticalAlignment.Center;
            if (scale == LayoutScale.Contain)
            {
                Image.Stretch = Stretch.Uniform;
            }
            else if (scale == LayoutScale.Cover)
            {
                Image.Stretch = Stretch.UniformToFill;
            }
            else
            {
                Image.Stretch = Stretch.Fill;
            }

            Bitmap       = new WriteableBitmap(1, 1);
            Image.Source = Bitmap;

            Grid = new Windows.UI.Xaml.Controls.Grid();
            Grid.Children.Add(Image);

            if (!disableContextMenu)
            {
                ContextMenu = new Win8ContextMenu();
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: SlideShow.cs プロジェクト: ridomin/waslibs
        protected override void OnApplyTemplate()
        {
            _container = base.GetTemplateChild("container") as Grid;
            _clip = base.GetTemplateChild("clip") as RectangleGeometry;

            base.OnApplyTemplate();
        }
コード例 #4
0
        private void OnSizeChanged(object sender, SizeChangedEventArgs e)
        {
            if (!e.NewSize.IsEmpty)
            {
                ExtendedBoxView ebv = (ExtendedBoxView)this.Element;
                if (originalCanvasSize == null)
                {
                    originalCanvasSize = e.NewSize;
                }

                if (ebv.ForcedBoxShape != ForcedBoxShape.Default)
                {
                    var rad = Math.Min(e.NewSize.Width, e.NewSize.Height);


                    if (ebv.ForcedBoxShape == ForcedBoxShape.Circle)
                    {
                        if (savedCornerRadius == null)
                        {
                            savedCornerRadius = ebv.CornerRadius;
                        }
                        ebv.CornerRadius = new CornerRadius(rad / 2);
                    }
                    UWPGrid grid = CreateExtendedBox();
                    grid.Height = rad;
                    grid.Width  = rad;
                    SetNativeControl(grid);
                }
            }
        }
コード例 #5
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-resource://spotifyapp/Files/View/DetailPage.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");
            FlipView       = (Windows.UI.Xaml.Controls.FlipView) this.FindName("FlipView");
            ApplicationBar = (Windows.UI.Xaml.Controls.ApplicationBar) this.FindName("ApplicationBar");
            NextPanel      = (Windows.UI.Xaml.Controls.StackPanel) this.FindName("NextPanel");
            NextButton     = (Windows.UI.Xaml.Controls.Button) this.FindName("NextButton");
            PreviousButton = (Windows.UI.Xaml.Controls.Button) this.FindName("PreviousButton");
            HomeButton     = (Windows.UI.Xaml.Controls.Button) this.FindName("HomeButton");
            BackButton     = (Windows.UI.Xaml.Controls.Button) this.FindName("BackButton");
            PageTitle      = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("PageTitle");
        }
コード例 #6
0
ファイル: ArtistDetails.g.i.cs プロジェクト: sagar-sm/Mu
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///ArtistDetails.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");
            itemDetail = (Windows.UI.Xaml.Controls.ScrollViewer)this.FindName("itemDetail");
            itemDetailGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("itemDetailGrid");
            itemDetailTitlePanel = (Windows.UI.Xaml.Controls.StackPanel)this.FindName("itemDetailTitlePanel");
            ArtistContentTb = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("ArtistContentTb");
            itemTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("itemTitle");
            itemSubtitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("itemSubtitle");
            itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            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");
        }
コード例 #7
0
        public static async void openGameOverScreen(Windows.UI.Xaml.Controls.Grid BoardGrid)
        {
            if (Board.Instance.isGameOver())
            {
                var dialog = new ContentDialog()
                {
                    Title    = "Game over!",
                    MaxWidth = 400,// Required for Mobile!
                    Content  = "Winner is " + Board.Instance.getWinner() + "\n" + Board.Instance.getScores()
                };
                dialog.PrimaryButtonText      = "Start new game";
                dialog.SecondaryButtonText    = "Go back to set up";
                dialog.IsPrimaryButtonEnabled = true;
                dialog.PrimaryButtonClick    += delegate
                {
                    Board.Instance.startGame(Board.Instance.NumberOfCards, Board.Instance.NumberOfPlayers);
                    displayBoard(Convert.ToInt32(Math.Sqrt(Board.Instance.NumberOfCards)), BoardGrid);
                    dialog.Hide();
                };
                dialog.SecondaryButtonClick += delegate
                {
                    Page boardPage = getParentPage(BoardGrid);
                    boardPage.Frame.Navigate(typeof(MainPage));
                    dialog.Hide();
                };

                var result = await dialog.ShowAsync();
            }
        }
コード例 #8
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///SearchResultsPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);

            pageRoot              = (SimpleSearchProvider.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");
        }
コード例 #9
0
        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;
        }
コード例 #10
0
ファイル: SlidableListItem.cs プロジェクト: KooKiz/comet
        /// <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();
        }
コード例 #11
0
        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);
        }
コード例 #12
0
        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");
        }
        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");
        }
コード例 #14
0
ファイル: HomePage.g.i.cs プロジェクト: anadobes/Win8Tracks
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///HomePage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            pageRoot = (_8Tracks.Common.LayoutAwarePage)this.FindName("pageRoot");
            groupedItemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource)this.FindName("groupedItemsViewSource");
            passwordPrompt = (Windows.UI.Xaml.Controls.Grid)this.FindName("passwordPrompt");
            itemGridView = (Windows.UI.Xaml.Controls.GridView)this.FindName("itemGridView");
            itemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("itemListView");
            backButton = (Windows.UI.Xaml.Controls.Button)this.FindName("backButton");
            pageTitle = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("pageTitle");
            loginText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("loginText");
            loginBox = (Windows.UI.Xaml.Controls.TextBox)this.FindName("loginBox");
            passwordText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("passwordText");
            passwordBox = (Windows.UI.Xaml.Controls.PasswordBox)this.FindName("passwordBox");
            doneButton = (Windows.UI.Xaml.Controls.Button)this.FindName("doneButton");
            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");
        }
コード例 #15
0
 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);
 }
        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");
        }
コード例 #17
0
ファイル: HomePage.g.i.cs プロジェクト: imilligan/Win8Tracks
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///HomePage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);

            pageRoot = (_8Tracks.Common.LayoutAwarePage) this.FindName("pageRoot");
            groupedItemsViewSource = (Windows.UI.Xaml.Data.CollectionViewSource) this.FindName("groupedItemsViewSource");
            passwordPrompt         = (Windows.UI.Xaml.Controls.Grid) this.FindName("passwordPrompt");
            itemGridView           = (Windows.UI.Xaml.Controls.GridView) this.FindName("itemGridView");
            itemListView           = (Windows.UI.Xaml.Controls.ListView) this.FindName("itemListView");
            backButton             = (Windows.UI.Xaml.Controls.Button) this.FindName("backButton");
            pageTitle             = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("pageTitle");
            loginText             = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("loginText");
            loginBox              = (Windows.UI.Xaml.Controls.TextBox) this.FindName("loginBox");
            passwordText          = (Windows.UI.Xaml.Controls.TextBlock) this.FindName("passwordText");
            passwordBox           = (Windows.UI.Xaml.Controls.PasswordBox) this.FindName("passwordBox");
            doneButton            = (Windows.UI.Xaml.Controls.Button) this.FindName("doneButton");
            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");
        }
コード例 #18
0
        public GroupBoxContainer(Span span)
        {
            var grid = new Grid();
            grid.RowDefinitions.Add(new RowDefinition
            {
                Height = GridLength.Auto
            });
            grid.RowDefinitions.Add(new RowDefinition());

            _titleBlock = new TextBlock();
            grid.Children.Add(_titleBlock);

            var border = new Border
            {
                BorderBrush = new SolidColorBrush(Colors.Gray),
                BorderThickness = new Thickness(1, 0, 0, 1),
                Margin = new Thickness(5, 0, 0, 5),
                Padding = new Thickness(3, 0, 0, 3)
            };
            Grid.SetRow(border, 1);
            grid.Children.Add(border);

            var richTextBlock = new RichTextBlock()
            {
                IsTextSelectionEnabled = false
            };
            border.Child = richTextBlock;
            _innerContainer = new RichTextBlockContainer(richTextBlock);

            span.Inlines.Add(new InlineUIContainer()
            {
                Child = grid
            });
        }
コード例 #19
0
        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);
        }
コード例 #20
0
        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);
        }
コード例 #21
0
        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 = (SettingsPane.Edge == SettingsEdgeLocation.Right) ? CONTENT_HORIZONTAL_OFFSET : (CONTENT_HORIZONTAL_OFFSET * -1)
            });

            // need the root border for RTL scenarios
            _rootBorder = GetTemplateChild("PART_RootBorder") as Border;

            // need the content scrollviewer to set the fixed width to be the same size as flyout
            _contentScrollViewer = GetTemplateChild("PART_ContentScrollViewer") as ScrollViewer;
            
        }
コード例 #22
0
ファイル: EngagementPageOverlay.cs プロジェクト: Ruude/TP-IHM
    /// <summary>
    /// Initializes a new instance of the <see cref="EngagementPageOverlay" /> class.
    /// </summary>
    public EngagementPageOverlay()
    {
      // Initialize the webview for notifications.
      Banner = new WebView();
      Banner.Name = BannerWebviewName;
      Banner.Height = BannerHeight;
      Banner.HorizontalAlignment = HorizontalAlignment.Stretch;
      Banner.VerticalAlignment = VerticalAlignment.Top;
      Banner.Visibility = Visibility.Collapsed;

      // Initialize the webview for text\Web announcements and Polls.
      Interstitial = new WebView();
      Interstitial.Name = InterstitialWebviewName;
      Interstitial.HorizontalAlignment = HorizontalAlignment.Stretch;
      Interstitial.VerticalAlignment = VerticalAlignment.Stretch;
      Interstitial.Visibility = Visibility.Collapsed;

      // Initialize the webviews' container.
      Container = new Grid();
      Container.Name = OverlayContainerName;

      // Add webviews to the container but leave the first index to the page's content.
      Container.Children.Insert(1, Banner);
      Container.Children.Insert(2, Interstitial);
    }
コード例 #23
0
ファイル: LayerView.cs プロジェクト: Luigi-pl/2048_3d_game
        /// <summary>
        /// Method is used to insert single layer to board(grid of layer 3x1).
        /// </summary>
        /// <param name="gameBoard">grid of layers</param>
        /// <param name="x">x position</param>
        /// <param name="y">y position</param>
        public void InsertLayerIntoGameBoard(ref UIX.Controls.Grid gameBoard, int x, int y)
        {
            Grid.SetColumn(layer, x);
            Grid.SetRow(layer, y);

            gameBoard.Children.Add(layer);
        }
コード例 #24
0
ファイル: FadingImage.cs プロジェクト: fstn/WindowsPhoneApps
		protected override void OnApplyTemplate()
		{
			base.OnApplyTemplate();

			canvas = (Grid)GetTemplateChild("canvas");
			UpdateSource();
		}
コード例 #25
0
ファイル: Carousel.cs プロジェクト: ridomin/waslibs
        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();
        }
コード例 #26
0
        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);
        }
コード例 #27
0
        public void When_Private_Field_And_xBind_Not_OneTime()
        {
            var source = new PrivateField(42);
            var SUT    = new Windows.UI.Xaml.Controls.Grid();

            var binding = new Binding()
            {
                Path           = "MyField",
                Mode           = BindingMode.OneWay,
                CompiledSource = source
            };

            binding.SetBindingXBindProvider(
                source,
                (a) => "Test",
                null,
                new[] { "MyField" });

            SUT.SetBinding(
                Windows.UI.Xaml.Controls.Grid.TagProperty,
                binding
                );

            SUT.ApplyXBind();

            Assert.AreEqual("Test", SUT.Tag);
        }
コード例 #28
0
        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 f*****g 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;
        }
コード例 #29
0
ファイル: PostControl.cs プロジェクト: CuiXiaoDao/cnblogs-UAP
 private void GetAvatarControl()
 {
     if (this.avatarGrid == null)
     {
         this.avatarGrid = this.GetTemplateChild("AvatarGrid") as Grid;
     }
 }
コード例 #30
0
        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
            });
        }
コード例 #31
0
ファイル: NewsControl.cs プロジェクト: CuiXiaoDao/cnblogs-UAP
 private void GetSummaryControl()
 {
     if (this.mainPostGrid == null)
     {
         this.mainPostGrid = this.GetTemplateChild("mainPostGrid") as Grid;
     }
 }
コード例 #32
0
		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();
		}
コード例 #33
0
        /// <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();
        }
コード例 #34
0
        public static void SetFontSize(Grid container, double fontSize)
        {
            ((TextBlock) container.Children[0]).FontSize = fontSize;

            // trigger SizeChanged event (see UpdateMargin)
            container.Margin = new Thickness(0);
        }
コード例 #35
0
        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);
            }
        }
コード例 #36
0
        void init()
        {
            Background = new SolidColorBrush(Colors.Transparent);
            VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Top;
            HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Left;
            _transform = new CompositeTransform();
            _c_transform = new CompositeTransform();
            RenderTransform = _transform;

            //scroll
            _scroll = new ScrollViewer()
            {
                HorizontalScrollMode = ScrollMode.Enabled,
                VerticalScrollMode = ScrollMode.Enabled,
                HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden,
                VerticalScrollBarVisibility = ScrollBarVisibility.Hidden
            };
            Children.Add(_scroll);
            //content
            _content = new Grid() { HorizontalAlignment = HorizontalAlignment.Left, ManipulationMode = ManipulationModes.All };
            _content.RenderTransform = _c_transform;
            _image = new Image() { Stretch = Stretch.UniformToFill };
            _border = new Border() { CornerRadius = new Windows.UI.Xaml.CornerRadius(10) };
            _content.Children.Add(_image);
            _content.Children.Add(_border);
            _scroll.Content = _content;
        }
コード例 #37
0
ファイル: NotifyControl.cs プロジェクト: x01673/dreaming
 protected override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     textBlockStatus = GetTemplateChild("textBlockStatus") as TextBlock;
     LayoutRoot = GetTemplateChild("LayoutRoot") as Grid;
     InitializeProgressType();
 }
コード例 #38
0
ファイル: Tweet.g.i.cs プロジェクト: sagar-sm/Mu
        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");
        }
コード例 #39
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///BlankPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);
 
            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");
            FullGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("FullGrid");
            SnapGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("SnapGrid");
            PortaitGrid = (Windows.UI.Xaml.Controls.Grid)this.FindName("PortaitGrid");
            textBlock = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("textBlock");
            ContentView2 = (Windows.UI.Xaml.Controls.WebView)this.FindName("ContentView2");
            ItemListView1 = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView1");
            ContentView1 = (Windows.UI.Xaml.Controls.WebView)this.FindName("ContentView1");
            TitleText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("TitleText");
            grid = (Windows.UI.Xaml.Controls.Grid)this.FindName("grid");
            ItemListView = (Windows.UI.Xaml.Controls.ListView)this.FindName("ItemListView");
            PostTitleText = (Windows.UI.Xaml.Controls.TextBlock)this.FindName("PostTitleText");
            ContentView = (Windows.UI.Xaml.Controls.WebView)this.FindName("ContentView");
        }
コード例 #40
0
        private UWPGrid CreateExtendedBox()
        {
            UWPGrid grid = new UWPGrid();

            ExtendedBoxView ebv = (ExtendedBoxView)this.Element;

            if (ebv.IsVisible)
            {
                // Convert the parameters in the Forms Element so they can be used in the Native Control

                XFColor  rectClr    = ebv.Color;
                UWPColor rectColour = UWPColor.FromArgb((byte)(255 * (rectClr.A < 0f ? 0 : rectClr.A)),
                                                        (byte)(255 * (rectClr.R < 0f ? 0 : rectClr.R)),
                                                        (byte)(255 * (rectClr.G < 0f ? 0 : rectClr.G)),
                                                        (byte)(255 * (rectClr.B < 0f ? 0 : rectClr.B)));

                XFColor  brdClr    = ebv.BorderColor;
                UWPColor brdColour = UWPColor.FromArgb((byte)(255 * (brdClr.A < 0f ? 0 : brdClr.A)),
                                                       (byte)(255 * (brdClr.R < 0f ? 0 : brdClr.R)),
                                                       (byte)(255 * (brdClr.G < 0f ? 0 : brdClr.G)),
                                                       (byte)(255 * (brdClr.B < 0f ? 0 : brdClr.B)));



                // Set up a rectangle representing the Box
                // Note1: Don't need to specify the Layout options or size of the Rectangle, as it will fill the cell contained
                //        in the grid. So the cell and grid layout will dictate the size and layout behaviour of the rectangle.
                // Note2: (Setting the layout and/or size of the rectangle will override those of the cell/grid. This may
                //         cause some of the behaviour to be different than expected, even if manually picking up the values
                //         from the Forms control)

                Border rect = new Border
                {
                    Background      = new SolidColorBrush(rectColour),
                    BorderBrush     = new SolidColorBrush(brdColour),
                    BorderThickness = new UWPThickness(ebv.BorderThickness),
                    CornerRadius    = CornerRadiusConverter.Convert(ebv.CornerRadius)
                };

                // Set up a rectangle representing the Shadow
                if (ebv.HasShadow)
                {
                    Border shadow = CreateShadow(ebv.ShadowColor, ebv.CornerRadius, ebv.BorderThickness,
                                                 ebv.ShadowPosition.dX, ebv.ShadowPosition.dY, ebv.Color.A, ebv.BorderColor.A);
                    grid.Children.Add(shadow);
                }

                // Add the box rectangle to the grid
                // Note:  The default behaviour for a grid with no column definitions or row definitions is a single cell
                //        filling the available space in the grid. The windows layout system and the forms layout system
                //        interact to automatically layout cell according to the LayoutOptions and Size Requests
                //        specified in the Forms control
                grid.Children.Add(rect);
            }

            return(grid);
        }
コード例 #41
0
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _contentPresenter = GetTemplateChild("ContentPresenter") as WContentPresenter;
            _rootGrid         = GetTemplateChild("RootGrid") as Windows.UI.Xaml.Controls.Grid;

            UpdateBackgroundColor();
            UpdateBorderRadius();
        }
コード例 #42
0
        /////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Method initializes and sets game board appearance
        /// </summary>
        private void InitializeGameBoard()
        {
            gameBoard = new Grid();
            layers    = new LayerView[numberOfLayers];

            gameBoard.Margin = new UIX.Thickness(0);
            for (int i = 0; i < numberOfLayers; i++)
            {
                gameBoard.ColumnDefinitions.Add(new ColumnDefinition());
            }
        }
コード例 #43
0
        /// <summary>
        /// Method is used to insert game board view to main grid.
        /// </summary>
        public void InsertGameBoardIntoMainGrid(ref UIX.Controls.Grid mainGrid, int x, int y)
        {
            if (mainGrid.Children.Count == 2)
            {
                mainGrid.Children.RemoveAt(1);
            }
            Grid.SetColumn(gameBoard, x);
            Grid.SetRow(gameBoard, y);

            mainGrid.Children.Add(gameBoard);
        }
コード例 #44
0
        /// <summary>
        /// Method is used to insert single field to layer(grid of fields 3x3).
        /// </summary>
        /// <param name="layer">grid of fields</param>
        /// <param name="x">x position</param>
        /// <param name="y">y position</param>
        public void InsertFieldIntoLayer(ref UIX.Controls.Grid layer, int x, int y)
        {
            Grid.SetColumn(backgroundBorder, x);
            Grid.SetRow(backgroundBorder, y);

            Grid.SetColumn(contentBox, x);
            Grid.SetRow(contentBox, y);

            layer.Children.Add(backgroundBorder);
            layer.Children.Add(contentBox);
        }
コード例 #45
0
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            this.rootPanel = this.GetTemplateChild("PART_Root") as Windows.UI.Xaml.Controls.Grid;

            if (this.IsOpen)
            {
                this.RefreshChildren();
            }
        }
コード例 #46
0
        public void InitializeComponent()
        {
            if (_contentLoaded)
            {
                return;
            }

            _contentLoaded = true;
            Application.LoadComponent(this, new System.Uri("ms-appx:///MainPage.xaml"), Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);

            ListPerson = (Windows.UI.Xaml.Controls.ListBox) this.FindName("ListPerson");
            ContactLst = (Windows.UI.Xaml.Controls.Grid) this.FindName("ContactLst");
        }
コード例 #47
0
        protected override void OnElementChanged(ElementChangedEventArgs <BoxView> e)
        {
            base.OnElementChanged(e);

            // Set up the 'parent' Native Element that will be used to contain all the elements in the Native Control
            // This is the native control that will be assigned
            // Note: The windows layout system and the forms layout system interact to automatically layout
            // the grid according to the LayoutOptions specified in the Forms control

            UWPGrid grid = CreateExtendedBox();

            // set the grid to be the native control
            SetNativeControl(grid);
        }
コード例 #48
0
        private void AddUWPComponents(UWPControls.Grid containerGrid)
        {
            UWPControls.StackPanel root = new UWPControls.StackPanel
            {
                HorizontalAlignment = UWPXaml.HorizontalAlignment.Center,
                VerticalAlignment   = UWPXaml.VerticalAlignment.Top
            };


            root.Children.Add(CreateInputStackPanel());
            root.Children.Add(CreateGettingDataProgressRing());
            root.Children.Add(CreateResultStackPanel());

            containerGrid.Children.Add(root);
        }
コード例 #49
0
ファイル: LayerView.cs プロジェクト: Luigi-pl/2048_3d_game
        /////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Method initializes and sets layer appearance
        /// </summary>
        private void InitializeLayer()
        {
            layer  = new UIX.Controls.Grid();
            fields = new FieldView[layerSize, layerSize];

            layer.Margin = new UIX.Thickness(5);
            for (int i = 0; i < layerSize; i++)
            {
                layer.ColumnDefinitions.Add(new ColumnDefinition());
            }
            for (int i = 0; i < layerSize; i++)
            {
                layer.RowDefinitions.Add(new RowDefinition());
            }
        }
コード例 #50
0
ファイル: Given_Binder.cs プロジェクト: x86/uno
        public void When_Source_String()
        {
            var source = "Test";
            var SUT    = new Windows.UI.Xaml.Controls.Grid();

            SUT.SetBinding(
                Windows.UI.Xaml.Controls.Grid.TagProperty,
                new Binding()
            {
                Source = source
            }
                );

            Assert.AreEqual(source, SUT.Tag);
        }
コード例 #51
0
ファイル: ButtonHandler.cs プロジェクト: daddycoding/Eto
        public ButtonHandler()
        {
            Control        = new swc.Button();
            Control.Click += (sender, e) => Callback.OnClick(Widget, EventArgs.Empty);
            label          = new swc.TextBlock
            {
                VerticalAlignment   = sw.VerticalAlignment.Center,
                HorizontalAlignment = sw.HorizontalAlignment.Center,
                Padding             = new sw.Thickness(3, 0, 3, 0),
                Visibility          = sw.Visibility.Collapsed
            };
            swc.Grid.SetColumn(label, 1);
            swc.Grid.SetRow(label, 1);

            swcimage = new swc.Image();
            SetImagePosition();
            grid = new swc.Grid();
            grid.ColumnDefinitions.Add(new swc.ColumnDefinition {
                Width = sw.GridLength.Auto
            });
            grid.ColumnDefinitions.Add(new swc.ColumnDefinition {
                Width = new sw.GridLength(1, sw.GridUnitType.Star)
            });
            grid.ColumnDefinitions.Add(new swc.ColumnDefinition {
                Width = sw.GridLength.Auto
            });
            grid.RowDefinitions.Add(new swc.RowDefinition {
                Height = sw.GridLength.Auto
            });
            grid.RowDefinitions.Add(new swc.RowDefinition {
                Height = new sw.GridLength(1, sw.GridUnitType.Star)
            });
            grid.RowDefinitions.Add(new swc.RowDefinition {
                Height = sw.GridLength.Auto
            });
            grid.Children.Add(swcimage);
            grid.Children.Add(label);

            /*
             * var panel = new swc.Control { IsTabStop = false };
             * panel.HorizontalAlignment = sw.HorizontalAlignment.Stretch;
             * panel.VerticalAlignment = sw.VerticalAlignment.Stretch;
             * swc.Grid.SetColumn (panel, 1);
             * swc.Grid.SetRow (panel, 1);
             * grid.Children.Add (panel);
             * */
            Control.Content = grid;
        }
コード例 #52
0
ファイル: Given_Binder.cs プロジェクト: wiltonlazary/uno
        public void When_Source_Complex()
        {
            var SUT     = new Windows.UI.Xaml.Controls.Grid();
            var subject = new ElementNameSubject();

            SUT.SetBinding(
                Windows.UI.Xaml.Controls.Grid.TagProperty,
                new Binding()
            {
                Path   = "MyProperty",
                Source = new { MyProperty = 42 }
            }
                );

            Assert.AreEqual(42, SUT.Tag);
        }
コード例 #53
0
 protected override void Dispose(bool isDisposing)
 {
     if (isdisposed)
     {
         return;
     }
     if (isDisposing)
     {
         this.ExpanderBorder           = null;
         this.GetColumnSize            = null;
         this.GetColumnVisibleLineInfo = null;
         this.IsExpandedChanged        = null;
         this.RowPanel = null;
     }
     base.Dispose(isDisposing);
     isdisposed = true;
 }
コード例 #54
0
ファイル: Given_Binder.cs プロジェクト: wiltonlazary/uno
        public void When_Private_Field_And_Binding()
        {
            var source = new PrivateField(42);
            var SUT    = new Windows.UI.Xaml.Controls.Grid();

            SUT.SetBinding(
                Windows.UI.Xaml.Controls.Grid.TagProperty,
                new Binding()
            {
                Path = "MyField"
            }
                );

            SUT.DataContext = source;

            Assert.IsNull(SUT.Tag);
        }
コード例 #55
0
        public GameController(ref Windows.UI.Xaml.Controls.Grid mainBoard,
                              ref Windows.UI.Xaml.Controls.TextBlock bestScore,
                              ref Windows.UI.Xaml.Controls.TextBlock actualScore)
        {
            LoadBoardSize();

            gameStatistic     = new Model.GameScoreModel();
            gameStatisticView = new View.GameScoreView(ref bestScore, ref actualScore);

            mainBoardGrid = mainBoard;
            gameModel     = new Model.GameBoardModel(this.boardSize, this.numberOfLayers);
            gameModelView = new View.GameBoardView(gameModel);

            gameModelView.InsertGameBoardIntoMainGrid(ref mainBoardGrid, 0, 1);

            StartGame();
        }
コード例 #56
0
        public override void OnApplyTemplate()
#endif
        {
            base.OnApplyTemplate();
#if WinRT || UNIVERSAL
            RowPanel = this.GetTemplateChild("PART_CaptionSummaryRowGrid") as Windows.UI.Xaml.Controls.Grid;
#else
            RowPanel = this.GetTemplateChild("PART_CaptionSummaryRowGrid") as System.Windows.Controls.Grid;
#endif

            ExpanderBorder = this.GetTemplateChild("PART_CaptionSummaryRowBorder") as Border;

            var group = this.DataContext as Group;
            if (group != null)
            {
                this.IsExpanded = group.IsExpanded;
            }
        }
コード例 #57
0
ファイル: Given_Binder.cs プロジェクト: wiltonlazary/uno
        public void When_Private_Field_And_xBind()
        {
            var source = new PrivateField(42);
            var SUT    = new Windows.UI.Xaml.Controls.Grid();

            SUT.SetBinding(
                Windows.UI.Xaml.Controls.Grid.TagProperty,
                new Binding()
            {
                Path           = "MyField",
                CompiledSource = source
            }
                );

            SUT.ApplyCompiledBindings();

            Assert.AreEqual(42, SUT.Tag);
        }
コード例 #58
0
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _rootGrid = GetTemplateChild("RootGrid") as Windows.UI.Xaml.Controls.Grid;
            if (_rootGrid != null)
            {
                var stateGroups = WVisualStateManager.GetVisualStateGroups(_rootGrid).ToList();
                _DeleteButtonVisibleStateGroups = stateGroups.SingleOrDefault(sg => sg.Name == "ButtonStates");
                if (_DeleteButtonVisibleStateGroups != null)
                {
                    _DeleteButtonVisibleState = _DeleteButtonVisibleStateGroups.States.SingleOrDefault(s => s.Name == "ButtonVisible");
                }
                UpdateClearButtonVisible();
            }

            _scrollViewer = GetTemplateChild("ContentElement") as ScrollViewer;
        }
コード例 #59
0
        private const string BadgeValueOverflow = "*"; // text to display if the number is greater than 99

        /// <summary>
        /// Adds badge with text on app bar button
        /// </summary>
        /// <param name="appBarButton">App bar button to add badge</param>
        /// <param name="item">Toolbar item</param>
        /// <param name="value">Value to display</param>
        /// <param name="backgroundColor">bBackground of badge</param>
        /// <param name="textColor">Foreground text color of value</param>
        public static void AddBadge(this AppBarButton appBarButton, ToolbarItem item, string value, Color backgroundColor, Color textColor)
        {
            if (item.IconImageSource == null)
            {
                return;                               // if icon is not specified in toolbar item return
            }
            var img = new Xamarin.Forms.Image {
                Source = item.IconImageSource
            };                                                                 // create new image with image source specified in toolbar item
            var imagePlatform = Platform.CreateRenderer(img) as ImageRenderer; // get platform renderer for image

            var grid = new Grid();                                             // create new UWP grid

            var image = new Image {
                Source = imagePlatform?.Control.Source, Stretch = Stretch.Fill, HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch
            };                                                                            // create new UWP Image, and set the source to toolbar item's image source

            Grid.SetColumn(image, 0);                                                     // get row for image control in grid
            Grid.SetRow(image, 0);                                                        // get column for image control in grid
            grid.Children.Add(image);                                                     // add image to grid

            if (!string.IsNullOrWhiteSpace(value) && value != "0")                        // check if value is set and value not equal to 0
            {
                var border = new Border                                                   // create new UWP border
                {
                    Margin       = new Windows.UI.Xaml.Thickness(10, 0, 0, 10),           // add margins
                    Background   = new SolidColorBrush(backgroundColor.ToWindowsColor()), // set background color
                    CornerRadius = new Windows.UI.Xaml.CornerRadius(13),                  // make border as circle
                    Child        = new TextBlock                                          // create a UWP TextBlock
                    {
                        Text = value.Length > 2 ? BadgeValueOverflow : value,             // set text, if value length is greater than 2, replace value with *
                        HorizontalAlignment     = HorizontalAlignment.Center,             // align control center horizontally
                        VerticalAlignment       = VerticalAlignment.Center,               // align control center Vertically
                        HorizontalTextAlignment = Windows.UI.Xaml.TextAlignment.Center,   // text alignment to center
                        Foreground = new SolidColorBrush(textColor.ToWindowsColor())      // set fore color
                    }
                };
                Grid.SetColumn(border, 0); // get row for border control in grid
                Grid.SetRow(border, 0);    // get column for border control in grid
                grid.Children.Add(border); // add image to grid
            }

            appBarButton.Content = grid; // replace UWP toolbar item content with newly created grid
        }
コード例 #60
0
ファイル: ButtonHandler.cs プロジェクト: yaram/Eto
        public ButtonHandler()
        {
            Control        = new swc.Button();
            Control.Click += (sender, e) => Callback.OnClick(Widget, EventArgs.Empty);
            label          = new WpfLabel
            {
                VerticalAlignment   = sw.VerticalAlignment.Center,
                HorizontalAlignment = sw.HorizontalAlignment.Center,
                Padding             = new sw.Thickness(3, 0, 3, 0),
                Visibility          = sw.Visibility.Collapsed
            };
            swc.Grid.SetColumn(label, 1);
            swc.Grid.SetRow(label, 1);
#if WINRT
            swcimage = new EtoImage();
#else
            swcimage = new EtoImage {
                Handler = this
            };
#endif
            var grid = new swc.Grid();
            grid.ColumnDefinitions.Add(new swc.ColumnDefinition {
                Width = sw.GridLength.Auto
            });
            grid.ColumnDefinitions.Add(new swc.ColumnDefinition {
                Width = new sw.GridLength(1, sw.GridUnitType.Star)
            });
            grid.ColumnDefinitions.Add(new swc.ColumnDefinition {
                Width = sw.GridLength.Auto
            });
            grid.RowDefinitions.Add(new swc.RowDefinition {
                Height = sw.GridLength.Auto
            });
            grid.RowDefinitions.Add(new swc.RowDefinition {
                Height = new sw.GridLength(1, sw.GridUnitType.Star)
            });
            grid.RowDefinitions.Add(new swc.RowDefinition {
                Height = sw.GridLength.Auto
            });
            grid.Children.Add(swcimage);
            grid.Children.Add(label);

            Control.Content = grid;
        }