The benefit of asking "clear questions" is that you might get an "answer", instead of another "question" asking you to clarify your question. You must have a lot of time on your hands to be able to deal with just more questions (and no answers).
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
I have a Storyboard at Window resources as shown below.
The Storyboard can be started with the following string which is placed in regular Button.
I'm working on a custom installation wizard. From it, I'm calling DISM to install IIS and ASP.Net if they're not installed. All the code in the installer class works fine when called from a console app. I'm now trying to put a simple UI on it.
There are 2 steps. Each step raises the event 'CurrentTaskChanged' with text "Installing IIS" or "Installing ASP.Net", and then during installation it raises a ProgressChanged event to send progress to the UI.
The problem is that none of the UI updates happen until the after the entire install process finishes.
Installer Class Code
InstallFeature("IIS", "/Online /Enable-Feature /FeatureName:IIS-DefaultDocument /All");
InstallFeature("ASP.Net", "/Online /Enable-Feature /FeatureName:IIS-ASPNET45 /All");
privatestaticvoid InstallFeature(string featureName, string args)
// Raise the task changed event so the UI shows what is installing
string dism = Path.Combine(Environment.ExpandEnvironmentVariables("%windir%"), "system32", "dism.exe");
if (Environment.Is64BitOperatingSystem && !Environment.Is64BitProcess)
dism = Path.Combine(Environment.ExpandEnvironmentVariables("%windir%"), "sysnative", "dism.exe");
var process = new Process();
var startInfo = new ProcessStartInfo
UseShellExecute = false,
CreateNoWindow = false,
RedirectStandardOutput = true,
FileName = dism,
Arguments = args
process.StartInfo = startInfo;
process.OutputDataReceived += (sender, e) => HandleDISMOutput(e.Data);
process.StartInfo.Verb = "runas";
catch (Exception e)
privatestaticvoid HandleDISMOutput(object data)
if (data != null)
var info = data.ToString();
// Parse out the percent digits
info = info.Replace('[', ' ');
info = info.Replace(']', ' ');
info = info.Replace('=', ' ');
info = info.Replace(" ", "");
info = info.Replace("%", "");
double.TryParse(info, outdouble percent);
// Raise the percent completed event to update the progress bar in the UI
Requires multi-select enabled in the data grid and one delete command per selected record.
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
I have a WPF project working fine in Windows 7, but which has a completely changed layout, when the same project is executed under Windows 10.
Do any of you have experiences with this issue?
I have found out that WPF loads the current theme/skin from the OS, and that this may be the cause of the skewed layout, but I haven't been able to find any whitepapers or guides with information on how to work around this problem.
It is a basic Grid with Stack Panels and Labels in it, if that helps.
Any help/ideas/links would be much appreciated
I had experience with this in the past, but visual changes between two OS versions were usually minor. What do you mean by "completely changed layout"? Can you please elaborate?
As you pointed out, issue is (probably) about the styles and templates. By manually setting the whole style (with template etc.), you should be able to ensure same visual appearance on any (compatible) OS.
Thank you for replying.
I have been isolating diffent parts of our code, to find the culprit.
We are basically building a custom WPF control runtime, to use it for printing, but since it is never shown on the UI, but sent off to the printer, the WPF framework doesn't perform lay-out on the control.
I understand, that these lines in the code I am trying to get to work on WIN10, are responsible for enforcing the layout functionality in a non-visible control: