I am trying to use properties from the ViewModel to assign the textual values for the control BusyIndicator from the WPF Extended ToolKit. The control example provided uses a DataTemplate to assign progress text. Statically assigning text is fine, but when trying to accessing values from VM to assign the values results in binding errors.
Assignation of VM handled in app.xaml.cs:
public partial class App : Application {
private void OnStartup(object sender, StartupEventArgs seArgs) {
MainWindowView mwv = new MainWindowView();
mwv.DataContext = new DataSetViewModel(new DataSetModel());
mwv.Show();
}
}
View Control works except content strings obtained from VM:
<kit:BusyIndicator IsBusy="{Binding Path=ProcessingData,Converter={StaticResource busyIndicator}}"
DisplayAfter="0"
>
<kit:BusyIndicator.BusyContentTemplate>
<DataTemplate>
<StackPanel Margin="4">
<!-- Output Error is 'WaitProgressUploadTitle' property not found on 'object' ''String' (HashCode=-775806441)'... -->
<!-- Output Error is 'WaitProgressUploadContent' property not found on 'object' ''String' (HashCode=-775806441)'... -->
<TextBlock Text="{Binding Path=WaitProgressUploadTitle}" FontWeight="Bold" HorizontalAlignment="Center"/>
<StackPanel Margin="4">
<TextBlock Text="{Binding Path=WaitProgressUploadContent}" />
<ProgressBar Value="40" Height="15"/>
</StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Content="Pause" HorizontalAlignment="Right" Margin="0 0 2 0"/>
<Button Grid.Column="1" Content="Cancel" HorizontalAlignment="Left" Margin="2 0 0 0"/>
</Grid>
</StackPanel>
</DataTemplate>
</kit:BusyIndicator.BusyContentTemplate>
<kit:BusyIndicator.OverlayStyle>
<Style TargetType="Rectangle">
<Setter Property="Fill" Value="#ffffeeee"/>
</Style>
</kit:BusyIndicator.OverlayStyle>
<kit:BusyIndicator.ProgressBarStyle>
<Style TargetType="ProgressBar">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</kit:BusyIndicator.ProgressBarStyle>
<TextBlock Text="CONTENTCONTENTCONTENTCONTENT" Margin="0,100,0,0" HorizontalAlignment="Center" MaxWidth="675" TextAlignment="Center" FontSize="20" Visibility="{Binding Path=FileOpenGood,Converter={StaticResource errorVisibility}}" Background="Cornsilk" />
</kit:BusyIndicator>
When you work with
ContentTemplatebinding insideDataTemplateis made againstContentproperty of theContentControland not itsDataContextJust set
btw. As you see from the errors the type of the bound object is
string.