Windows Universal: Getting Value from ComboBox - c#

I have a problem which drives me crazy: Up until Christmas my C# Rpi app worked without problems. Coming back from vacation it seems that my ComboBoxes do not work anymore.
I have a method for "SelectionChanged" where I try to get the selected value using
cbox_SleepState.SelectedIndex. (cbox_SleepState is obviously my ComboBox).
Looking at it in the debugger I get this warning:
SelectedIndex - An internal error has occurred while evaluating method Windows.UI.Xaml.Controls.Primitives.Selector.get_SelectedIndex().
I understand why the codes dos not work but I do not get what I need to do to fix this -
especially as the code worked before.
Any help is highly appreciated.
Roger

Related

Resharper shows 'Wrong name case' for XAML?

I have a weird issue that I'm not sure what to make of with ReSharper. I have a solution that has been working fine but lately it decided there were '11 errors in 2 files'. However when I look at them here is what it has:
One style dictionary (xaml file) contains 9 errors that say 'Wrong name case'. When I look at them they are all something like {TemplateBinding ScrollViewer.VerticalScrollBarVisibility} and the portion it's underlining with this error is ScrollViewer. The others are various ScrollViewer properties but all are ScrollViewer and that's the part it's complaining about.
A separate style dictionary shows 2 errors. Both of them are basically the same binding as above but the error this time is "'ScrollViewer' is not public".
I did do some reorganization of files and namespaces recently but neither of these files were touched...
The really odd thing is that it builds just fine and doesn't seem to have an issue running, but I can't get the errors to go away. I have also tried restarting VS as well as a 'drop all and reanalyze' in R# to see if it was some type of weird caching but it still comes back.
So what happened to my solution that R# would start showing this?
P.S. I did Google around about this with the error message and R#, etc. but couldn't really find anything.

WPF request value was not found

I've been creating a WPF application using .net core 3 preview 6. I'm using MVVM pattern. When I was creating layout, using preview 5, everything was correct, but now it doesn't. I have an exception during parse XAML. I had to translate this into english. Sorry if i did any mistake.
Message: System.Windows.Markup.XamlParseException : Call constructor for the type "System.Windows.Controls.TextBox" complying with bound restrictions has caused an exception. ---- System.ArgumentException : Request value "USUŃ" was not found.
I have this exception when TextBox or PasswordBox are creating.
Nowhere in the project is "USUŃ". USUŃ means DELETE.
I have a similar problem getting a System.ArgumentException "requested value 'BILDAUF' was not found" with preview 6. Returning to preview 5 it works again. For me the exception occurs trying to get into a TextBox using the mouse ... it gets thrown before any handler is actually called, so it happens somewhere in the framework.
My gut-feeling: it could be some issue in the Culture Settings that I'm not able to pin down, most probably I'm missing some general setting at init-time. Because BILDAUF is the german name for the PAGEUP key. USUŃ should be the DELETE key (in Polish), if I'm not mistaken ...
I started writing this answer some time ago and was interrupted - seems my gut-feeling deserves a pat on the shoulder:
https://github.com/dotnet/wpf/issues/684
So, if it is feasible you "could" set the CurrentUICulture to en-US - in my case this is fine with me, since I'm writing tools for a project using English as project language. The only other option I'm aware of right now is to stick with preview 5, as preview 7 will still contatin some Culture related issues as the last answer in the linked issue-thread clearly states.

Exception Unhandled: System.OutOfMemoryException: 'Out of memory.'

Basically, it has been 3 days since I'm trying to resolve this issue. I'm coding a sort of Mail Client in C# - everything was working pretty much good, while I started getting this unhandled exception... I would like to post a code section, but I do not know exactly what it causing this problem. A good fact is that the project is pushed over Github. Over internet it is said that maybe some variables used on some loops may cause the problem; I've already tried to edit some parts, but unluckily nothing worked...
Latest edit:
Added a Bunifu.Framework.UI.BunifuFlatButton over a UserControl. On click event, this happens:
MessageBox.Show(settingsControl.FLAG.ToString());
- I was testing if this would print me the int FLAG variable taken from another UserControl called settingsControl.
Every suggestion is appreciated. Thanks!

Program only works correctly in debug mode

Here is my previous question, if you want some further information regarding my current problem:
WinForm: Inherited Panel wont Autosize
If you don't want to read through it, I'll give you some general information:
I'm not working directly via the programme, I'm just editing a specific DLL, that is used by this programme
That means, that I don't have any access to the source code of this specific programme
That also means that I have to fix this problem via some changes in the DLL, that is - as I mentioned before - used by this programme.
What I found out so far:
It works without any problems, if I attach the programme to the DLL's source code in VS2015.
But it has some glitches if I build the code and then copy the DLL into the programme's folder - that's also my actual problem: it somehow shrinks the tableLayoutpanel to half its actual size and I get some weird glitches in the other half of its actual, in normal start somehow not used, size.
What I tried out:
I changed the size manually, not via "Dock = Fill" or "Autosize = true" and it worked. But that's, as you all may know, not the best solution and we only want to use it, if there is absolutely no other way around it. No one likes to hard-code.
I tried to inherit its Parent's Size via:
this.tablelayoutPanel.Size = this.Size;
and
this.tableLayoutPanel.Size = new Size(this.Height, this.Size);
So do you guys have any ideas?
Okay, I did not figured out why the debuger worked and the release/debug build not. But I just forced a redraw on the tableLayoutPanelMainwith with Application.DoEvents(). I never tried this out before, because Invalidate() + Update() or Refresh() did not work - I was like: okay, that wont be that easy, so just forget about that.
But after some trial & error and a lot of time...well, I was working for two weeks on it...I tried the simpliest thing out and YEAHY, it worked!
Anyways, thank you for your help, guys. I appreciate that.

Xamarin.Forms: ERROR - 'System.Net.Http.HttpRequestException' in mscorlib.ni.dll

Good Day. I'm creating a simple Xamarin.Forms (Portable) application that allows me to create Employee Records and display it in the UWP part of my program. It's working fine minutes ago but when I tried it again, It started not to work properly.
The application is actually running but the List of Employees that is supposed to be displayed on a ListView doesn't seem to appear. Instead, I get this messages on the Output Box.
I prefer not to show anymore codes because I think I don't have any error there. One more thing, all the back up program of this application that I have is not working anymore. It all displays the message in the image above.
Please help me. Thanks a lot.

Categories