Inheritance: RoutedEventArgs, ISizeChangedEventArgs
        private void ScrollViewer_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            grid.Width = this.ActualWidth;
            grid.Height = this.ActualHeight;

            (DataContext as BookFixed2ViewModels.PageViewModel).UpdateSource();
        }
 private void ContentDisplay_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (this.manager != null)
     {
         this.manager.SetRenderSize(new Size(this.ActualWidth, this.ActualHeight));
     }
 }
Beispiel #3
0
 private void UserControlBaseSizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (!ViewModelBase.IsInDesignModeStatic)
     {
         CheckOrientation();
     }
 }
 private void StrechItemsListView_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (ItemsPanelRoot != null)
     {
         ItemsPanelRoot.Width = e.NewSize.Width;
     }
 }
Beispiel #5
0
        /// <summary>
        /// Check app bar size changed event and reserve space for app bar
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void AppBar_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            // Reserve space on the page when an opaque AppBar.
            bool reserveAppBarSpace = this.BottomAppBar.Opacity >= 1.0
                && this.BottomAppBar.Visibility == Visibility.Visible;

            if (reserveAppBarSpace)
            {
                Thickness defaultPageMargin = default(Thickness);
                switch (DisplayInformation.GetForCurrentView().CurrentOrientation)
                {
                    case DisplayOrientations.Landscape:
                        defaultPageMargin.Right = this.BottomAppBar.Width;
                        break;
                    case DisplayOrientations.LandscapeFlipped:
                        defaultPageMargin.Left = this.BottomAppBar.Width;
                        break;
                    case DisplayOrientations.Portrait:
                        defaultPageMargin.Bottom = this.BottomAppBar.Height;
                        break;
                }

                this.Margin = defaultPageMargin;
            }
        }
        private void pageRoot_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            bool isPortrait = e.NewSize.Width < e.NewSize.Height;

            if (isPortrait)
            {
                hub.Orientation = Orientation.Vertical;
                //ScrollViewer.SetVerticalScrollMode(hub, ScrollMode.Enabled);
                //ScrollViewer.SetVerticalScrollBarVisibility(hub, ScrollBarVisibility.Auto);
                //ScrollViewer.SetHorizontalScrollMode(hub, ScrollMode.Disabled);
                //ScrollViewer.SetHorizontalScrollBarVisibility(hub, ScrollBarVisibility.Disabled);

                hub.Sections[2].Style = (Style)App.Current.Resources["FirstHubSectionStyle"];
                hub.Sections[3].Style = (Style)App.Current.Resources["FirstHubSectionStyle"];
            }
            else
            {
                hub.Orientation = Orientation.Horizontal;
                //ScrollViewer.SetVerticalScrollMode(hub, ScrollMode.Disabled);
                //ScrollViewer.SetVerticalScrollBarVisibility(hub, ScrollBarVisibility.Disabled);
                //ScrollViewer.SetHorizontalScrollMode(hub, ScrollMode.Enabled);
                //ScrollViewer.SetHorizontalScrollBarVisibility(hub, ScrollBarVisibility.Auto);

                hub.Sections[2].Style = null;
                hub.Sections[3].Style = null;
            }
        }
Beispiel #7
0
        private void Page_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            ViewState = ApplicationView.Value;
            if (ViewState == ApplicationViewState.Snapped)
            {
                if (Page.TopAppBar != null)
                {
                    topBar = Page.TopAppBar;
                    Page.TopAppBar = null;
                }
                if (Page.BottomAppBar != null)
                {
                    bottomBar = Page.BottomAppBar;
                    Page.BottomAppBar = null;
                }
            }
            else if (topBar != null || bottomBar != null)
            {
                Page.TopAppBar = topBar;
                Page.BottomAppBar = bottomBar;

                topBar = null;
                bottomBar = null;
            }

            OnApplicationViewStateChanged();
        }
 private void OnWindowSizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (ShouldGoToWideState())
     {
         Frame.GoBack();
     }
 }
        private void MainHubPage_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            vm.Refresh();

            VehiclesHubSection_OnLoaded(this, null);
            FrameworkElement_OnLoaded(this, null);
        }
        void FAGlobeChart_SizeChanged(object sender, SizeChangedEventArgs e)
        {

            //this.m_renderSize = this.RenderSize;
            this.Render(this.RenderSize);
            //throw new NotImplementedException();
        }
