Click here to Skip to main content
15,908,673 members
Home / Discussions / C#
   

C#

 
GeneralRe: Event Problem Pin
Jammer15-Mar-08 1:50
Jammer15-Mar-08 1:50 
GeneralRe: Event Problem Pin
DaveyM6915-Mar-08 2:38
professionalDaveyM6915-Mar-08 2:38 
GeneralRe: Event Problem Pin
Jammer15-Mar-08 3:00
Jammer15-Mar-08 3:00 
GeneralRe: Event Problem Pin
Jammer15-Mar-08 2:39
Jammer15-Mar-08 2:39 
GeneralRe: Event Problem Pin
DaveyM6915-Mar-08 2:45
professionalDaveyM6915-Mar-08 2:45 
GeneralRe: Event Problem Pin
Jammer15-Mar-08 3:05
Jammer15-Mar-08 3:05 
GeneralRe: Event Problem Pin
DaveyM6915-Mar-08 3:26
professionalDaveyM6915-Mar-08 3:26 
GeneralRe: Event Problem Pin
Jammer15-Mar-08 3:41
Jammer15-Mar-08 3:41 
Have tried that and its not showing me anything called Navigator1 (i've tried giving it just Name="Navigator1" and x:Name="Navigator1")

Man this is starting to hurt my head.

I know I'm being a pain but can you just review this for me:

public SampleSortMainWindow()
{
    // Set the application wide system constants
    SetSystemConstants.SetConstants();
    //BuildLookups.CreateLookups();

    // start up the main screen
    InitializeComponent();

    Navigator1.ApplicationViewStatusChanged += new Navigator.ApplicationViewChanged(Navigator1_ApplicationViewStatusChanged);

    lyrBrowserView.Visibility = Visibility.Visible;
    lyrDatabaseView.Visibility = Visibility.Hidden;
}


the XAML is:

<UserControl<br />
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"<br />
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"<br />
    xmlns:d="http://schemas.microsoft.com/expression/blend/2006"<br />
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"<br />
	mc:Ignorable="d"<br />
    Name="Navigator1"<br />
    x:Class="SampleSort.Presentation.Navigator"<br />
    Height="32" Width="64" ClipToBounds="True"><br />
    <Grid>


And this is in the Navigator:

public sealed class ApplicationViewEventArgs : EventArgs
{
    private Enums.ApplicationView _applicationView;

    public Enums.ApplicationView ApplicationViewStatus
    {
        get
        {
            return _applicationView;
        }
    }

    public ApplicationViewEventArgs(Enums.ApplicationView ApplicationViewStatus) : base()
    {
        _applicationView = ApplicationViewStatus;
    }
}

/// <summary>
/// Interaction logic for Navigator.xaml
/// </summary>
public partial class Navigator : UserControl
{
    public delegate void ApplicationViewChanged(object sender, ApplicationViewEventArgs e);

    public event ApplicationViewChanged ApplicationViewStatusChanged;

    public Navigator()
    {
        InitializeComponent();
    }

    private void btnBrowseView_Click(object sender, RoutedEventArgs e)
    {
        if (ApplicationViewStatusChanged != null)

            ApplicationViewStatusChanged(this, new ApplicationViewEventArgs(Enums.ApplicationView.BrowserView));

    }

    private void btnDatabaseView_Click(object sender, RoutedEventArgs e)
    {
        if (ApplicationViewStatusChanged != null)

            ApplicationViewStatusChanged(this, new ApplicationViewEventArgs(Enums.ApplicationView.DataBaseView));

    }
}


The current error is Navigator1 does not exist in the current context. I added a breakpoint and looked at how things are initialised and the Navigator1 is the first thing to be initialized after the Main screen initialize so it should be able to find Navigator1 shouldn't it?

Thanks for the help Dave.

Jammer

Going where everyone here has gone before! Smile | :)
My Blog

GeneralRe: Event Problem Pin
DaveyM6915-Mar-08 4:10
professionalDaveyM6915-Mar-08 4:10 
GeneralRe: Event Problem Pin
Jammer15-Mar-08 5:06
Jammer15-Mar-08 5:06 
GeneralRe: Event Problem Pin
Jammer15-Mar-08 5:15
Jammer15-Mar-08 5:15 
GeneralRe: Event Problem Pin
DaveyM6915-Mar-08 5:24
professionalDaveyM6915-Mar-08 5:24 
GeneralRe: Event Problem Pin
Luc Pattyn15-Mar-08 3:51
sitebuilderLuc Pattyn15-Mar-08 3:51 
GeneralRe: Event Problem Pin
Jammer15-Mar-08 4:00
Jammer15-Mar-08 4:00 
QuestionHow can I take data from a datagrid and display it in an Excel Spreadsheet? Pin
Walaza15-Mar-08 0:31
Walaza15-Mar-08 0:31 
AnswerRe: How can I take data from a datagrid and display it in an Excel Spreadsheet? Pin
buchstaben15-Mar-08 5:47
buchstaben15-Mar-08 5:47 
GeneralRe: How can I take data from a datagrid and display it in an Excel Spreadsheet? Pin
Walaza16-Mar-08 6:23
Walaza16-Mar-08 6:23 
GeneralRe: How can I take data from a datagrid and display it in an Excel Spreadsheet? Pin
buchstaben16-Mar-08 12:09
buchstaben16-Mar-08 12:09 
GeneralRe: How can I take data from a datagrid and display it in an Excel Spreadsheet? Pin
Walaza16-Mar-08 20:15
Walaza16-Mar-08 20:15 
GeneralDedect if right button is clicked in DataGridView column header Pin
AndrusM14-Mar-08 22:56
AndrusM14-Mar-08 22:56 
Questionwhat is best way to do this (create interaction between 2 application) ? Pin
Saeed.39414-Mar-08 22:12
Saeed.39414-Mar-08 22:12 
AnswerRe: what is best way to do this (create interaction between 2 application) ? Pin
Gareth H15-Mar-08 0:25
Gareth H15-Mar-08 0:25 
Generalpassing objects Pin
Miss Maheshwari14-Mar-08 22:12
Miss Maheshwari14-Mar-08 22:12 
GeneralRe: passing objects Pin
Colin Angus Mackay15-Mar-08 1:06
Colin Angus Mackay15-Mar-08 1:06 
QuestionUsin C# Code To Boot Into SafeMode? Pin
MadMan-2972914-Mar-08 21:48
MadMan-2972914-Mar-08 21:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.