For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
I have a DataGrid with a couple of DataGridTemplateColumns.
When I try to hit the Enter-key on my keyboard there is no new row created in the DataGrid.
I have other DataGrids with columns which are not DataGridTemplateColumns and I can then create new rows by hitting the Enter-key. So I assume the DataGridTemplateColumns in some way causing the problem.
I have made a reproducible code and I have made it public in this GIT-Gist.
* I use Fody PropertyChanged to handle all the INotificationPropertyChanged in my view models.
* The code should just be copy-and-paste.
The bindings between the View and the ViewModels also don't seem to work :S
But if you uncomment the row in the ViewModel's construcotor (please see line 60 in the MainWindow.xaml.cs), a new row in the DataGrid will be created. With this row, the bindings works as expected. I cannot understand why.
Here is the XAML-code. It maybe enough for you with only the XAML-code to solve this problem.
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
public static void Install()
private static void InstallIIS()
InstallFeature("IIS", "/Online /Enable-Feature /FeatureName:IIS-DefaultDocument /All");
private static void InstallASPDotNet()
InstallFeature("ASP.Net", "/Online /Enable-Feature /FeatureName:IIS-ASPNET45 /All");
private static void 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)
private static void 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, out double percent);
// Raise the percent completed event to update the progress bar in the UI