Search results for query: *

  1. C

    Excel cell dealing with nulls and doubles

    I have explained why I posted and why I thought it was valuable to do so. If he doesn't want to use the information, that is his choice. It isn't for you to police. If I have told him something wrong, that a var won't be a double, that you can't convert to a string and keep it as a double for...
  2. C

    Excel cell dealing with nulls and doubles

    The point I made was that you didn't need to make it a string. His code was creating a system.string - not a double. By simply removing the ToString from the excel line and changing to a var he can keep the double and whether using Convert.ToString or appending with ToString() - the messagebox...
  3. C

    Excel cell dealing with nulls and doubles

    I think the problem in your code is the "MessageBox.Show" that throws an error when trying to convert a double to a string. Which is why ram_rocks said use Convert.ToString - which will convert your double to a string for the purpose of outputting to the MessageBox. I think this would work for...
  4. C

    Resolved MVVM - persistent API key between viewmodels

    I think it's less that your opinions are controversial but the rather abrasive way in which you express them. I don't care, I have extraordinarily thick skin, I was also a barrister in the UK dealing with some of the worst criminals in the UK - so I am used to people behaving in ways that would...
  5. C

    Resolved MVVM - persistent API key between viewmodels

    I just wanted to respond to this part, because I thought this was kind of funny. The video I referenced, from Tim Corey, isn't some bloke in his bedroom, he is a professional teacher, but what I thought was really funny was this: He put out a video yesterday - says exactly what you were saying...
  6. C

    Resolved MVVM - persistent API key between viewmodels

    Python has been interesting to learn - incredibly fast for the data science stuff. The thing that I miss, I won't say dislike but I do miss it, is the declarative variables - it is a string, I want it to be a string, let me tell you it is a string without casting it. I also did take on board...
  7. C

    Resolved MVVM - persistent API key between viewmodels

    I think lazy man's is a denigrating way of talking about libraries of this nature. Does it make it easier yes, but is it lazy? Well no I don't think it is, I think it frees you up to write the applications that you need, without having to re-invent the wheel. I am sure that reinventing the...
  8. C

    Resolved MVVM - persistent API key between viewmodels

    Good spot. I just broke properly now so it won't work even with a hard coded API key. So I think I will just rebuild it from scratch and take the view that Skydiver expressed at the start - don't need two views and two viewmodels, it isn't that complex. I think I will just chuck it in a...
  9. C

    Resolved MVVM - persistent API key between viewmodels

    Thing is, I don't think this has anything to do with Caliburn.Micro. It doesn't interact with the API key. Once we are in the ViewModel - Caliburn is done - it doesn't play a role in the calling to the API, or the creation of the json it is merely a connection between the view and viewmodel.
  10. C

    Resolved MVVM - persistent API key between viewmodels

    The changes I made to make the json null was simply this: At the bottom of the code for the login page: uvm.StartAPI(api); In the mainview: public void StartAPI(string inputApi) { api = inputApi; aTimerSetup(); GetDesk(); } Then at the...
  11. C

    Resolved MVVM - persistent API key between viewmodels

    The base model comes from a Tim Corey video series - for a far more complex application, the Retail Management series - where MVVM is probably useful, but I liked the clean way it worked and the way the UI presents - it was also a pretty good introduction to dependency injection and the whole...
  12. C

    Resolved MVVM - persistent API key between viewmodels

    Ok sorry for delay, this site is blocked at work - I have applied for them to unblock it, but it is a large organisation.... This is a bit of a code dump so apologies, I have cut out all of the logic for checking Json objects (which is a lot of code) but still 100 lines in the main page. I...
  13. C

    Resolved MVVM - persistent API key between viewmodels

    I have an application that is hard coded with an API key....it works, perfectly fine. I created a login screen so other people can use it with their API key. It will not hold the API key, I have tried assigning it to a public property, I have tried creating a class to hold it in a property and...
  14. C

    Resolved DataGrid - can't get it to load with async method?

    Thanks Skydiver! I had originally a full property for the BindableCollection....it was part of the MVVM / Caliburn Micro set up...I had stripped it away, actually created a nentirely new project to start from scratch, to test why the DataGrid was not populating.....now it is populating once I...
  15. C

    Resolved DataGrid - can't get it to load with async method?

    Using MVVM and Caliburn.Micro I was able to create a BindableCollection<Details> I was able to manually add something to this and put it into a DataGrid, by simply naming the DataGrid after the BindableCollection, code looked like this: public BindableCollection<Details> Request { get; set; }...
  16. C

    Resolved HttpClient Response IsSuccessStatusCode firing twice?

    Cheers for that a good read. Using MVVM I am more likely to hit another HttpClient in a different ViewModel, as this is a simple one time get every 2 minutes that is disposed of at the end of each get process. I know how to put the entire thing inside a Model and call it from there - which I...
  17. C

    Resolved HttpClient Response IsSuccessStatusCode firing twice?

    ok, I found the issue, though this was not clear using the break points. I have a timer set up to run the program every two minutes, and that calls the method....for some reason it was going back to that (although not referenced nor going through it via breakpoints) and firing the entire method...
  18. C

    Resolved HttpClient Response IsSuccessStatusCode firing twice?

    I have the following code and I cannot for the life of my answer why it is firing twice.... HttpClient httpClient = new HttpClient(); HttpRequestMessage request = new HttpRequestMessage(); request.RequestUri = new Uri(shortUrl); request.Method = HttpMethod.Get; request.Headers.Add("Key", api)...
  19. C

    Question Further Regex assistance sought

    So I been reading up on Regex like a mad man the last couple of days, but there is something that just isn't clicking. I have a Regex that does 'almost' exactly what I want: names = Regex.Replace(names, @"(^\w)|(\s\w)|(\W\w)", m => m.Value.ToUpper()); This goes through the string and...
  20. C

    Question First MVVM applicaiton - still a lot in ViewModel Button - advice sought

    I went through the first VIewModel, to see if I could make adjustments in the Models. My code now looks like this - I added an if statement, a progress bar, and I used sb.Append after some testing demonstrated that this was far faster. if (noShortNames != null) {...
Back
Top Bottom