Beispiel #11
0
 private void CurrentGrid_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (e.NewSize.Height > 0 && e.NewSize.Width > 0)
     {
         //UpdateItemsSize(e.NewSize);
     }
 }
Beispiel #12
0
        private void FrameworkElement_OnSizeChanged(object sender, SizeChangedEventArgs e)
        {
            var listview = sender as ListBox;
            if (listview == null) return;

            var scrollviewr = listview.GetFirstDescendantOfType<ScrollViewer>();
            if (scrollviewr!=null)
            {
                scrollviewr.HorizontalScrollMode = ScrollMode.Disabled;
                scrollviewr.VerticalScrollMode = ScrollMode.Disabled;

            }
            var panel = (VirtualizingStackPanel)(listview.ItemsPanelRoot);

            if (panel == null) throw new ArgumentNullException(nameof(panel));

            var width = e.NewSize.Width;

            var items = panel.Children;
            foreach (var item in  items)
            {
                var listBoxItem = item as ListBoxItem;
                if (listBoxItem != null) listBoxItem.Width = width/items.Count;
            }
            //panel.it = width/5;
        }
 private void Page_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (ActualWidth >= 720)
     {
         baba.NavigatetoSettings((SettingsList.Items[0] as SettingOption).Option);
     }
 }
        private void LayoutrootSizeChanged(object sender, SizeChangedEventArgs e)
        {
            if (Layoutroot.ActualWidth > FullWidth)
            {
                btn_Back.Visibility = Visibility.Collapsed;

                ContentColumnDefinition1.Width = new GridLength(320, GridUnitType.Pixel);
                ContentColumnDefinition2.Width = new GridLength(1, GridUnitType.Star);

                Right.Visibility = Visibility.Visible;
            }
            else if (!RightEverShowed)
            {
                ContentColumnDefinition1.Width = new GridLength(1, GridUnitType.Star);
                ContentColumnDefinition2.Width = new GridLength(0, GridUnitType.Pixel);
                btn_Back.Visibility = Visibility.Collapsed;
                Right.Visibility = Visibility.Collapsed;
            }
            else
            {
                btn_Back.Visibility = Visibility.Visible;
                ContentColumnDefinition1.Width = new GridLength(0, GridUnitType.Pixel);
                ContentColumnDefinition2.Width = new GridLength(1, GridUnitType.Star);
                Right.Visibility = Visibility.Visible;
            }
        }
 private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (e.NewSize.Width > e.NewSize.Height)
         demoPanel.Orientation = Orientation.Horizontal;
     else
         demoPanel.Orientation = Orientation.Vertical;
 }
Beispiel #16
0
 public void OnSizeChanged(object sender, SizeChangedEventArgs e)
 {
     Clip = new RectangleGeometry()
     {
         Rect = new Rect(0, 0, e.NewSize.Width, e.NewSize.Height)
     };
 }
Beispiel #17
0
 /// <summary>
 /// Handler for SizeChanged event, handles cliping
 /// </summary>
 private void RefreshableListView_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     Clip = new RectangleGeometry()
     {
         Rect = new Rect(0, 0, e.NewSize.Width, e.NewSize.Height)
     };
 }
Beispiel #18
0
        private void AddContributionsPage_SizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
        {
            if (e.NewSize.Width < 641)
            {
                BottomRowDefinition.Height = new GridLength(1, GridUnitType.Star);
                Grid.SetColumnSpan(FormGrid, 3);

                Grid.SetRow(QueueGrid, 2);
                Grid.SetColumn(QueueGrid, 0);
                Grid.SetColumnSpan(QueueGrid, 3);

                SplitterRectangle.Visibility = Visibility.Collapsed;
            }
            else
            {
                BottomRowDefinition.Height = new GridLength(1, GridUnitType.Auto);

                Grid.SetColumnSpan(FormGrid, 1);

                Grid.SetRow(QueueGrid, 1);
                Grid.SetColumn(QueueGrid, 2);
                Grid.SetColumnSpan(QueueGrid, 1);

                SplitterRectangle.Visibility = Visibility.Visible;
            }
        }
        private void allContactsPage1_SizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
        {
            if (ActualWidth < 700)
            {
                zoom.Width = ActualWidth - 40;
            }
            else
            {
                zoom.Width = 700;
            }

            if (allContacts.Contacts.Items.Count == 0)
            {
                addContactButtonPanel.Visibility = Visibility.Visible;
                addContactButtonPanel.Margin     = new Thickness(50);
                addContactMessage.Visibility     = Visibility.Visible;
                MainEventGrid.Visibility         = Visibility.Collapsed;
            }
            else
            {
                MainEventGrid.Visibility     = Visibility.Visible;
                addContactMessage.Visibility = Visibility.Collapsed;
                addContactButtonPanel.Margin = new Thickness(0);

                if (ActualWidth < (double)Application.Current.Resources["AppNarrowWidth"])
                {
                    addContactButtonPanel.Visibility = Visibility.Visible;
                }
                else
                {
                    addContactButtonPanel.Visibility = Visibility.Collapsed;
                }
            }
        }
Beispiel #20
0
        private void OnSizeChanged(object sender, SizeChangedEventArgs e)
        {
            // How much room do we have?
            double gridMargin = 20;
            double gridWidth = e.NewSize.Width - gridMargin;

            // How much do we allow for each item?
            const double itemWidth = 330;

            // We want at least 3 across
            if (itemWidth * 3 <= gridWidth)
            {
                if (currentVisualState != VisualState.Big)
                {
                    VisualStateManager.GoToState(this, "BigScreen", false);
                    currentVisualState = VisualState.Big;
                }
            }
            else
            {
                if (currentVisualState != VisualState.Small)
                {
                    VisualStateManager.GoToState(this, "SmallScreen", false);
                    currentVisualState = VisualState.Small;
                }
            }
        }
Beispiel #21
0
        void VerticalHubPage_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            if (e.NewSize.Width < 800)
            {
                mainhub.Orientation = Orientation.Vertical;
                ScrollViewer.SetVerticalScrollMode(mainhub, ScrollMode.Enabled);
                ScrollViewer.SetHorizontalScrollMode(mainhub, ScrollMode.Disabled);
                ScrollViewer.SetVerticalScrollBarVisibility(mainhub, ScrollBarVisibility.Auto);
                ScrollViewer.SetHorizontalScrollBarVisibility(mainhub, ScrollBarVisibility.Disabled);

                HeroSection.Width = e.NewSize.Width - 50;
                HeroSection.Height = 300;
                HeroSection.Margin = new Thickness(50.0, 150.0, 0, 0);

            }
            else
            {
                mainhub.Orientation = Orientation.Horizontal;
                ScrollViewer.SetVerticalScrollMode(mainhub, ScrollMode.Disabled);
                ScrollViewer.SetHorizontalScrollMode(mainhub, ScrollMode.Enabled);
                ScrollViewer.SetVerticalScrollBarVisibility(mainhub, ScrollBarVisibility.Disabled);
                ScrollViewer.SetHorizontalScrollBarVisibility(mainhub, ScrollBarVisibility.Auto);

                HeroSection.Width = previousWidth;
                HeroSection.Height = previousHeight;
                HeroSection.Margin = previousMargin;
            }
        }
 private void MainPage_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     if ((ApplicationView.GetForCurrentView().Orientation == ApplicationViewOrientation.Landscape) == smallView)
     {
         AlignElements();
     }
 }
 //page resize
 private void OptimizeLook(object sender, SizeChangedEventArgs e)
 {
     ItemsWrapGrid appItemsPanel = (ItemsWrapGrid)NewsList.ItemsPanelRoot;
     if (appItemsPanel != null)
     {
         double screenWidth = Window.Current.Bounds.Width;
         //privremeno...
         if (screenWidth >= 1500)
         {
             appItemsPanel.ItemWidth = screenWidth / 4 - 30;
         }
         else if (screenWidth >= 1100)
         {
             appItemsPanel.ItemWidth = screenWidth / 3 - 40;
         }
         else if (screenWidth >= 700)
         {
             appItemsPanel.ItemWidth = screenWidth / 2 - 80;
         }
         else
         {
             appItemsPanel.ItemWidth = screenWidth - 60;
         }
         //double moduo300 = Math.Round((screenWidth - 700) / 300);
         //appItemsPanel.ItemWidth = (screenWidth / (moduo300 + 2)) - (60 - 10 * moduo300);
     }
 }
