
I have a problem with Binding Text in MVVM pattern on simple textbox in Ribbon.Group.
xaml code:and ChartDocumentViewModel code:
I have a breakpoint on ChartTitle.set, and it break just when I push button on other Ribbon.Tab.
I searched in forum, but I don't found anything.
How to resolve it?
[Modified at 08/01/2011 05:29 AM]
xaml code:
<ribbon:Tab x:Class="Sato.ChartDocument.Ribbons.ChartDocumentRibbonTab"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
xmlns:rv="clr-namespace:Sato.ChartDocument.Ribbons"
xmlns:vm="clr-namespace:Sato.ChartDocument.ViewModels"
Label="Chart Properties">
<ribbon:Tab.DataContext>
<vm:ChartDocumentViewModel/>
</ribbon:Tab.DataContext>
<ribbon:Group>
<StackPanel Orientation="Horizontal">
<Label Content="Chart Title" />
<TextBox Text="{Binding Path=ChartTitle, Mode=TwoWay}" />
</StackPanel>
</ribbon:Group>
</ribbon:Tab>
namespace Sato.ChartDocument.ViewModels
{
using Microsoft.Practices.Prism.ViewModel;
/// <summary>
/// Description of chart document view model
/// </summary>
public class ChartDocumentViewModel : NotificationObject
{
private string chartTitle = "Tytuł ViewModel";
/// <summary>
/// Gets or sets the chart title.
/// </summary>
/// <value>
/// The chart title.
/// </value>
public string ChartTitle
{
get { return chartTitle; }
set
{
if (chartTitle != value)
{
chartTitle = value;
RaisePropertyChanged(() => this.ChartTitle);
}
}
}
}
}
I searched in forum, but I don't found anything.
How to resolve it?
[Modified at 08/01/2011 05:29 AM]