Textblock and textbox with the same source
This commit is contained in:
@ -9,6 +9,16 @@ namespace WPFUI.ViewModels
|
|||||||
{
|
{
|
||||||
public class ShellViewModel : Screen
|
public class ShellViewModel : Screen
|
||||||
{
|
{
|
||||||
|
private string _firstName = "Tommy";
|
||||||
|
|
||||||
|
public string FirstName
|
||||||
|
{
|
||||||
|
get {
|
||||||
|
return _firstName;
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
_firstName = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,9 +4,28 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:WPFUI.Views"
|
xmlns:local="clr-namespace:WPFUI.Views"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d" FontSize="18" WindowStartupLocation="CenterScreen"
|
||||||
Title="ShellView" Height="450" Width="800">
|
Title="ShellView" Height="300" Width="300">
|
||||||
<Grid>
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="20" />
|
||||||
|
<ColumnDefinition Width="auto" />
|
||||||
|
<ColumnDefinition Width="auto" />
|
||||||
|
<ColumnDefinition Width="auto" />
|
||||||
|
<ColumnDefinition Width="auto" />
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
<ColumnDefinition Width="20" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="20"/>
|
||||||
|
<RowDefinition Height="auto"/>
|
||||||
|
<RowDefinition Height="auto"/>
|
||||||
|
<RowDefinition Height="auto"/>
|
||||||
|
<RowDefinition Height="auto"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="20"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Text="{Binding Path=FirstName, Mode=OneWay}" Grid.Row="1" Grid.Column="1"></TextBlock>
|
||||||
|
<TextBox MinWidth="100" Grid.Row="2" Grid.Column="1" x:Name="FirstName"></TextBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
Reference in New Issue
Block a user