private void btnNav_Click(object sender, RoutedEventArgs e) { Button btn = sender as Button; if (btn.Tag.ToString() == "CommunityPage") { if (CP == null) { CP = new CommunityPage(); mainFrame.Content = CP; } else { mainFrame.Content = CP; } } else { if (TP == null) { TP = new TransPage(); mainFrame.Content = TP; } else { mainFrame.Content = TP; } } // CommunityPage = new Uri("Pages/" + btn.Tag.ToString() + ".xaml", UriKind.Relative); // mainFrame.Navigate(CommunityPage); }
public FileWaiting(TransPage page) { FileStreamPage = page; StreamRequest = new ConcurrentDictionary <Guid, WaitingObject>(); CheckTimer = new Timer { Interval = 2000, AutoReset = false }; CheckTimer.Elapsed += Timer_Trigger; CheckTimer.Start(); }
public FileService(TransPage page) { FileStreamPage = page; FileCache = new ConcurrentDictionary <Guid, StreamBase>(); CacheTimer = new Timer { Interval = CacheVaildTime, AutoReset = false }; CacheTimer.Elapsed += CacheFresh_Trigger; CacheTimer.Start(); UpdateTimer = new Timer { Interval = UpdateUITime, AutoReset = false }; UpdateTimer.Elapsed += UpdateUI_Trigger; UpdateTimer.Start(); }
public MainWindow() { InitializeComponent(); TP = new TransPage(); mainFrame.Content = TP; }