none
How to get add collapsible panel from one silverlight page to another silverlight page

    问题

  • I have created one silverlight project with one masterpage.xaml. Now i want to open the pages which are in this project through masterpage. i have written code like

     public MasterPage(Page chldPage)
            {
                InitializeComponent();
     
                txtblkPageTitle.Text = chldPage.Title;
                subgrid.Height = chldPage.Height;
           
                subgrid.Children.Add(chldPage);
                
            }

    And My masterpage xaml code look like is

    <UserControl x:Class="BasePage.MasterPage"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                  xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
                    xmlns:Knowledgecast="clr-namespace:Knowledgecast.Controls;assembly=Knowledgecast.Controls"
                 xmlns:IC="clr-namespace:Silverlight.InputCtrl;assembly=Silverlight.InputCtrl"
               mc:Ignorable="d"
                    
               xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
               d:DesignWidth="1024">
              
        <Grid x:Name="MainGrid" VerticalAlignment="Top" HorizontalAlignment="Left" Width="1034">
            <Grid x:Name="Layoutroot" VerticalAlignment="Top">
                <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
              
            </Grid.RowDefinitions>
            <Image Style="{StaticResource HeaderBackGroundImage}" Grid.Row="0"/>
          
            
            <Grid x:Name="subgrid" Grid.Row="1" HorizontalAlignment="Left">
                <Grid.RowDefinitions>
                    <RowDefinition/>

                </Grid.RowDefinitions>
                    <Image Style="{StaticResource MiddleBackGroundImage}"/>
                
                <Canvas  VerticalAlignment="Top">
                        <Button Name="btnNew"  Width="70"  Content="New"  Grid.Row="1"  Margin="28,18"  HorizontalAlignment="Left" VerticalAlignment="Top" Canvas.Left="0" />
                        <Button Name="btnView"  Width="70"  Content="View" Grid.Row="1" Margin="106,18" HorizontalAlignment="Left" VerticalAlignment="Top" Canvas.Left="-1" />
                        <Button Name="btnEdit"  Width="70"  Content="Edit" Grid.Row="1" Margin="184,18" HorizontalAlignment="Left" VerticalAlignment="Top" Canvas.Left="-2" />
                        <IC:ButtonValidator Style="{StaticResource SaveButtonStyle}"  GroupValidator="G1" Name="btnSave"  Width="70"  Content="Save" Grid.Row="1" Margin="260,18" HorizontalAlignment="Left"  VerticalAlignment="Top" Canvas.Left="-1" />
                        <Button Name="btnCopy"  Width="70"  Content="Copy" Grid.Row="1" Margin="336,18" HorizontalAlignment="Left" VerticalAlignment="Top"  />
                        <Button Name="btnReset" Width="70"  Content="Reset" Grid.Row="1" Margin="413,18,310,10"  HorizontalAlignment="Left"  VerticalAlignment="Top" />
                        <Button Name="btnList"  Width="70"  Content="List" Grid.Row="1" Margin="241,18" Canvas.Left="249" VerticalAlignment="Top" />
                        <Canvas Canvas.Left="630" Canvas.Top="55"  Margin="260,5"  Grid.Row="1"  Width="180">

                            <TextBlock  Width="136" FontFamily="Arial" FontSize="12" FontWeight="Bold" TextWrapping="Wrap" Text=" Fields are Compulsory"   Canvas.Left="-270" Canvas.Top="-18"/>

                            <Image Style="{StaticResource FeildsMandatoryImage }" Canvas.Left="-286" Canvas.Top="-19" />

                        </Canvas>
                    </Canvas>

            </Grid>
                  
            <Image Style="{StaticResource BottomBackGroundImage}"   Grid.Row="2"/>
            <Canvas   Name="gdErrorMessage" HorizontalAlignment="Left" Grid.Row="2" Width="800">
                <Border  Style="{StaticResource CnvsBorder}" Visibility="Visible"  Height="45" Width="772"  VerticalAlignment="Top" Grid.ColumnSpan="1" Grid.Row="4" Canvas.Top="0" Canvas.Left="-6">
                    <Image Name="imgWarning" Style="{StaticResource  WarningImage}"  />
                </Border>
                <sdk:Label   Name="lblValidation" Style="{StaticResource errormessage}" Canvas.Top="-31" Canvas.Left="104" />

            </Canvas>
            <Image Width="40"  Style="{ StaticResource PageHeaderSymbol}"/>
            <TextBlock Name="txtblkPageTitle" HorizontalAlignment="Center" Style="{ StaticResource PageNameHeaderBlock}">
     <TextBlock.Effect>
     <DropShadowEffect ShadowDepth="2" Direction="327" Color="#FF505050"/>
     </TextBlock.Effect>
            </TextBlock>
          
        </Grid>
            <Grid x:Name="gdcoll" Margin="800,3,10,0" Width="224">

            </Grid>
        </Grid>
       </UserControl>

    Here i am opening page in subgrid. if i do not have collapsible panel it is ok. but if i have collapsible panel in childpage then collapsible panel is appearence is not proper because i am assiging child page height to masterpage subgrid height which is in row position 1. In row position o i have header image and canvas. that's why collapsible panel also starts from row position 1. so above collpsible panel space looking as empty. How to rectify this. Please help me .

    2012年8月18日 6:13

全部回复