Beispiel #24
0
 private void LayoutAwarePage_SizeChanged_1(object sender, SizeChangedEventArgs e)
 {
     if (ApplicationView.Value != ApplicationViewState.Snapped)
     {
         gridMembri.Height = gridWannabe.Height = gridAlumnus.Height = Window.Current.Bounds.Height - 260;
     }
 }
        private void Page_SizeChanged(object sender, SizeChangedEventArgs e)
        {
          //  float taux=  this.MaxWidth/


            if (this.ActualWidth > 1000)
            { descriptionTextBox.Text = APPDESCRIPTION_XL;
                descriptionTextBox.FontSize = 14;

            }else
                   if (this.ActualWidth > 600)
            {
                descriptionTextBox.Text = APPDESCRIPTION_S;
                descriptionTextBox.FontSize = 16;

            }

            else
            {
                descriptionTextBox.Text = APPDESCRIPTION_S;
                descriptionTextBox.FontSize = 13;
            }

            float x = (float)(this.ActualHeight / 640.00);
            contentScroller.ChangeView(null, null, x);
            contentScroller.Height = this.ActualHeight-55;




        }
Beispiel #26
0
        private void OnSizeChanged(object sender, SizeChangedEventArgs sizeChangedEventArgs)
        {
            DispatchHelper.Invoke(() =>
            {
                if (sizeChangedEventArgs.NewSize.Width < 1080)
                {
                    SectionsGrid.Margin = new Thickness(40, 0, 0, 0);
                }
                else
                {
                    SectionsGrid.Margin = new Thickness(50, 0, 0, 0);
                }


                if (sizeChangedEventArgs.NewSize.Width == 320)
                {
                    FullGrid.Visibility = Visibility.Collapsed;
                    SnapGrid.Visibility = Visibility.Visible;
                    SectionsHeaderListView.Visibility = Visibility.Collapsed;
                    SectionsGrid.Margin = new Thickness(0);
                }
                else
                {
                    FullGrid.Visibility = Visibility.Visible;
                    SnapGrid.Visibility = Visibility.Collapsed;
                    SectionsHeaderListView.Visibility = Visibility.Visible;
                    SectionsGrid.Margin = new Thickness(50, 0, 0, 0);
                }
            });
        }
Beispiel #27
0
        private void ListView_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            var listview = sender as ListView;
            if (listview == null) return;

            var panel = (ItemsWrapGrid)(listview.ItemsPanelRoot);

            if (panel == null) throw new ArgumentNullException(nameof(panel));

            var width = e.NewSize.Width;

            var count = (int)width / 480;

            switch (count)
            {
                case 0:
                case 1:
                    panel.ItemWidth = width;
                    break;
                case 2:
                    panel.ItemWidth = width / 2;
                    break;
                case 3:
                    panel.ItemWidth = width / 3;
                    break;
                default:
                    panel.ItemWidth = width / 3;
                    break;

            }
        }
 private void LayoutrootSizeChanged(object sender, SizeChangedEventArgs e)
 {
     // 如果调整宽度大最大的预期宽度时.
     //将列表宽度设置为MinListWidth,并扩展文章内容填满空间
     if (Layoutroot.ActualWidth > FullWidth)
     {
         ContentColumnDefinition1.Width = Grid320Pixel;
         ContentColumnDefinition2.Width = GridOneStar;
         ArticleContorl.BackBtnVisibility = Visibility.Collapsed;
     }
     //调整宽度时,如果从未显示过文章内容,则只改变列表的宽度
     else if (!RightEverShowed)
     {
         ContentColumnDefinition1.Width = GridOneStar;
         ContentColumnDefinition2.Width = GridZeroPixel;
         ArticleContorl.BackBtnVisibility = Visibility.Collapsed;
     }
     //如果文章内容曾经显示过,则隐藏列表
     else
     {
         ContentColumnDefinition1.Width = GridZeroPixel;
         ContentColumnDefinition2.Width = GridOneStar;
         ArticleContorl.BackBtnVisibility = Visibility.Visible;
     }
 }
 private void Newsfeed_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     ItemsWrapGrid MyItemsPanel = (ItemsWrapGrid)Newsfeed.ItemsPanelRoot;
     var width = e.NewSize.Width / 2;
     MyItemsPanel.ItemWidth = width;
     Messenger.Default.Send(new WidthMessage() { Width = width });     
 }
 /// <summary>
 /// Workaround to change the width of all items on changing the with of the window.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void MainPage_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     foreach (var task in TaskList.Items.Cast<ITaskViewModel>())
     {
         task.ItemVisualWidth = this.ActualWidth;
     }
 }
Beispiel #31
0
        private async void OnSizeChanged(object sender, SizeChangedEventArgs sizeChangedEventArgs)
        {
            var x = Window.Current.Bounds.Width;
            var y = Window.Current.Bounds.Height;
            await Locator.PlayVideoVM.SetSizeVideoPlayer((uint)x, (uint)y);

            if (x == 320)
            {
                ControlsGrid.Height = 200;
                BackButton.Margin = new Thickness(5, 50, 0, 50);
                MainButtonsNormal.Visibility = Visibility.Collapsed;
                SecondaryButtonsNormalLeft.Visibility = Visibility.Collapsed;
                SecondaryButtonsNormalRight.Visibility = Visibility.Collapsed;

                MainButtonsSnapped.Visibility = Visibility.Visible;
                SecondaryButtonsSnapped.Visibility = Visibility.Visible;
            }
            else
            {
                ControlsGrid.Height = 165;
                BackButton.Margin = new Thickness(50, 50, 0, 50);
                MainButtonsNormal.Visibility = Visibility.Visible;
                SecondaryButtonsNormalLeft.Visibility = Visibility.Visible;
                SecondaryButtonsNormalRight.Visibility = Visibility.Visible;

                MainButtonsSnapped.Visibility = Visibility.Collapsed;
                SecondaryButtonsSnapped.Visibility = Visibility.Collapsed;
            }
        }
Beispiel #32
0
        private void PanelSizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
        {
            UIElement element = sender as UIElement;

            element.Clip = new RectangleGeometry()
            {
                Rect = new Rect(0, 0, e.NewSize.Width, e.NewSize.Height)
            };

            ShadowSide side = this.ShadowSide;

            float width  = (float)this.ActualWidth;
            float height = (float)this.ActualHeight;

            if (side == ShadowSide.Left)
            {
                _dropShadow.Offset = new Vector3(2.5f - width, 0, 0);
            }
            else if (side == ShadowSide.Right)
            {
                _dropShadow.Offset = new Vector3(width - 2.5f, 0, 0); // 2.5f
            }
            else if (side == ShadowSide.Top)
            {
                _dropShadow.Offset = new Vector3(0, 2.5f - height, 0);
            }
            else if (side == ShadowSide.Bottom)
            {
                _dropShadow.Offset = new Vector3(0, height - 2.5f, 0);
            }

            _shadowVisual.Size = new Vector2((float)this.ActualWidth, (float)this.ActualHeight);
        }
Beispiel #33
0
        private async void Control_SizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
        {
            //Debug.WriteLine("Control_SizeChanged");

            DrawImage = await Element.DrawImmageRequestAsync(Element.ViewPoint, Matrix2.Enlargement(ViewSize, 1 / Element.ViewScale, 1 / Element.ViewScale));

            Control.Invalidate();
        }
Beispiel #34
0
 private void MainGridView_SizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
 {
     if (_storeditem != null)
     {
         MainGridView.ScrollIntoView(_storeditem);
         MainGridView.UpdateLayout();
     }
 }
