Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Floating control at the bottom of the web page??

Floating control at the bottom of the web page??

Scheduled Pinned Locked Moved WPF
cssquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sunil P V
    wrote on last edited by
    #1

    Hi All, I am working on Silverlight 2.0. I have a grid (which is actually a menu) in my silverlight page. I want this grid to have a floating capability, that is, as and when the user scrolls, it should always stick to the bottom of the page or at the centre of the page page. Even when the page is minimized/maximized, this grid should be placed to the bottom of the page. Is there an option in silverlight to dock a control to the any particular portion of the page ? Is coding necessary to create such an effect? Any pointers to online samples or code snippets will be really helpful. Thanks in advance.

    Sunil

    M 1 Reply Last reply
    0
    • S Sunil P V

      Hi All, I am working on Silverlight 2.0. I have a grid (which is actually a menu) in my silverlight page. I want this grid to have a floating capability, that is, as and when the user scrolls, it should always stick to the bottom of the page or at the centre of the page page. Even when the page is minimized/maximized, this grid should be placed to the bottom of the page. Is there an option in silverlight to dock a control to the any particular portion of the page ? Is coding necessary to create such an effect? Any pointers to online samples or code snippets will be really helpful. Thanks in advance.

      Sunil

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      The layout of the Silverlight control plugin on a page is an HTML issue and outside the scope of this message board. For layout within your Silverlight app, you need to use the elements that give you the functionality you need. A couple possible solutions: The Silverlight Toolkit[^] has a DockPanel element you could use to fix the grid at the bottom. You could also use an outer grid with two rows - the first row star-sized, and the second row fixed/auto sized. Put the grid you want fixed to the bottom in the second row of the outer grid.

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      S 1 Reply Last reply
      0
      • M Mark Salsbery

        The layout of the Silverlight control plugin on a page is an HTML issue and outside the scope of this message board. For layout within your Silverlight app, you need to use the elements that give you the functionality you need. A couple possible solutions: The Silverlight Toolkit[^] has a DockPanel element you could use to fix the grid at the bottom. You could also use an outer grid with two rows - the first row star-sized, and the second row fixed/auto sized. Put the grid you want fixed to the bottom in the second row of the outer grid.

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        S Offline
        S Offline
        Sunil P V
        wrote on last edited by
        #3

        Mark, I suppose there is a disconnect in the issue that i am facing and the your understanding of my issue. I do know that silverlight is a plugin. What I wanted to achieve is like this: 1. A complete silverlight web page. 2. A menu (silverlight control) that floats top of this silverlight page. When the user scrolls the silverlight page, the menu should still be as docked botttom to the page. I hope i am clear. Please let me know if I should elaborate the problem. Thanks.

        Sunil

        M 1 Reply Last reply
        0
        • S Sunil P V

          Mark, I suppose there is a disconnect in the issue that i am facing and the your understanding of my issue. I do know that silverlight is a plugin. What I wanted to achieve is like this: 1. A complete silverlight web page. 2. A menu (silverlight control) that floats top of this silverlight page. When the user scrolls the silverlight page, the menu should still be as docked botttom to the page. I hope i am clear. Please let me know if I should elaborate the problem. Thanks.

          Sunil

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          I'm not sure what you mean by "floats" but I gave you two possible solutions for docking something to the bottom of the page... Use a DockPanel:

          <UserControl x:Class="SilverlightTester.MyPage"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:stk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
          >
          <stk:DockPanel x:Name="layoutRoot" >

              <!-- This is the menu that stays anchored at the bottom of the page -->
              <StackPanel stk:DockPanel.Dock="Bottom" Orientation="Horizontal" Background="SteelBlue" >
                  <Button Content="Menu 1" />
                  <Button Content="Menu 2" />
                  <Button Content="Menu 3" />
              </StackPanel>
          
              <!-- This is the main body of the page (scrollable) -->
              <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" >
                  <Grid Width="1000" Height="1000" Background="LightSteelBlue" />
              </ScrollViewer>
          
          </stk:DockPanel>
          

          </UserControl>

          Use a Grid:

          <UserControl x:Class="SilverlightTester.MyPage"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          >
          <Grid x:Name="layoutRoot" >

              <Grid.RowDefinitions>
                  <RowDefinition Height="\*" />
                  <RowDefinition Height="Auto" />
              </Grid.RowDefinitions>
              
              <!-- This is the main body of the page (scrollable) -->
              <ScrollViewer Grid.Row="0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" >
                  <Grid Width="1000" Height="1000" Background="LightSteelBlue" />
              </ScrollViewer>
          
              <!-- This is the menu that stays anchored at the bottom of the page -->
              <StackPanel Grid.Row="1" Orientation="Horizontal" Background="SteelBlue" >
                  <Button Content="Menu 1" />
                  <Button Content="Menu 2" />
                  <Button Content="Menu 3" />
              </StackPanel> 
              
          </Grid>
          

          </UserControl>

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          S 1 Reply Last reply
          0
          • M Mark Salsbery

            I'm not sure what you mean by "floats" but I gave you two possible solutions for docking something to the bottom of the page... Use a DockPanel:

            <UserControl x:Class="SilverlightTester.MyPage"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:stk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
            >
            <stk:DockPanel x:Name="layoutRoot" >

                <!-- This is the menu that stays anchored at the bottom of the page -->
                <StackPanel stk:DockPanel.Dock="Bottom" Orientation="Horizontal" Background="SteelBlue" >
                    <Button Content="Menu 1" />
                    <Button Content="Menu 2" />
                    <Button Content="Menu 3" />
                </StackPanel>
            
                <!-- This is the main body of the page (scrollable) -->
                <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" >
                    <Grid Width="1000" Height="1000" Background="LightSteelBlue" />
                </ScrollViewer>
            
            </stk:DockPanel>
            

            </UserControl>

            Use a Grid:

            <UserControl x:Class="SilverlightTester.MyPage"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            >
            <Grid x:Name="layoutRoot" >

                <Grid.RowDefinitions>
                    <RowDefinition Height="\*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                
                <!-- This is the main body of the page (scrollable) -->
                <ScrollViewer Grid.Row="0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" >
                    <Grid Width="1000" Height="1000" Background="LightSteelBlue" />
                </ScrollViewer>
            
                <!-- This is the menu that stays anchored at the bottom of the page -->
                <StackPanel Grid.Row="1" Orientation="Horizontal" Background="SteelBlue" >
                    <Button Content="Menu 1" />
                    <Button Content="Menu 2" />
                    <Button Content="Menu 3" />
                </StackPanel> 
                
            </Grid>
            

            </UserControl>

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            S Offline
            S Offline
            Sunil P V
            wrote on last edited by
            #5

            Hi Mark, Thanks for your suggestion. I had to do a little tweaking to the canvas and i was able to achieve what I wished for. I could mail the .xap and html file of my prototype if you need. I will surely try out as per your suggestion and let you know... Thanks for your time.

            Sunil

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups