How to create a GM Screen for adding and editing information

How to create a Player Screen for showing information

Screens that show summary of data should allow the user to see the detailed data when double clicking on it. This will be handled using a custom modal window that will be by default hidden in the Screen layout tree.

The code needed to show this modal window is the following.

partial void DetailsCollectionSelected_Execute()
{
    if (this.Collection.SelectedItem != null)
    {
        this.OpenModalWindow("ModalWindow");
        this.FindControl("ModalWindow").ControlAvailable += new EventHandler<ControlAvailableEventArgs>(ModalWindow_ControlAvailable);
        this.FindControl("PublicInfo").IsVisible = this.Collection.SelectedItem.HasPublicInfo;
        // Check for Onwer Info if needed
    }
}

void ModalWindow_ControlAvailable(object sender, ControlAvailableEventArgs e)
{
    ChildWindow window = (ChildWindow)e.Control;
    window.Closed += new EventHandler(window_Closed);
}

void window_Closed(object sender, EventArgs e)
{
    ChildWindow window = (ChildWindow)sender;
    if (!(window.DialogResult.HasValue && window.DialogResult.Value))
    {
        window.Closed -= window_Closed;
    }
}

partial void SubmitModalWindow_Execute()
{
    this.CloseModalWindow("ModalWindow");
}

Last edited Oct 31, 2011 at 11:07 AM by Vicente, version 3

Comments

No comments yet.