Beispiel #35
0
 private void ExtendSplitView_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     var width = e.NewSize.Width;
     if (width>MinBottomWidth)
     {
         VisualStateManager.GoToState(this, "ClosedCompactLeft", true);
     }
 }
Beispiel #36
0
 private void mainpage_hasframe(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
 {
     bool isFirstRun = IsFirstRun();
     if (isFirstRun && !ranOnceThisSession)
     {
         this.Frame.Navigate(typeof(GenerateKeyPage));
         ranOnceThisSession = true;
     }
 }
Beispiel #37
0
        private void OnSwapPanelSizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
        {
            var device = XamlGraphicsDevice.Instance;

            if (device.HasBackgroundPanel)
            {
                device.Resize((int)e.NewSize.Width, (int)e.NewSize.Height);
            }
        }
Beispiel #38
0
 private void OccupyStack_SizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
 {
     Width = Window.Current.Bounds.Width;
     UpdateLayout();
     foreach (Button but in Children)
     {
         but.Height = ((Grid)Parent).ActualHeight;
         but.Width  = ActualWidth / Children.Count;
     }
 }
        private void Page_SizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
        {
            bool narrow = e.NewSize.Width < 850;

            Full.Visibility = !narrow
                ? Windows.UI.Xaml.Visibility.Visible
                : Windows.UI.Xaml.Visibility.Collapsed;
            Snapped.Visibility = narrow
                ? Windows.UI.Xaml.Visibility.Visible
                : Windows.UI.Xaml.Visibility.Collapsed;
        }
Beispiel #40
0
        private void ChatListView_SizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
        {
            if (_scrollViewer == null)
            {
                return;
            }

            if (_scrollViewer.VerticalOffset >= _scrollViewer.ScrollableHeight - 10)
            {
                _scrollViewer.ChangeView(null, _scrollViewer.ScrollableHeight, null, true);
            }
        }
 private void UserControl_SizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
 {
     if (ActualWidth >= 500)
     {
         gridSmall.Visibility       = Visibility.Collapsed;
         stackPanelLarge.Visibility = Visibility.Visible;
     }
     else
     {
         gridSmall.Visibility       = Visibility.Visible;
         stackPanelLarge.Visibility = Visibility.Collapsed;
     }
 }
        private void OnSizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
        {
            var canvas = sender as Windows.UI.Xaml.Controls.Canvas;

            // If resized object is a canvas, update clipping geometry to its new size
            if (canvas != null)
            {
                canvas.Clip = new Windows.UI.Xaml.Media.RectangleGeometry
                {
                    Rect = new Windows.Foundation.Rect(0, 0, canvas.ActualWidth, canvas.ActualHeight)
                };
            }
        }
Beispiel #43
0
        //----------------------------------------------------------------------
        private void GridView_HandleSizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
        {
            var theGrid = sender as GridView;

            if (theGrid == null)
            {
                return;
            }

            var theUsableWidth = theGrid.ActualWidth - 12 /*scrollbar*/;
            var theColumns     = Math.Max(1, Math.Floor(theUsableWidth / scInitialWidthSize));

            DesiredItemWidth  = (theUsableWidth / theColumns) - 10 /*padding size*/;
            DesiredItemHeight = DesiredItemWidth / scWidthToHeightRatio;
        }
Beispiel #44
0
 private void Page_SizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
 {
     if (e.NewSize.Width < 700.0)
     {
         VisualStateManager.GoToState(this, "MinimalLayout", true);
     }
     else if (e.NewSize.Width < e.NewSize.Height)
     {
         VisualStateManager.GoToState(this, "PortraitLayout", true);
     }
     else
     {
         VisualStateManager.GoToState(this, "DefaultLayout", true);
     }
 }
Beispiel #45
0
 private void OnSizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
 {
     if (m_rootVisual != null)
     {
         m_rootVisual.Size = new System.Numerics.Vector2((float)this.ActualWidth, (float)this.ActualHeight);
         if (m_matrixExpression != null)
         {
             m_matrixExpression.Properties.InsertVector3("LayoutSize", new Vector3(m_rootVisual.Size, 0));
         }
         else
         {
             UpdatePerspectiveMatrix();
         }
     }
 }