I am trying to create a dialog for a user to enter in text into a textbox. For some reason though, the textbox is not editable. I thought textboxes always editable by default.
The Dialog is it's own Window, and is called from a UserControl which is added to the main window.
(Code for dialog)
<Window x:Class="TestApplication.View.SubjectDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Subject"
Height="300"
Width="300"
ShowInTaskbar="False"
WindowStartupLocation="CenterOwner"
FocusManager.FocusedElement="{Binding ElementName=leftMarginTextBox}">
<Grid>
<Grid>
<TextBox IsEnabled="True"
Height="23"
Name="NameField"
Margin="84,2,6,2">Some Name</TextBox>
<Label Content="Subject Name"
Height="28"
Name="NameLable" />
</Grid>
<Button Name="CancelButton"
IsCancel="True"
Margin="12,222,186,12"
Click="CancelButtonClicked">Cancel</Button>
<Button Name="OKButton"
IsDefault="True"
Margin="186,221,12,12"
Click="OKButtonClicked">OK</Button>
</Grid>
</Window>
(Code calling the dialog)
// Open up a dialog with feilds to fill in
SubjectDialog dialog = new SubjectDialog();
dialog.Owner = Window.GetWindow(this);
System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(dialog);
dialog.ShowDialog();
Thanks for the help!!!