+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 10 of 16

Thread: ChildWindow

  1. #1

    Default ChildWindow

    Hi,

    I am building an application and would like to have a child window. For example if the user clicks on Sign Up (which is in a navigation bar), he gets this child window which will give more focus to it. By child window I am refering to one similar to the one you get when you have an error (small window), with the black transparency underneath as well.

    Can anyone help?

  2. #2
    Join Date
    Aug 2009
    Location
    London, UK
    Posts
    233

    Default Silverlight 3 ChildWindow Popup Tutorial

    Hi Silverlightfreak,

    I have put up a ChildWindow tutorial over at Silverlight Tutorials on how to create a ChildWindow in Silverlight and how to hook it up into the app so that you can show and hide it.

    The tutorial is more from the programming angle and the popup isn't anything special but it does the job and I am sure you or anyone with some Blend experience could create a nice interface

    Here is the Xaml of the ChildWindow. It allows for quite a bit of customization. One thing that is built into the ChildWindow is that it blacks out the background while the popup is visible.

    Code:
    <controls:ChildWindow x:Class="SilverlightForums_ChildWindow.PopupWindow"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
               xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
               Width="250" Height="200" 
               Title="PopupWindow">
        <StackPanel x:Name="LayoutRoot" Orientation="Vertical">
            <TextBlock x:Name="Title" HorizontalAlignment="Stretch" VerticalAlignment="Center" TextWrapping="Wrap" />
            <StackPanel Orientation="Horizontal" Margin="30,50,0,0">
                <Button x:Name="OK" Content="OK" Width="75" Height="23" HorizontalAlignment="Right" />
                <Button x:Name="Cancel" Content="Cancel" Width="75" Height="23" HorizontalAlignment="Left" />
            </StackPanel>
        </StackPanel>
    </controls:ChildWindow>
    Download the tutorial and I am sure it will make sense to you. If there is any questions then feel free to ask.

    Thanks,

    Al

  3. #3

    Default

    This is awesome! Thanks Allan!! Will try to integrate it with my app and let you know!

    Thanks Again

  4. #4
    Join Date
    Sep 2009
    Posts
    2

    Default

    Great topic.

  5. #5

    Default

    Can someone help?

    I'm getting this error when I am compiling (as soon as the page loads i get this error due to the pop-up code i have). The provided solution works perfectly though when integrating it in my solution im getting the below error:


    AG_E_PARSER_BAD_TYPE [Line: 1 Position: 31]

    at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
    at Test_.SilverlightForums_ChildWindow.Login.Initiali zeComponent()
    at Test_.SilverlightForums_ChildWindow.Login..ctor()
    at Test_.MainPage.MainPage_Loaded(Object sender, RoutedEventArgs e)
    at System.Windows.CoreInvokeHandler.InvokeEventHandle r(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
    at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

  6. #6
    Join Date
    Aug 2009
    Location
    London, UK
    Posts
    233

    Default AG_E_PARSER_BAD_TYPE error

    Can you give me some more details Silverlightfreak. Could you paste the Xaml code?

    Look at the Xaml code very carefully for any syntax errors. When I get these errors, it usually end up as something I've typed in wrong.

    Try looking around line 30/31

    Thanks,

    Al
    Silverlight Forums - Your Silverlight Community:
    Silverlight Tutorials - Silverlight Forums - Silverlight News

  7. #7

    Default

    Hi Allan,

    I am calling the popup from a link instead of a button and am calling the method once the link is pressed.

    Can this be the cause of the issue?

  8. #8

    Default

    Hi,

    is it possible for someone to translate project into VB?

    Thanks

  9. #9
    Join Date
    Aug 2009
    Location
    London, UK
    Posts
    233

    Default Silverlight 3 ChildWindow Popup issue

    Hi Silverlightfreak,

    When you say you are calling it from a link - i presume you mean a hyperlink button? If so can I ask why does it need to be a hyperlink button?

    Could you show me a snippet of code? Or create a demo project and upload it to here so I can see?

    The reason why I am asking is; Is the selection of control (the hyperlink button if used) the correct one? If I changed that to a standard button do I get the same error?

    Paste up some code and I'll take a look

    Thanks,

    Al
    Silverlight Forums - Your Silverlight Community:
    Silverlight Tutorials - Silverlight Forums - Silverlight News

  10. #10

    Default

    Hi,

    attaching a demo project. Have a couple of errors.. Not that good in translating C# to VB.

    Can someone help?

    Thanks
    Attached Files

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Follow Your Community

About Silverlight Forums

Silverlight Forums Stats

Silverlight Forums is an established Silverlight community for people interested in design and development using Silverlight.

11035 news articles
29 tutorials and 2 video tutorials
2060 forum posts in 1298 threads

Silverlight User Groups (SLUGs)

Why not join your local SLUG?

London, Atlanta, Phoenix, Toronto, Portland, Wellington, Los Angeles, Seattle, South Florida, Tampa Bay, Jacksonville, Belgium

Silverlight Usergroups (SLUGs)
Copyright © 2010 Silverlight ForumsSilverlight TutorialsSilverlight News