// Constructor public MainPage() { InitializeComponent(); //Create soap client for the GovBids service client = new AvailBidsSoapClient(); //Connect the Get Bids Completed event (Async) client.GetBidsCompleted += client_GetBidsCompleted; var progressIndicator = new ProgressIndicator(); SystemTray.SetProgressIndicator(this, progressIndicator); /// Holds the push channel that is created or found. HttpNotificationChannel pushChannel; // The name of our push channel. string channelName = "ToastUpdateChannel"; InitializeComponent(); // Try to find the push channel. pushChannel = HttpNotificationChannel.Find(channelName); // If the channel was not found, then create a new connection to the push service. if (pushChannel == null) { pushChannel = new HttpNotificationChannel(channelName); // Register for all the events before attempting to open the channel. pushChannel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated); pushChannel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred); // Register for this notification only if you need to receive the notifications while your application is running. //pushChannel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(PushChannel_ShellToastNotificationReceived); pushChannel.Open(); // Bind this new channel for toast events. pushChannel.BindToShellToast(); } else { // The channel was already open, so just register for all the events. pushChannel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated); pushChannel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred); // Register for this notification only if you need to receive the notifications while your application is running. //pushChannel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(PushChannel_ShellToastNotificationReceived); // Display the URI for testing purposes. Normally, the URI would be passed back to your web service at this point. System.Diagnostics.Debug.WriteLine(pushChannel.ChannelUri.ToString()); //MessageBox.Show(String.Format("Channel Uri is {0}", // pushChannel.ChannelUri.ToString())); } }
// Constructor public MainPage() { InitializeComponent(); //Create soap client for the GovBids service client = new AvailBidsSoapClient(); //Connect the Get Bids Completed event (Async) client.GetBidsCompleted += client_GetBidsCompleted; var progressIndicator = new ProgressIndicator(); SystemTray.SetProgressIndicator(this, progressIndicator); /// Holds the push channel that is created or found. HttpNotificationChannel pushChannel; // The name of our push channel. string channelName = "ToastUpdateChannel"; InitializeComponent(); // Try to find the push channel. pushChannel = HttpNotificationChannel.Find(channelName); // If the channel was not found, then create a new connection to the push service. if (pushChannel == null) { pushChannel = new HttpNotificationChannel(channelName); // Register for all the events before attempting to open the channel. pushChannel.ChannelUriUpdated += new EventHandler <NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated); pushChannel.ErrorOccurred += new EventHandler <NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred); // Register for this notification only if you need to receive the notifications while your application is running. //pushChannel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(PushChannel_ShellToastNotificationReceived); pushChannel.Open(); // Bind this new channel for toast events. pushChannel.BindToShellToast(); } else { // The channel was already open, so just register for all the events. pushChannel.ChannelUriUpdated += new EventHandler <NotificationChannelUriEventArgs>(PushChannel_ChannelUriUpdated); pushChannel.ErrorOccurred += new EventHandler <NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred); // Register for this notification only if you need to receive the notifications while your application is running. //pushChannel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(PushChannel_ShellToastNotificationReceived); // Display the URI for testing purposes. Normally, the URI would be passed back to your web service at this point. System.Diagnostics.Debug.WriteLine(pushChannel.ChannelUri.ToString()); //MessageBox.Show(String.Format("Channel Uri is {0}", // pushChannel.ChannelUri.ToString())); } }
public FilterSetting() { InitializeComponent(); //Initialize the soap client client = new AvailBidsSoapClient(); client.GetLocationsCompleted += client_GetLocationsCompleted; client.GetAgenciesCompleted += client_GetAgenciesCompleted; client.GetCategoriesCompleted += client_GetCategoriesCompleted; asyncCompleted = 0; //Block the UI busyIndicator.IsRunning = true; client.GetAgenciesAsync(); client.GetCategoriesAsync(); client.GetLocationsAsync(); currentFilters = (App.Current as App).filterSettings; }