Пример #1
0
        /// <summary>
        /// Creates and adds a few ItemViewModel objects into the Items collection.
        /// </summary>
        public void LoadData()
        {
            //User Service
            if (!this.IsDataLoaded)
            {
                ServiceReferenceWorkerz.WebServiceWorkerzSoapClient client = new ServiceReferenceWorkerz.WebServiceWorkerzSoapClient();
                if (_selection == currentSelection.In || _selection == currentSelection.Out)
                {

                    client.GetWorkerzInAndOutCompleted += new EventHandler<ServiceReferenceWorkerz.GetWorkerzInAndOutCompletedEventArgs>(client_GetWorkerzInAndOutCompleted);

                    client.GetWorkerzInAndOutAsync();

                    // Sample data; replace with real data
                    //this.Items.Add(new ItemViewModel() { ImageOne="jeff.jpg", LineOne = "Jeff Meyers", LineTwo = "Maecenas praesent accumsan bibendum", LineThree = "Facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu" });
                    //this.Items.Add(new ItemViewModel() { ImageOne = "jeff.jpg", LineOne = "Huey Lewis", LineTwo = "Dictumst eleifend facilisi faucibus", LineThree = "Suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus" });
                }
                else
                {
                    client.GetWorkerzAllCompleted += new EventHandler<ServiceReferenceWorkerz.GetWorkerzAllCompletedEventArgs>(client_GetWorkerzAllCompleted);

                    client.GetWorkerzAllAsync();

                }

            }
        }