duk
(WPF) Changing controls properties on the UI Thread Problem
Why does this work when i do it before the UI loads
txtPrimaryAmmo.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#00FF00"))
And why doesnt this work
SolidColorBrush pAmmoColor = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFFFFF"));
if (primary != null) {
if (percentage <= 100 && percentage >= 50) {
pAmmoColor = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#00FF00"));
} else if (percentage < 50 && percentage >= 25) {
pAmmoColor = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF5F15"));
} else if (percentage < 25) {
pAmmoColor = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#CC0000"));
}
} else {
}
this.Dispatcher .Invoke(() => {
txtPrimaryAmmo.Foreground = pAmmoColor;
});
5 replies
❔ Publishing an winforms application
Im having some issues or i dont understand how publishing works, basically i wanted to compile my app as a single executable self contained exe (i assume all the dlls and other stuff all would be contained in the exe) and after doing this and running the exe alone in a folder the application doesnt start, also the exe goes from the 200kb debug exe to a 150mb published exe file.
Whats the best way to compile a application as to keep the clutter of files down while also keeping the exe file size low? Is it even possible?
277 replies