none
To call Page from Page Login

    General discussion

  • Hi

    In an business application, the visual studio 2010 creates  the login, home and about pages. I created another page.

    As I make to call this page from login page of form that it is inside of main page as well as the page home?
    Thank's
    Teles
    Thursday, February 02, 2012 9:05 AM

All replies

  • ContentFrame.Navigate(New Uri("/Views/vForm1.xaml", UriKind.Relative))
    http://stackoverflow.com/questions/543602/silverlight-helix-code-behind-page-navigation
    Thursday, February 02, 2012 10:05 AM
  • Hi,

    As it said, I created this application now. I only implemented this line:
    MainPage page = new MainPage();
    Uri uri = new Uri("Report.xaml", UriKind.Relative);
    page.ContentFrame.Navigate(uri);
     
    After this occurred the error. What it is this error?
    XamlParseException
    Failed to assign to property 'System.Windows.Controls.Primitives.ButtonBase.Click'. [Line: 33 "padding:0.6em">Thankyou
    Nádia
     
    Thursday, February 02, 2012 11:12 AM
  • Could you share the Report.xaml content

    Thanks,

    Bimal

    Thursday, February 02, 2012 11:14 AM
  • Hi.
    It follows xaml.
    Report.xaml
    <navigation:Page x:Class="SL_WebView.RelatorioEventoAcesso" 
               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"
               mc:Ignorable="d"
               xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
               d:DesignWidth="640" d:DesignHeight="480" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
               Title="RelatorioEventoAcesso Page">
        <Grid x:Name="LayoutRoot" Width="550">
            <Grid Margin="0,0,0,0" Name="Main" Width="550">
                <Grid.RowDefinitions>
                    <RowDefinition Height="2*" />
                    <RowDefinition Height="42*" />
                    <RowDefinition Height="2*" />
                    <RowDefinition Height="42*" />
                    <RowDefinition Height="2*" />
                    <RowDefinition Height="42*" />
                    <RowDefinition Height="2*" />
                    <RowDefinition Height="42*" />
                    <RowDefinition Height="2*" />
                    <RowDefinition Height="42*" />
                    <RowDefinition Height="2*" />
                    <RowDefinition Height="84*" />
                    <RowDefinition Height="2*" />
                    <RowDefinition Height="70*" />
                    <RowDefinition Height="2*" />
                    <RowDefinition Height="56*" />
                    <RowDefinition Height="2*" />
                    <RowDefinition Height="42" />
                    <RowDefinition Height="42*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="120*" />
                    <ColumnDefinition Width="1*" />
                    <ColumnDefinition Width="407*" />
                    <ColumnDefinition Width="3*" />
                </Grid.ColumnDefinitions>
    
                <Border x:Name="MainPanel" BorderBrush="Silver" BorderThickness="2" CornerRadius="5,5,5,5" Background="#19FFFFFF" RenderTransformOrigin="0.5,0.5" Grid.ColumnSpan="5" Grid.RowSpan="18" />
                <Border BorderBrush="Silver" BorderThickness="1" Name="border2" Grid.ColumnSpan="5" Grid.Row="1" CornerRadius="5" Margin="0,4,0,0">
                    <StackPanel Height="32" Name="stackPanel1" Width="546" HorizontalAlignment="Left" VerticalAlignment="Stretch" Orientation="Horizontal">
                        <TextBlock Height="22" Name="textBlock1" Text="Relatório de Eventos de Acessos" Width="548" HorizontalAlignment="Left" VerticalAlignment="Stretch" FontSize="18" TextWrapping="NoWrap" TextAlignment="Center" Foreground="Black"></TextBlock>
                    </StackPanel>
                </Border>
                <Border BorderBrush="Silver"  BorderThickness="1" Name="border3" Grid.Row="3" CornerRadius="5" Grid.ColumnSpan="2">
                    <TextBlock Height="Auto" Name="textBlock2" Text="Relatório" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center" />
                </Border>
                <Border BorderBrush="Silver" BorderThickness="1" Name="border4" Grid.Column="3" Grid.Row="3" CornerRadius="5" Grid.ColumnSpan="2">
                    <ComboBox HorizontalContentAlignment="Center" Name="CbTipoRelatorio" Height="20" Width="390" SelectionChanged="CbTipoRelatorio_SelectionChanged" />
                </Border>
                <Border BorderBrush="Silver" BorderThickness="1" Name="border5" Grid.Row="5" CornerRadius="5" Grid.ColumnSpan="2">
                    <TextBlock Height="Auto" Name="textBlock3" Text="Característica" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center" />
                </Border>
                <Border BorderBrush="Silver" BorderThickness="1" Name="border6" Grid.Column="3" Grid.Row="5" CornerRadius="5" Grid.ColumnSpan="2">
                    <StackPanel Orientation="Horizontal" Height="19" Width="217">
                        <RadioButton IsChecked="True" Content="Texto" Foreground="Black" Height="18" Width="108" HorizontalAlignment="Stretch" Name="opTexto" GroupName="Caracteristica" />
                        <RadioButton Content="Gráfico" Foreground="Black" Height="18" Width="111" GroupName="Caracteristica" Name="opGrafico" />
                    </StackPanel>
                </Border>
                <Border BorderBrush="Silver" BorderThickness="1" Name="border7" Grid.Row="7" CornerRadius="5" Grid.ColumnSpan="2">
                    <TextBlock Height="Auto" Name="textBlock4" Text="Modelo" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center" />
                </Border>
                <Border BorderBrush="Silver"  BorderThickness="1" Name="border8" Grid.Column="3" Grid.Row="7" CornerRadius="5" Grid.ColumnSpan="2">
                    <ComboBox Height="20" HorizontalContentAlignment="Center" Name="CbModeloRelatorio" Width="390" />
                </Border>
                <Border BorderBrush="Silver"  BorderThickness="1" Name="border9" Grid.Row="9" CornerRadius="5" Grid.ColumnSpan="2">
                    <TextBlock Height="Auto" Name="textBlock5" Text="Unidade" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center" />
                </Border>
                <Border BorderBrush="Silver"  BorderThickness="1" Name="border10" Grid.Column="3" Grid.Row="9" CornerRadius="5" Grid.ColumnSpan="2">
                    <ComboBox Height="20" HorizontalContentAlignment="Center" Name="CbUnidade" Width="390" />
                </Border>
                <Border BorderBrush="Silver"  BorderThickness="1" Name="border13" Grid.Row="11" CornerRadius="5" Grid.ColumnSpan="2">
                    <TextBlock Height="Auto" Name="textBlock7" Text="Eventos" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center" />
                </Border>
                <Border BorderBrush="Silver"  BorderThickness="1" Name="border14" Grid.Column="3" Grid.Row="11" CornerRadius="5" Grid.ColumnSpan="2">
                    <ListBox Height="73" Name="LiEventos" Width="390" IsTabStop="False">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <CheckBox Content="{Binding Name}" IsChecked="{Binding Checked,Mode=TwoWay}"></CheckBox>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Border>
                <Border BorderBrush="Silver" BorderThickness="1" Name="border11" Grid.Row="13" CornerRadius="5" Grid.ColumnSpan="2">
                    <TextBlock Height="Auto" Name="textBlock6" Text="Filtros" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center" />
                </Border>
                <Border BorderBrush="Silver" BorderThickness="1" Name="border12" Grid.Column="3" Grid.Row="13" CornerRadius="5" Grid.ColumnSpan="2">
                    <StackPanel Orientation="Vertical" HorizontalAlignment="Center" Height="60" Width="390">
                        <StackPanel Grid.Column="4" Grid.Row="11" Orientation="Horizontal" Margin="0,0,0,0" Width="390" HorizontalAlignment="Stretch">
                            <TextBlock Text="F1:" Foreground="Black" FontSize="9" HorizontalAlignment="Center" VerticalAlignment="Center" Height="13" Width="22" />
                            <ComboBox Height="20" Width="120" HorizontalContentAlignment="Center" Name="CbFiltro1" />
                            <TextBox Height="20" Width="248" HorizontalContentAlignment="Center" Name="txtFiltro1" />
                        </StackPanel>
                        <StackPanel Grid.Column="4" Grid.Row="11" Orientation="Horizontal" Margin="0,0,0,0" Width="390">
                            <TextBlock Text="F2:" Foreground="Black" FontSize="9" HorizontalAlignment="Center" VerticalAlignment="Center" Height="13" Width="22" />
                            <ComboBox Height="20" Width="120" HorizontalContentAlignment="Center" Name="CbFiltro2" />
                            <TextBox Height="20" Width="248" HorizontalContentAlignment="Center" Name="txtFiltro2" />
                        </StackPanel>
                        <StackPanel Grid.Column="4" Grid.Row="11" Orientation="Horizontal" Margin="0,0,0,0" Width="390">
                            <TextBlock Text="F3:" Foreground="Black" FontSize="9" HorizontalAlignment="Center" VerticalAlignment="Center" Height="13" Width="22" />
                            <ComboBox Height="20"  Width="120" HorizontalContentAlignment="Center" Name="CbFiltro3" />
                            <TextBox Height="20" Width="248" HorizontalContentAlignment="Center" Name="txtFiltro3" />
                        </StackPanel>
                    </StackPanel>
                </Border>
                <Border BorderBrush="Silver" BorderThickness="1" Name="border15" Grid.Row="15" CornerRadius="5" Margin="0,0,0,1" Grid.ColumnSpan="2">
                    <TextBlock Height="Auto" Name="textBlock8" Text="Período" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Center" />
                </Border>
                <Border BorderBrush="Silver"  BorderThickness="1" Name="border17" Grid.Column="3" Grid.Row="15" CornerRadius="5" Margin="0,0,0,1" Grid.ColumnSpan="2">
                    <StackPanel Orientation="Vertical" Height="40" Width="388">
                        <StackPanel Grid.Column="4" Grid.Row="11" Orientation="Horizontal" Margin="0,0,0,0" Width="390" HorizontalAlignment="Stretch">
                            <TextBlock FontSize="9" Foreground="Black" HorizontalAlignment="Center" Text="Inicial:" VerticalAlignment="Center" Height="13" Width="35" />
                            <sdk:DatePicker Name="DateTimeInicial" Height="20" Width="170" />
                            <toolkit:TimePicker Height="20" Name="timePickerInicial" Width="170" />
                        </StackPanel>
                        <StackPanel Grid.Column="4" Grid.Row="11" Orientation="Horizontal" Margin="0,0,0,0" Width="390">
                            <TextBlock FontSize="9" Foreground="Black"  HorizontalAlignment="Center" Text="Final:" VerticalAlignment="Center" Height="14" Width="35" />
                            <sdk:DatePicker Name="DateTimeFinal" Height="20" Width="170" />
                            <toolkit:TimePicker Height="20" Name="timePickerFinal" Width="170" />
                        </StackPanel>
    
                    </StackPanel>
    
                </Border>
                <Border BorderBrush="Silver" BorderThickness="1" CornerRadius="5" Name="border18" Grid.Column="3" Grid.Row="17" Grid.ColumnSpan="2">
                    <ComboBox Height="20" HorizontalContentAlignment="Center" Name="CbOrdenacao" Width="390" IsHitTestVisible="False" />
                </Border>
                <Border BorderBrush="Silver" BorderThickness="1" CornerRadius="5" Name="border19" Grid.Row="17" Grid.ColumnSpan="2">
                    <TextBlock Foreground="Black" Height="Auto" HorizontalAlignment="Center" Name="textBlock9" Text="Ordenação" VerticalAlignment="Center" />
                </Border>
                <StackPanel Name="stackPanel3" Margin="0,6" Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="18">
                    <Button Content="Gerar Relatório" Height="23" Name="btGerar" Width="115" Click="btGerar_Click" />
                </StackPanel>
            </Grid>
        </Grid>
    </navigation:Page>
    
    Thankyou
     
    Thursday, February 02, 2012 1:08 PM
  • Hi,

         I am able to see the page. Can you try to set the Report.xaml as the RootVisual and see is there any issue in the page.

    private void Application_Startup(object sender, StartupEventArgs e)
            {
                this.RootVisual = new Report();
            }

    Thanks,

    Bimal

    Thursday, February 02, 2012 5:10 PM
  • Hi.

    About the error, I resolved. its had two methods duplicate in code behind.

    About to call a page1 from page login, I did not obtain.

    Hep me

    Thankyou

    Friday, February 03, 2012 11:29 AM
  • Hi

    Any ideia?

    I need to call silverlight page from login. This new page will have to inside of the frame in mainPage as weel as Page About.

    thankyou

    Teles

    Friday, February 03, 2012 2:13 PM
  • If I am correct you have a Login.xaml, Report.xaml, NewPage.xaml and About.xaml. In the code you have previously posted I can see that you have a ContentFrame in the MainPage.xaml. When the application loads, the contentframe will navigate to Report.xaml. Where is this Login page you mention?

    To navigate to another page from an existing one, use the NavigationService property on the Page class.

    http://msdn.microsoft.com/en-us/library/system.windows.controls.page.navigationservice(v=vs.95).aspx

    e.g.

        public partial class Login : Page
        {
            public Login()
            {
                InitializeComponent();
            }
    
            private void Button_Click(object sender, RoutedEventArgs e)
            {
                // Navigate to the About page
                this.NavigationService.Navigate(new Uri("/About", UriKind.RelativeOrAbsolute));
            }
        }

     

    Sunday, February 05, 2012 7:57 PM