Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. public static class Switcher
  2. {
  3. public static MainWindow pageSwitcher;
  4.  
  5. public static void Switch(Page newPage)
  6. {
  7. pageSwitcher.Navigate(newPage);
  8. }
  9. }
  10.  
  11. [ServiceContract]
  12. public interface IAppManager
  13. {
  14. [OperationContract]
  15. void DoWork();
  16. [OperationContract]
  17. void Page1();
  18. [OperationContract]
  19. void Page2();
  20. }
  21. [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple)]
  22. public class AppManager : IAppManager
  23. {
  24.  
  25. public void DoWork()
  26. {
  27. }
  28. public void Page1()
  29. {
  30. MainWindow.pageSwitcher = new MainWindow();
  31. MainWindow.Switch(new Page1());
  32. }
  33. public void Page2()
  34. {
  35. MainWindow.pageSwitcher = new MainWindow();
  36. MainWindow.Switch(new Page2());
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement