Пример #1
0
        async Task InitializeAsync()
        {
            Clients = new ObservableCollection <Client>(await GetClients());
            var currentclient = Properties.Settings.Default.Client;

            if (null != currentclient)
            {
                var serverClient = Clients.SingleOrDefault(z => z.Identifier == currentclient.Identifier);
                if (serverClient != null)
                {
                    serverClient.IsUsed = true;
                    UsedClient          = serverClient;
                    Properties.Settings.Default.Client = serverClient;
                    Properties.Settings.Default.Save();
                }
                else
                {
                    Properties.Settings.Default.Client = null;
                    Properties.Settings.Default.Save();
                    appManager.NotifyClientChanged(true);
                }
            }
        }