.bobgoblin
.bobgoblin
CC#
Created by .bobgoblin on 12/20/2022 in #help
❔ Setting Up First Xamarin FOrms
trying to follow a xamarin forms tutorial on creating a mobile app...but I am getting these errors
public LoginPage()
{
var vm = new LoginViewModel();
this.BindingContext = vm;
vm.DisplayInvalidLoginPrompt += () => DisplayAlert("Error", "Invalid Credentials", "OK");

InitializeComponent();

Email.Completed += (object sender, EventArgs e) =>
{
Password.Focus();
};

Password.Completed += (object sender, EventArgs e) =>
{
vm.SubmitCommand.Execute(null);
};
}
public LoginPage()
{
var vm = new LoginViewModel();
this.BindingContext = vm;
vm.DisplayInvalidLoginPrompt += () => DisplayAlert("Error", "Invalid Credentials", "OK");

InitializeComponent();

Email.Completed += (object sender, EventArgs e) =>
{
Password.Focus();
};

Password.Completed += (object sender, EventArgs e) =>
{
vm.SubmitCommand.Execute(null);
};
}
errors =>
The name InitializeComponent does not exist in the current context
Email does not contain a definition for Completed
The name Password does not exist in the current context
The name InitializeComponent does not exist in the current context
Email does not contain a definition for Completed
The name Password does not exist in the current context
13 replies
CC#
Created by .bobgoblin on 11/30/2022 in #help
❔ Issue With Code
I have this code
public T Deserialize<T>(IRestResponse response)
{
try
{
return JsonConvert.DeserializeObject<T>(response.Content, _settings);
}
catch
{
}

return default(T);

}
public T Deserialize<T>(IRestResponse response)
{
try
{
return JsonConvert.DeserializeObject<T>(response.Content, _settings);
}
catch
{
}

return default(T);

}
and the IRestResponse should resolve to interface IRestResponse but I'm getting an error even tho I have added using RestSharp; What do I need to change/alter so this code works correctly?
11 replies
CC#
Created by .bobgoblin on 11/20/2022 in #help
❔ DI Question
I have this code for setting up DI in my worker service project https://pastebin.com/6HH5sBAx But when I run my code I get this error
System.AggregateException: 'Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Microsoft.Extensions.Hosting.IHostedService Lifetime: Singleton ImplementationType: WorkerService1.Worker': A circular dependency was detected
System.AggregateException: 'Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Microsoft.Extensions.Hosting.IHostedService Lifetime: Singleton ImplementationType: WorkerService1.Worker': A circular dependency was detected
What have I set-up wrong?
9 replies