Search results for query: *

  1. sultanuzzaman

    Navigation throws null exception when returning to a page 2nd time

    Does threading (with Dispatcher Invoke) have anything to with this? Please note that the navigation service used in Timer tick event works perfectly everytime. However navigation in the dispatcher invoke event used otherwise only works the 1st time. Can't figure out how to trace this bug.
  2. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    Sorry to bother you again. But I am getting similar exception during the following code: Dispatcher.Invoke(new System.Threading.ThreadStart(delegate { NavigationService.Navigate(new Uri("TmpMsg.xaml", UriKind.RelativeOrAbsolute)); })); Interestingly it shows the...
  3. sultanuzzaman

    Navigation throws null exception when returning to a page 2nd time

    Could it be in the following line? Dispatcher.BeginInvoke(new System.Threading.ThreadStart(delegate Please note that nothing goes wrong when the CshDeposit5.xaml is called for the 1st time but problem arises when it is called the 2nd time. Moreover, similar navigation is done from...
  4. sultanuzzaman

    Navigation throws null exception when returning to a page 2nd time

    I have a serial port controller (for sensing any object that passes through its transport module) connected to USB. It responses with either 0 or 1 after input command "t" when it senses any dropping or no dropping of object through the transport. The page CshDeposit5 contains the code...
  5. sultanuzzaman

    Navigating to a page second time throws null exception

    I am using a serial port device that checks whether any object has been passed thru its gate when it is open. It takes "t" as input and responds with "1" if the object completely passed thru or "0" if the object returned. Depneding on the response the UI navigates to different pages with...
  6. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    Thanks once again. After stopping the timer it worked. Appreciate your help during this session. Until next problem Goodbye!
  7. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    The timer is used to track if 20 seconds have elapsed or not and notify the user of how much seconds left. When there's no seconds left I would like redirect it to Start.xaml. I didn't get "why would you try to navigate again from a page you have already navigated away from?" I am only...
  8. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    From window is alright. However when I try navigating to another page from a page with the following code after it checks 20 seconds timer has elapsed or not private void dispatcherTimer_Tick(object sender, EventArgs e) { NWCDMLibNew x = new NWCDMLibNew()...
  9. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    My Main Window is named MainWindow. It has a frame named MainFrame. As per your advice I could use frame.content/frame.source. However, I cannot access this frame from any xaml page. How would I do it? If possible it would be the most simplest one to load a page from anywhere within the app.
  10. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    Thanks!! IT'S WORKING!!!! However, if I ever need to call the ShowError function from outside the page load or clcik event how would I do that?
  11. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    ShowError Function declared in NWCDMLibNew.cs: public void ShowError(Page s) { try { s.NavigationService.Navigate(new Uri("ErrorMsg.xaml", UriKind.RelativeOrAbsolute)); } catch (Exception e) {...
  12. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    I used ShowError(this) and got the error message as before Object reference not set to an instance of an object.
  13. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    I tried with the following now Start x = new Start(); ShowError(x); Where Start.xaml is the page ShowError function is called from. This time it works. However it loops around as if the Start.xaml page is being called for loading
  14. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    I tried modifying the function as follows, public void ShowError(Page s) { try { NavigationService nav = NavigationService.GetNavigationService(s); nav.Navigate(new Uri("ErrorMsg.xaml"...
  15. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    I didn't get it. What would be the DependencyObject to pass to GetNavigationService when called from a page class just after the InitializeComponent();
  16. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    Sorry, it was acrually NWCDMLibNew - that is just a class file where I wrote all the functions required throughout the application. The Function ShowError() is supposed to load the ErrorMsg.xaml page showing the customized error string on a label. As I said earlier when I use...
  17. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    Compilation Error 1: The best overloaded method match for 'System.Windows.Navigation.NavigationService.GetNavigationService(System.Windows.DependencyObject)' has some invalid arguments D:\Docs\Networld\CDM Project\Interfacing USB in C#\NWCDM\NWCDM2\NWCDMLibNew.cs 842 37 NWCDM Error 2: Argument...
  18. sultanuzzaman

    Question Is it possible to load a navigation page without clicking on any button or any event

    I have this following code that acts when there's an error: public void ShowErrorScreen() { NavigationService nav = NavigationService.GetNavigationService(this)); nav.Navigate(new Uri("ErrorMsg.xaml", UriKind.RelativeOrAbsolute)); }But it doesn't seem to be working for "this"...
Back
Top Bottom