
PersistenceStorage
.Persist(MainGrid, ref stream, PersistenceStorage.PersistenceAction.Save, out errMsg);
static
public class PersistenceStorage
{
static public bool Persist(object pObject, ref Stream pStream, PersistenceAction pPersistenceAction, out string pErrorMessage)
{
mResult =
true;
pErrorMessage =
string.Empty;
PersistenceManager manager = new PersistenceManager();
manager.PersistenceError +=
new Telerik.Windows.Persistence.Events.PersistenceErrorEventHandler(manager_PersistenceError);
try
{
if (pPersistenceAction == PersistenceAction.Load)
{
if (pObject != null && pStream != null)
{
pStream.Position = 0L;
manager.Load(pObject, pStream);
}
else
{
mResult =
false;
}
}
else if (pPersistenceAction == PersistenceAction.Save)
{
if (pObject != null)
{
pStream = manager.Save(pObject);
}
else
{
mResult =
false;
}
}
}
catch
{
mResult =
false;
}
finally
{
manager.PersistenceError -=
new Telerik.Windows.Persistence.Events.PersistenceErrorEventHandler(manager_PersistenceError);
pErrorMessage = mErrorMessage;
}
return mResult;
}
static void manager_PersistenceError(object sender, Telerik.Windows.Persistence.Events.PersistenceErrorEventArgs e)
{
mErrorMessage = e.Exception.Message;
mResult =
false;
}
public enum PersistenceAction { Load, Save }
static private string mErrorMessage;
static private bool mResult;
}
We are facing a problem while adding steps in Test studio.
When we are working web and wpf at a time we are not a able to add new steps into Wpf test and while adding the code which is lies in Webtest that is deleting.
Please let me know solution for this problem.
Please find the attachment of error message which we are getting while adding steps.
public override bool RemoveItem(FilterNode node)
{
return base.RemoveItem(node); // This method call produces the error output below
}
System.Windows.Data Error: 40 : BindingExpression path error: 'Visibility' property not found on 'object' ''DiagramViewModel' (HashCode=33233561)'. BindingExpression:Path=Visibility; DataItem='DiagramViewModel' (HashCode=33233561); target element is 'MyChartShape' (Name=''); target property is 'Visibility' (type 'Visibility')
System.Windows.Data Error: 40 : BindingExpression path error: 'IsSelected' property not found on 'object' ''DiagramViewModel' (HashCode=33233561)'. BindingExpression:Path=IsSelected; DataItem='DiagramViewModel' (HashCode=33233561); target element is 'MyChartShape' (Name=''); target property is 'IsSelected' (type 'Boolean')
I have a shape style that does some binding:
<Style TargetType="views:MyChartShape" x:Key="MyShapeStyle">
<Setter Property="Visibility" Value="{Binding Visibility, Mode=TwoWay}" />
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
Probably not critical, but I believe these errors could indicate a performance issue. The node's shape is obviously rendered when it has been removed (along with its DataContext).
<local:SectionLayout> <local:Section Name="Foo"> <Button Text="{Binding Foo}" /> </local:Section></local:SectionLayout><ControlTemplate><telerik:RadTabControl Align="Right" TabOrientation="Vertical" TabStripPlacement="Left" ItemsSource="{TemplateBinding Sections}"> <telerik:RadTabControl.ItemContainerStyle> <Style TargetType="{x:Type telerik:RadTabItem}"> <Setter Property="MinHeight" Value="150" /> <Setter Property="MinWidth" Value="30" /> </Style> </telerik:RadTabControl.ItemContainerStyle> <telerik:RadTabControl.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Name}" /> </DataTemplate> </telerik:RadTabControl.ItemTemplate> <telerik:RadTabControl.ContentTemplate> <DataTemplate
DataType="{x:Type local:Section}"> <ContentPresenter Margin="4,4,4,4" DataContext="{TemplateBinding DataContext}" Content="{Binding Content}" /> </DataTemplate> </telerik:RadTabControl.ContentTemplate></telerik:RadTabControl></ControlTemplate>