【发布时间】:2015-06-23 23:07:48
【问题描述】:
<Page x:Name="ChatPageName" x:Class="WindowsDesktop.Chat.ChatPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WindowsDesktop.Chat"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Title="ChatPage">
<Grid>
<ToolBar x:Name="ToBar" Grid.Row="0" HorizontalAlignment="Left" Margin="10,42,0,0" VerticalAlignment="Top" Height="28" Width="280">
<TextBox x:Name="ToBarTextBox" Height="22.6666666666667" Margin="0" TextWrapping="Wrap" Text="{Binding Path=ToBarText, Source=ChatPageName}" VerticalAlignment="Top" Width="120"/>
<Button x:Name="AddContactButton" Content="Add" Height="23" VerticalAlignment="Top" Width="75" Margin="0,0,0,-0.333" Click="AddContactButton_Click"/>
</ToolBar>
我正在尝试将 ToBarTextBox 上的文本绑定到我的类 ChatPage 上名为 ToBarText 的属性。我该怎么做?
谢谢。
【问题讨论】: