Persistence lost infos when loading

10 posts, 0 answers
  1. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 02 Nov 2011 Link to this post

    Hi, I'm trying to persist a RadWindow on my disk but when the persistence is restored, some visual infos missing...

    Here is my xaml

    <

     

    telerik:RadWindow x:Class="com.christiegrp.Neuron.ClientApplication.PatientFileForm"

     

     

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

     

     

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

     

     

    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

     

     

    xmlns:self="clr-namespace:com.christiegrp.Neuron.ClientApplication"

     

     

    Height="778" Width="1059" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" SizeToContent="False" Name="Me"

     

     

    telerik:PersistenceManager.StorageId="PatientFileForm" Loaded="Me_Loaded" PreviewClosed="Me_PreviewClosed">

     

     

     

    <telerik:RadWindow.IconTemplate>

     

     

     

    <DataTemplate>

     

     

     

    <Image Source="Resources/Patient_48x48.png" Height="24" Width="24" Stretch="Fill" Margin="0 0 3 0" />

     

     

     

    </DataTemplate>

     

     

     

    </telerik:RadWindow.IconTemplate>

     

     

     

    <telerik:RadWindow.Resources>

     

     

     

    <ResourceDictionary>

     

     

     

    <self:HospitalDate x:Key="hospitalDateConverter" />

     

     

     

    <self:ActualPatientAge x:Key="patientAgeConverter" />

     

     

     

    <self:GenderToBool x:Key="genderConverter" />

     

     

     

    <self:BoolInverter x:Key="enabledConverter" />

     

     

     

    <ResourceDictionary.MergedDictionaries>

     

     

     

    <ResourceDictionary Source="PatientFileForm-Fr-Res.xaml"/>

     

     

     

    <ResourceDictionary Source="pack://application:,,,/Resources;component/Neuron-Styles.xaml"/>

     

     

     

    <ResourceDictionary Source="/Telerik.Windows.Controls.Navigation;component/Themes/GenericOfficeBlack.xaml"/>

     

     

     

    </ResourceDictionary.MergedDictionaries>

     

     

     

    </ResourceDictionary>

     

     

     

    </telerik:RadWindow.Resources>

     

     

     

     

    <Grid>

     

     

     

    <Grid.ColumnDefinitions>

     

     

     

    <ColumnDefinition Width="*"/>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    </Grid.ColumnDefinitions>

     

     

     

    <Grid.RowDefinitions>

     

     

     

    <RowDefinition Height="Auto"/>

     

     

     

    <RowDefinition Height="*"/>

     

     

     

    </Grid.RowDefinitions>

     

     

     

     

    <Image Name="imageLockUnlock" Source="Resources/Unlock_32x32.png" Height="24" Width="24" Margin="10" Grid.Column="1" />

     

     

     

     

    <telerik:RadTabControl Margin="5" BackgroundVisibility="Collapsed" Grid.ColumnSpan="2" Grid.RowSpan="2" IsContentPreserved="True">

     

     

     

    <telerik:RadTabItem>

     

     

     

    <telerik:RadTabItem.Header>

     

     

     

    <StackPanel Orientation="Horizontal">

     

     

     

    <Image Source="Resources/PatientFile_32x32.png" Height="24" Width="24" />

     

     

     

    <TextBlock Text="{StaticResource RadJacket}" Margin="3 0 0 0" VerticalAlignment="Center"/>

     

     

     

    </StackPanel>

     

     

     

    </telerik:RadTabItem.Header>

     

     

     

    <Grid Margin="5">

     

     

     

    <Grid.ColumnDefinitions>

     

     

     

    <ColumnDefinition Width="*" />

     

     

     

    <ColumnDefinition Width="*" />

     

     

     

    </Grid.ColumnDefinitions>

     

     

     

    <Grid.RowDefinitions>

     

     

     

    <RowDefinition Height="Auto" />

     

     

     

    <RowDefinition Height="*" />

     

     

     

    <RowDefinition Height="Auto" />

     

     

     

    </Grid.RowDefinitions>

     

     

     

    <!-- The following element is used to trigger an event allowing to replace the language resources before they are used. -->

     

     

     

    <TextBlock Initialized="ReplaceLanguageResources"/>

     

     

     

    <StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Margin="5">

     

     

     

    <telerik:RadButton Margin="0 0 5 0" IsEnabled="{Binding ElementName=Me, Path=IsReadOnly, Converter={StaticResource enabledConverter}}">

     

     

     

    <StackPanel Orientation="Horizontal">

     

     

     

    <Image Margin="5 0 0 0" Source="Resources/Patient_48x48.png" Height="24" Width="24" />

     

     

     

    <TextBlock Margin="5" VerticalAlignment="Center" Text="{StaticResource OtherPatient}" />

     

     

     

    </StackPanel>

     

     

     

    </telerik:RadButton>

     

     

     

    <telerik:RadButton Margin="0 0 5 0" IsEnabled="{Binding ElementName=Me, Path=IsReadOnly, Converter={StaticResource enabledConverter}}">

     

     

     

    <StackPanel Orientation="Horizontal">

     

     

     

    <Image Margin="5 0 0 0" Source="Resources/Search_32x32.png" Height="24" Width="24" />

     

     

     

    <TextBlock Margin="5" VerticalAlignment="Center" Text="{StaticResource Search}" />

     

     

     

    </StackPanel>

     

     

     

    </telerik:RadButton>

     

     

     

    <telerik:RadButton Margin="0 0 5 0" IsEnabled="{Binding ElementName=Me, Path=IsReadOnly, Converter={StaticResource enabledConverter}}">

     

     

     

    <StackPanel Orientation="Horizontal">

     

     

     

    <Image Margin="5 0 0 0" Source="Resources/Confirm_32x32.png" Height="24" Width="24" />

     

     

     

    <TextBlock Margin="5" VerticalAlignment="Center" Text="{StaticResource OK}" />

     

     

     

    </StackPanel>

     

     

     

    </telerik:RadButton>

     

     

     

    <telerik:RadButton Margin="0 0 5 0" IsEnabled="{Binding ElementName=Me, Path=IsReadOnly, Converter={StaticResource enabledConverter}}">

     

     

     

    <StackPanel Orientation="Horizontal">

     

     

     

    <Image Margin="5 0 0 0" Source="Resources/Cancel_32x32.png" Height="24" Width="24" />

     

     

     

    <TextBlock Margin="5" VerticalAlignment="Center" Text="{StaticResource Cancel}" />

     

     

     

    </StackPanel>

     

     

     

    </telerik:RadButton>

     

     

     

    <telerik:RadButton>

     

     

     

    <StackPanel Orientation="Horizontal">

     

     

     

    <Image Margin="5 0 0 0" Source="Resources/Help_32x32.png" Height="24" Width="24" />

     

     

     

    <TextBlock Margin="5" VerticalAlignment="Center" Text="{StaticResource Help}" />

     

     

     

    </StackPanel>

     

     

     

    </telerik:RadButton>

     

     

     

    </StackPanel>

     

     

     

    <GroupBox Grid.Column="0" Grid.Row="1" Margin="5" Header="{StaticResource GroupPatientHeader}" >

     

     

     

    <Grid>

     

     

     

    <Grid.ColumnDefinitions>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    <ColumnDefinition Width="*"/>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    </Grid.ColumnDefinitions>

     

     

     

    <Grid.RowDefinitions>

     

     

     

    <RowDefinition Height="Auto" />

     

     

     

    <RowDefinition Height="Auto" />

     

     

     

    <RowDefinition Height="Auto" />

     

     

     

    <RowDefinition Height="Auto" />

     

     

     

    <RowDefinition Height="Auto" />

     

     

     

    <RowDefinition Height="Auto" />

     

     

     

    <RowDefinition Height="Auto" />

     

     

     

    <RowDefinition Height="Auto" />

     

     

     

    <RowDefinition Height="Auto" />

     

     

     

    <RowDefinition Height="*" />

     

     

     

    </Grid.RowDefinitions>

     

     

     

    <TextBlock Grid.Column="0" Grid.Row="0" Text="{StaticResource PatientId}" Margin="5" />

     

     

     

    <TextBlock Grid.Column="1" Grid.Row="0" Text="*" Foreground="Red" VerticalAlignment="Center" />

     

     

     

    <TextBox Grid.Column="2" Grid.Row="0" Margin="5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.MasterRecordNumber}"/>

     

     

     

    <TextBlock Grid.Column="0" Grid.Row="1" Text="{StaticResource LastName}" Margin="5" />

     

     

     

    <TextBlock Grid.Column="1" Grid.Row="1" Text="*" Foreground="Red" VerticalAlignment="Center" />

     

     

     

    <TextBox Grid.Column="2" Grid.Row="1" Margin="5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.LastName}"/>

     

     

     

    <TextBlock Grid.Column="0" Grid.Row="2" Text="{StaticResource FirstName}" Margin="5" />

     

     

     

    <TextBlock Grid.Column="1" Grid.Row="2" Text="*" Foreground="Red" VerticalAlignment="Center" />

     

     

     

    <TextBox Grid.Column="2" Grid.Row="2" Margin="5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.FirstName}"/>

     

     

     

    <TextBlock Grid.Column="0" Grid.Row="3" Text="{StaticResource BirthDate}" Margin="5" />

     

     

     

    <TextBlock Grid.Column="1" Grid.Row="3" Text="*" Foreground="Red" VerticalAlignment="Center" />

     

     

     

    <TextBox Grid.Column="2" Grid.Row="3" Margin="5 5 0 5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.BirthDate, Converter={StaticResource hospitalDateConverter}}"/>

     

     

     

    <telerik:RadButton Grid.Column="3" Grid.Row="3" Margin="0 5 5 5" IsEnabled="{Binding ElementName=Me, Path=IsReadOnly, Converter={StaticResource enabledConverter}}">

     

     

     

    <Image Source="Resources/Calendar_32x32.png" Height="18" Width="18" />

     

     

     

    </telerik:RadButton>

     

     

     

    <TextBlock Grid.Column="4" Grid.Row="3" Text="{StaticResource Age}" Margin="5"/>

     

     

     

    <TextBox Grid.Column="5" Grid.Row="3" Margin="5" IsReadOnly="True" Text="{Binding ElementName=Me, Path=Patient.BirthDate, Converter={StaticResource patientAgeConverter}}"/>

     

     

     

    <TextBlock Grid.Column="0" Grid.Row="4" Text="{StaticResource Sex}" Margin="5"/>

     

     

     

    <StackPanel Orientation="Horizontal" Grid.Column="2" Grid.Row="4" Grid.ColumnSpan="3" VerticalAlignment="Center" IsEnabled="{Binding ElementName=Me, Path=IsReadOnly, Converter={StaticResource enabledConverter}}">

     

     

     

    <RadioButton Content="{StaticResource Female}" GroupName="Gender" IsChecked="{Binding ElementName=Me, Path=Patient.Gender, Converter={StaticResource genderConverter}, ConverterParameter=F}" Margin="5"/>

     

     

     

    <RadioButton Content="{StaticResource Male}" GroupName="Gender" IsChecked="{Binding ElementName=Me, Path=Patient.Gender, Converter={StaticResource genderConverter}, ConverterParameter=M}" Margin="5"/>

     

     

     

    <RadioButton Content="{StaticResource Indeterminate}" GroupName="Gender" Margin="5"/>

     

     

     

    </StackPanel>

     

     

     

    <GroupBox Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="6" Margin="10" Header="{StaticResource Address}">

     

     

     

    <self:AddressControl x:Name="addressControl" Margin="5" />

     

     

     

    </GroupBox>

     

     

     

    <TextBlock Grid.Column="0" Grid.Row="5" Text="{StaticResource ExternalPatientId}" Margin="5"/>

     

     

     

    <TextBox Grid.Column="2" Grid.Row="5" Margin="5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.ExternalRecordNumber}"/>

     

     

     

    <TextBlock Grid.Column="0" Grid.Row="6" Text="{StaticResource Language}" Margin="5"/>

     

     

     

    <telerik:RadComboBox Grid.Column="2" Grid.Row="6" Margin="5" SelectedIndex="{Binding ElementName=Me, Path=Patient.Language}" IsEnabled="{Binding ElementName=Me, Path=IsReadOnly, Converter={StaticResource enabledConverter}}">

     

     

     

    <telerik:RadComboBoxItem Content="{StaticResource LanguageFr}"/>

     

     

     

    <telerik:RadComboBoxItem Content="{StaticResource LanguageEn}"/>

     

     

     

    </telerik:RadComboBox>

     

     

     

    <GroupBox Grid.Column="0" Grid.Row="8" Grid.ColumnSpan="6" Margin="10 0 10 10" Header="{StaticResource MinistryInsurance}">

     

     

     

    <Grid>

     

     

     

    <Grid.ColumnDefinitions>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    <ColumnDefinition Width="*"/>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    <ColumnDefinition Width="*"/>

     

     

     

    </Grid.ColumnDefinitions>

     

     

     

    <Grid.RowDefinitions>

     

     

     

    <RowDefinition Height="*"/>

     

     

     

    <RowDefinition Height="*"/>

     

     

     

    <RowDefinition Height="*"/>

     

     

     

    </Grid.RowDefinitions>

     

     

     

    <TextBlock Text="{StaticResource Number}" Grid.Column="0" Grid.Row="0" Margin="5" />

     

     

     

    <TextBlock Text="*" Grid.Column="1" Grid.Row="0" Foreground="Red" VerticalAlignment="Center" />

     

     

     

    <TextBox Grid.Column="2" Grid.Row="0" Grid.ColumnSpan="4" Margin="5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.HealthCareNumber}"/>

     

     

     

    <TextBlock Text="{StaticResource Expiration}" Grid.Column="0" Grid.Row="1" Margin="5"/>

     

     

     

    <TextBox Grid.Column="2" Grid.Row="1" Margin="5 5 0 5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.HealthCareExpiration}"/>

     

     

     

    <telerik:RadButton Grid.Column="3" Grid.Row="1" Margin="0 5 5 5" IsEnabled="{Binding ElementName=Me, Path=IsReadOnly, Converter={StaticResource enabledConverter}}">

     

     

     

    <Image Source="Resources/Calendar_32x32.png" Height="18" Width="18" />

     

     

     

    </telerik:RadButton>

     

     

     

    <TextBlock Text="{StaticResource VersionCode}" Grid.Column="4" Grid.Row="1" Margin="5"/>

     

     

     

    <TextBox Grid.Column="5" Grid.Row="1" Margin="5" IsEnabled="False" Text="{Binding ElementName=Me, Path=Patient.VersionCode}"/>

     

     

     

    <TextBlock Text="{StaticResource Province}" Grid.Column="0" Grid.Row="2" Margin="5" />

     

     

     

    <TextBlock Text="*" Grid.Column="1" Grid.Row="2" Foreground="Red" VerticalAlignment="Center" />

     

     

     

    <telerik:RadComboBox Name="radComboBoxProvince" Grid.Column="2" Grid.Row="2" Grid.ColumnSpan="4" Margin="5" SelectedValue="{Binding ElementName=Me, Path=Patient.HealthCareProvinceGuid}" SelectedValuePath="TheGuid" DisplayMemberPath="Name" IsEnabled="{Binding ElementName=Me, Path=IsReadOnly, Converter={StaticResource enabledConverter}}"/>

     

     

     

    </Grid>

     

     

     

    </GroupBox>

     

     

     

    </Grid>

     

     

     

    </GroupBox>

     

     

     

     

    <StackPanel Orientation="Vertical" Grid.Column="1" Grid.Row="1" Margin="0">

     

     

     

    <GroupBox Margin="5" Header="{StaticResource GroupPhonesEmailHeader}">

     

     

     

    <Grid>

     

     

     

    <Grid.ColumnDefinitions>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    <ColumnDefinition Width="*"/>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    <ColumnDefinition Width="*"/>

     

     

     

    </Grid.ColumnDefinitions>

     

     

     

    <Grid.RowDefinitions>

     

     

     

    <RowDefinition Height="*"/>

     

     

     

    <RowDefinition Height="Auto"/>

     

     

     

    <RowDefinition Height="Auto"/>

     

     

     

    </Grid.RowDefinitions>

     

     

     

    <self:PhonesControl x:Name="phonesControl" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="4" Margin="5"></self:PhonesControl>

     

     

     

    <TextBlock Grid.Column="0" Grid.Row="1" Text="{StaticResource Home}" Margin="5" />

     

     

     

    <TextBox Grid.Column="1" Grid.Row="1" Margin="5" Text="{Binding ElementName=Me, Path=HomePhone}" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}"/>

     

     

     

    <TextBlock Grid.Column="2" Grid.Row="1" Text="{StaticResource Work}" Margin="5" />

     

     

     

    <TextBox Grid.Column="3" Grid.Row="1" Margin="5" Text="{Binding ElementName=Me, Path=WorkPhone}" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}"/>

     

     

     

    <TextBlock Grid.Column="0" Grid.Row="2" Text="{StaticResource Email}" Margin="5" />

     

     

     

    <TextBox Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="4" Margin="5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.EmailAddress}"/>

     

     

     

    </Grid>

     

     

     

    </GroupBox>

     

     

     

    <GroupBox Margin="5" Header="{StaticResource GroupConjointHeader}">

     

     

     

    <Grid>

     

     

     

    <Grid.ColumnDefinitions>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    <ColumnDefinition Width="*"/>

     

     

     

    </Grid.ColumnDefinitions>

     

     

     

    <Grid.RowDefinitions>

     

     

     

    <RowDefinition />

     

     

     

    <RowDefinition />

     

     

     

    </Grid.RowDefinitions>

     

     

     

    <TextBlock Text="{StaticResource LastName}" Margin="5" />

     

     

     

    <TextBox Grid.Column="1" Grid.Row="0" Margin="5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.SpouseLastName}"/>

     

     

     

    <TextBlock Text="{StaticResource FirstName}" Grid.Column="0" Grid.Row="1" Margin="5"/>

     

     

     

    <TextBox Grid.Column="1" Grid.Row="1" Margin="5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.SpouseFirstName}"/>

     

     

     

    </Grid>

     

     

     

    </GroupBox>

     

     

     

    <GroupBox Margin="5" Header="{StaticResource GroupFatherHeader}">

     

     

     

    <Grid>

     

     

     

    <Grid.ColumnDefinitions>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    <ColumnDefinition Width="*"/>

     

     

     

    </Grid.ColumnDefinitions>

     

     

     

    <Grid.RowDefinitions>

     

     

     

    <RowDefinition />

     

     

     

    <RowDefinition />

     

     

     

    </Grid.RowDefinitions>

     

     

     

    <TextBlock Text="{StaticResource LastName}" Margin="5"/>

     

     

     

    <TextBox Grid.Column="1" Grid.Row="0" Margin="5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.FatherLastName}"/>

     

     

     

    <TextBlock Text="{StaticResource FirstName}" Grid.Column="0" Grid.Row="1" Margin="5"/>

     

     

     

    <TextBox Grid.Column="1" Grid.Row="1" Margin="5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.FatherFirstName}"/>

     

     

     

    </Grid>

     

     

     

    </GroupBox>

     

     

     

    <GroupBox Margin="5" Header="{StaticResource GroupMotherHeader}">

     

     

     

    <Grid>

     

     

     

    <Grid.ColumnDefinitions>

     

     

     

    <ColumnDefinition Width="Auto"/>

     

     

     

    <ColumnDefinition Width="*"/>

     

     

     

    </Grid.ColumnDefinitions>

     

     

     

    <Grid.RowDefinitions>

     

     

     

    <RowDefinition />

     

     

     

    <RowDefinition />

     

     

     

    </Grid.RowDefinitions>

     

     

     

    <TextBlock Text="{StaticResource LastName}" Margin="5" HorizontalAlignment="Left" />

     

     

     

    <TextBox Grid.Column="1" Grid.Row="0" Margin="5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.MotherLastName}"/>

     

     

     

    <TextBlock Text="{StaticResource FirstName}" Grid.Column="0" Grid.Row="1" Margin="5"/>

     

     

     

    <TextBox Grid.Column="1" Grid.Row="1" Margin="5" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}" Text="{Binding ElementName=Me, Path=Patient.MotherFirstName}"/>

     

     

     

    </Grid>

     

     

     

    </GroupBox>

     

     

     

    </StackPanel>

     

     

     

    <GroupBox Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Margin="5" Header="{StaticResource GroupCommentsHeader}" HorizontalContentAlignment="Stretch">

     

     

     

    <Grid Margin="5">

     

     

     

    <Grid.ColumnDefinitions>

     

     

     

    <ColumnDefinition Width="*" />

     

     

     

    <ColumnDefinition Width="Auto" />

     

     

     

    </Grid.ColumnDefinitions>

     

     

     

    <TextBox Height="100" Margin="5 5 0 5" Text="{Binding ElementName=Me, Path=Patient.Comments}" IsReadOnly="{Binding ElementName=Me, Path=IsReadOnly}"/>

     

     

     

    <StackPanel Orientation="Vertical" Grid.Column="1" Margin="5">

     

     

     

    <telerik:RadButton IsEnabled="{Binding ElementName=Me, Path=IsReadOnly, Converter={StaticResource enabledConverter}}">

     

     

     

    <StackPanel Orientation="Horizontal">

     

     

     

    <Image Margin="5 0 0 0" Source="Resources/Text_32x32.png" Height="24" Width="24" />

     

     

     

    <TextBlock Margin="5" VerticalAlignment="Center" Text="{StaticResource Text}" />

     

     

     

    </StackPanel>

     

     

     

    </telerik:RadButton>

     

     

     

    </StackPanel>

     

     

     

    </Grid>

     

     

     

    </GroupBox>

     

     

     

    </Grid>

     

     

     

    </telerik:RadTabItem>

     

     

     

    <telerik:RadTabItem>

     

     

     

    <telerik:RadTabItem.Header>

     

     

     

    <StackPanel Orientation="Horizontal">

     

     

     

    <Image Source="Resources/RadiologyFile_32x32.png" Height="24" Width="24" />

     

     

     

    <TextBlock Text="{StaticResource RadiologyFile}" Margin="3 0 0 0" VerticalAlignment="Center"/>

     

     

     

    </StackPanel>

     

     

     

    </telerik:RadTabItem.Header>

     

     

     

    </telerik:RadTabItem>

     

     

     

    <telerik:RadTabItem>

     

     

     

    <telerik:RadTabItem.Header>

     

     

     

    <StackPanel Orientation="Horizontal">

     

     

     

    <Image Source="Resources/Allergy_32x32.png" Height="24" Width="24" />

     

     

     

    <TextBlock Text="{StaticResource Allergies}" Margin="3 0 0 0" VerticalAlignment="Center"/>

     

     

     

    </StackPanel>

     

     

     

    </telerik:RadTabItem.Header>

     

     

     

    </telerik:RadTabItem>

     

     

     

    <telerik:RadTabItem>

     

     

     

    <telerik:RadTabItem.Header>

     

     

     

    <StackPanel Orientation="Horizontal">

     

     

     

    <Image Source="Resources/Form_32x32.png" Height="24" Width="24" />

     

     

     

    <TextBlock Text="{StaticResource Forms}" Margin="3 0 0 0" VerticalAlignment="Center"/>

     

     

     

    </StackPanel>

     

     

     

    </telerik:RadTabItem.Header>

     

     

     

    </telerik:RadTabItem>

     

     

     

    </telerik:RadTabControl>

     

     

     

    </Grid>

     

     

    </

     

    telerik:RadWindow>

    Here is my code

     

     

    IsolatedStorageProvider storage = new IsolatedStorageProvider();

     

    storage.SaveToStorage();

     

    storage.LoadFromStorage();

    also, if you look at picture 3 and 4, you can see an expanded RadOutlookBar, I minimized my RadOutlookBar and call a SaveToStorage. In picture 4 it's when I call a LoadFromStorage and expand my RadOutlookbar.

  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 07 Nov 2011 Link to this post

    Hello Oliver,

    Unfortunately I wasn't able to reproduce this issue on our side. This is why I attached the sample project I prepared to test the issue on our side. Can you please have a look at it and let me know if I'm missing something? If you can modify the solution to better illustrate your scenario and to reproduce the issue, we will be able to further investigate it and look for a cause.

    Thank you in advance for your cooperation on the matter.

    Greetings,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 07 Nov 2011 Link to this post

    Hi,

    for the first part of the problem (picture 1 and 2), it's verry easy to reproduce it without any changes in your demo :)

    1. Start the application
    2. Click "OpenWindow"
        2.1. You should see a clean RadWindow
    3. Click "Save"
    4. Click "Load"
        4.1. Look at the RadWindow, a lot of artefact are present, all the edit box frame are missing, all groupbox frame are missing, etc...

    For the second part of the problem (picture 3 and 4), it's odd... I will look at it

    Thank's
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 10 Nov 2011 Link to this post

    Hello Oliver,

    I still cannot reproduce the issue on our side even following the steps you listed. Can you please check the version of the Telerik assemblies you use? If you're using an older version of our controls, can you please try the latest release and let us know if the issue is still visible.

    Also if the latest release doesn't work as well, can you send us the xml serialization information. You can get it by saving the RadWindow properties and content in a stream using the PersistenceManager. Then you can read the stream and get the xml that describes the persisted data. For example you can modify the Save button Click event handler:
    private void Save(object sender, RoutedEventArgs e)
    {
        //IsolatedStorageProvider storage = new IsolatedStorageProvider();
        //storage.SaveToStorage();
     
        PersistenceManager manager = new PersistenceManager();
     
        var stream = manager.Save(this.win);
        stream.Position = 0L;
     
        StreamReader reader = new StreamReader(stream);
     
        string xml = reader.ReadToEnd();
     
        Clipboard.SetText(xml);
    }

    This way after clicking Save you'll be able to paste the XML content in a file. Please send us the file so that we can examine it.

    Also, we think that there might be an issue with the converter of the BorderBrush of the TextBoxes/GroupBoxes. Basically when the BorderBrush is a LinearBrush/RadialBrush for example, the PersistenceManager uses a converter when serializing and de-serializing the brush and if the conversion fails the BorderBruch will be set to Transparent and may cause the issue you described. And from the snapshots you sent I noticed that the RadWindow has a theme set - can you tell me if its a custom theme or a built-in theme? Also can you tell us the OS in which you're testing the solution and the theme applied to the OS? We need this information since the theme settings may define a BorderBrush for the TextBoxes and GroupBoxes that cannot be properly converted. Can you find this BorderBrush and post it here?

    We highly appreciate your assistance on the matter.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 10 Nov 2011 Link to this post

    Hi,

    doing an upgrade of Telerik cause a lot of headaches for our development team :(
    Before doing ad upgrade, can you try finding an issue with all new infos I provided to you?

    Guess what, if I set my OS theme to Windows XP, no problems!!!!
    Using my actual theme (Windows classic), I have the problem!!!

    Answers to your questions:
    Assembly version =  Version 2011.2.712.35
    DotNet version = 3.5
    Theme = Telerik built-in theme
    OS = Windows xp Pro
    OS Theme = WIndows classic
    Serialization file: attached file (rename persistence.xml.png to persistence.xml)

    Thank's
  7. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 10 Nov 2011 Link to this post

    Hi Oliver,

    Thank you for providing the serialization xml. I have looked at it and it seems that the BorderBrush of the TextBox controls and the GroupBox controls are being reported as transparent. I ran a quick check on my Windows 7 machine (with Classic theme) and this is really the case. When you get the value of the TextBox.BorderBrush property, you get a #00FFFFFF color. The effect of disappearing comes when you deserialize the controls. The persistence framework has already saved the transparent color and when it restores it, the TextBox's borders disappear. In contrast, in the other themes, the BorderBrush by default is a linear gradient brush with couple of gradient stops.

    There are couple of ways around this. You can either create a style for your TextBox controls and set the BorderBrush property to a brush that can be safely saved and restored or you can prevent the BorderBrush property from being serialized. You can quickly do this using the code below:

    private void Save(object sender, RoutedEventArgs e)
    {
        PersistenceManager manager = new PersistenceManager();
        manager.PropertyPersisting += new Telerik.Windows.Persistence.Events.PropertyPersistingEventHandler(manager_PropertyPersisting);
        IsolatedStorageProvider storage = new IsolatedStorageProvider(manager);
        storage.SaveToStorage();
    }
     
    void manager_PropertyPersisting(object sender, Telerik.Windows.Persistence.Events.PersistingPropertyEventArgs e)
    {
        if (e.Name == "BorderBrush")
            e.Cancel = true;
    }

    Please let me know if you have questions on this matter.

    Best wishes,
    Alex Fidanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  8. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 10 Nov 2011 Link to this post

    Great it work!!!

    Do you plan to add a native fix for this issue?

    Thank's
  9. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 14 Nov 2011 Link to this post

    Hello Oliver,

    Yes, we are going to address this in our code. As the BorderBrush property is Unset in this case, we are not going to save it and therefore it is not going to be restored when loading. If the value is not Unset (i.e. when you set it to some color) it will be saved and restored (as the current behavior). This is going to be available with the upcoming Q3 release.

    Kind regards,
    Alex Fidanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  10. Oliver
    Oliver avatar
    263 posts
    Member since:
    Feb 2011

    Posted 21 Nov 2011 Link to this post

    Hi,

    I have another question about the PersistenceFramework and loosing infos...

    When the user close the RadWindow, I use the PersistenceFramework to persist the form on disk and when the RadWindow show up, I load the persistence of the RadWindow from disk using the PersistenceFramework.

    Actually I'm in development process, many user's use my new application with all existing feature. So, if I add new feature to my RadWindow such a RadButton, CheckBox, etc and I upgrade all my user's, when they start the application, all new features will be lost due to the load of the RadWindow persistence!!!

    How it's possible to have all new features available after loading my RadWindow from disk instead of deleting to persistence file on disk :( ???

    Thank's
  11. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 24 Nov 2011 Link to this post

    Hello Oliver,

    Unfortunately the RadPersistanceFramework doesn't support this scenario at the moment. However, I logged a feature request in our PITS which you can vote for. And I updated your Telerik account for this suggestion.

    In the meantime you can persist each control/panel on its own instead of persisting the whole layout together. This way the RadPersistanceFramework will load the settings for each persisted control, and if you add new items to a main panel, which isn't persisted, the new elements won't be removed.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
UI for WPF is Visual Studio 2017 Ready