or
01.// --- Part of CustomRadGradView.cs (inherits from RadGridView) ---02.03.// Save this RadGridViews layout in background04.Task.Run(() =>05. {06. using (var manager = new CustomPersistenceManager())07. {08. // this is current RadGridView09. manager.SaveLayout(this, file);10. }11. }12.}01.// --- Part of CustomPersistenceManager.cs (inherits from PersistenceManager) ---02. 03.// Save a layout of any Telerik control04.public bool SaveLayout(Control control, string file = null)05.{06. // Current thread has no access to control -> Invoke required07. if (control.Dispatcher.CheckAccess() == false)08. {09. bool result = false;10. Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() => result = DoSaveLayout(control, file)));11. return result;12. }13. 14. // Current thread has access to control15. return DoSaveLayout(control, file);16.}01.// --- Part of CustomPersistenceManager.cs (inherits from PersistenceManager) ---02. 03.// save layout04.private bool DoSaveLayout(Control control, string file = null)05.{06. // this lines work without any errors so method is invoked correctly; thread has access to control!07. string name = control.Name; // returns name of control08. control.Name = "New name"; // just for testing09. 10. // Next line always throws an InvalidOperationException11. using (var stream = Save(control)) // call save method of Teleriks PersistenceManager class12. {13. stream.Seek(0, SeekOrigin.Begin);14. 15. using (var reader = new StreamReader(stream))16. {17. string text = reader.ReadToEnd();18. File.WriteAllText(path, text);19. }20. }21.}<Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions>
<ContentControl Grid.Row="0" prism:RegionManager.RegionName="{x:Static pll:RegionNames.BannerRegion}" VerticalAlignment="Top" /> <telerikDocking:RadDocking Grid.Row="1" Margin="2"> <telerikDocking:RadSplitContainer Orientation="Vertical" InitialPosition="DockedLeft" MinWidth="300"> <telerikDocking:RadPaneGroup> <telerikDocking:RadPane CanUserClose="False" CanFloat="False" Header="{x:Static resources:Resources.TaskBarPaneHeaderText}" ContextMenuTemplate="{x:Null}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <ContentControl Grid.Row="0" prism:RegionManager.RegionName="{x:Static pll:RegionNames.TaskBarRegion}" /> <ContentControl Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Height="300" Width="400" prism:RegionManager.RegionName="{x:Static pll:RegionNames.FooterRegion}" /> </Grid> </telerikDocking:RadPane> </telerikDocking:RadPaneGroup> </telerikDocking:RadSplitContainer> <telerikDocking:RadDocking.DocumentHost> <telerikDocking:RadSplitContainer> <telerikDocking:RadPaneGroup> <telerik:RadDocumentPane CanUserPin="False" CanUserClose="False" CanFloat="False" PaneHeaderVisibility="Hidden" TitleTemplate="{x:Null}" ContextMenuTemplate="{x:Null}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <ContentControl Grid.Row="0" Margin="2,2,2,2" prism:RegionManager.RegionName="{x:Static pll:RegionNames.MenuBarRegion}" /> <ContentControl Grid.Row="1" Margin="2,2,2,6" prism:RegionManager.RegionName="{x:Static pll:RegionNames.BreadCrumbRegion}" /> <ContentControl Grid.Row="2" Margin="2,2,2,2" prism:RegionManager.RegionName="{x:Static pll:RegionNames.WorkSpaceRegion}" /> </Grid> </telerik:RadDocumentPane> </telerikDocking:RadPaneGroup> </telerikDocking:RadSplitContainer> </telerikDocking:RadDocking.DocumentHost> </telerikDocking:RadDocking></Grid>
<telerik:RadDropDownButton VerticalAlignment="Center" HorizontalAlignment="Center" DropDownOpening="RadDropDownButton_DropDownOpening" Content="..."> <telerik:RadDropDownButton.DropDownContent> <TextBlock Text="Sample content" /> </telerik:RadDropDownButton.DropDownContent></telerik:RadDropDownButton>
private void RadDropDownButton_DropDownOpening( object sender, RoutedEventArgs e )
{
e.Handled = true;
}

<Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <billingCustomControls:BillingToaster Margin="0,0,-490,0" /> <ContentControl Grid.Row="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" prism:RegionManager.RegionName="{x:Static pll:RegionNames.BannerRegion}" VerticalAlignment="Top" /> <Grid Grid.Row="1"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <StackPanel Grid.Column="0"> <ContentControl Margin="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" prism:RegionManager.RegionName="{x:Static pll:RegionNames.UserDetailsRegion}" /> <Separator /> <ItemsControl Margin="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" prism:RegionManager.RegionName="{x:Static pll:RegionNames.TaskBarRegion}" /> <ContentControl Margin="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" MinHeight="200" MinWidth="100" prism:RegionManager.RegionName="{x:Static pll:RegionNames.FooterRegion}" VerticalAlignment="Bottom" /> </StackPanel> <Grid Grid.Column="1"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <ContentControl Grid.Row="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Margin="2,2,2,2" prism:RegionManager.RegionName="{x:Static pll:RegionNames.MenuBarRegion}" /> <ContentControl Grid.Row="1" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Margin="2,2,2,6" prism:RegionManager.RegionName="{x:Static pll:RegionNames.BreadCrumbRegion}" /> <ContentControl Grid.Row="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Margin="2,2,2,2" prism:RegionManager.RegionName="{x:Static pll:RegionNames.WorkSpaceRegion}" /> </Grid> </Grid></Grid>001.<Style x:Key="RadTileViewItemStyle" TargetType="{x:Type telerik:RadTileViewItem}">002. <Setter Property="TileState" Value="{Binding ContentState, Mode=TwoWay, Converter={StaticResource tileStateConverter}}" />003. <Setter Property="HorizontalContentAlignment" Value="Stretch" />004. <Setter Property="VerticalContentAlignment" Value="Stretch" />005. <Setter Property="SnapsToDevicePixels" Value="True" />006. <Setter Property="Template">007. <Setter.Value>008. <ControlTemplate TargetType="{x:Type telerik:RadTileViewItem}">009. <Grid>010. <Border x:Name="outerBorder"011. Margin="{TemplateBinding Padding}"012. 013. BorderBrush="{TemplateBinding BorderBrush}"014. BorderThickness="{TemplateBinding BorderThickness}"015. CornerRadius="7">016. <Border.Background>017. <RadialGradientBrush RadiusX="1" RadiusY="1" GradientOrigin="0.5,0.5" Opacity="0.75">018. <GradientStop Color="White" Offset="0" ></GradientStop>019. <GradientStop Color="Gray" Offset="1" ></GradientStop>020. </RadialGradientBrush>021. </Border.Background>022. <Border.Effect>023. <DropShadowEffect BlurRadius="2" Color="#888" Direction="-45" ShadowDepth="2" />024. </Border.Effect>025. <Border x:Name="outerContainer"026. Background="Transparent">027. <telerik:RadFluidContentControl ContentChangeMode="Manual" State="{Binding ContentState, Converter={StaticResource fluidContentStateConverter}}">028. <telerik:RadFluidContentControl.SmallContent>029. <telerik:RadButton Command="tileView:TileViewCommands.ToggleTileState" OverridesDefaultStyle="False">030. <Button.Template>031. <ControlTemplate TargetType="{x:Type Button}">032. <Grid>033. <Image Stretch="Uniform" Cursor="Hand">034. <Image.Style>035. <Style>036. <Setter Property="Image.Source" Value="{Binding SetupImage}" />037. <Setter Property="UIElement.Opacity" Value=".4"/>038. <Style.Triggers>039. <Trigger Property="UIElement.IsMouseOver" Value="True">040. <Setter Property="Image.Source" Value="{Binding SetupImage}" />041. <Setter Property="UIElement.Opacity" Value="1"/>042. </Trigger>043. </Style.Triggers>044. </Style>045. </Image.Style>046. </Image>047. <Viewbox Margin="20">048. <TextBlock Text="{Binding Name}" FontFamily="Calibri" FontSize="12" HorizontalAlignment="Center" VerticalAlignment="Center">049. <TextBlock.Effect>050. <DropShadowEffect BlurRadius="2" Color="#FFF" Direction="-45" ShadowDepth=".5" />051. </TextBlock.Effect>052. </TextBlock>053. </Viewbox>054. </Grid>055. </ControlTemplate>056. </Button.Template>057. </telerik:RadButton>058. </telerik:RadFluidContentControl.SmallContent>059. <telerik:RadFluidContentControl.Content>060. <telerik:RadButton Command="tileView:TileViewCommands.ToggleTileState" OverridesDefaultStyle="False">061. <Button.Template>062. <ControlTemplate TargetType="{x:Type Button}">063. <Grid Cursor="Hand">064. <Image >065. <Image.Style>066. <Style>067. <Setter Property="Image.Source" Value="{Binding SetupImage}" />068. <Setter Property="UIElement.Opacity" Value=".4"/>069. <Style.Triggers>070. <Trigger Property="UIElement.IsMouseOver" Value="True">071. <Setter Property="Image.Source" Value="{Binding SetupImage}" />072. <Setter Property="UIElement.Opacity" Value="1"/>073. </Trigger>074. </Style.Triggers>075. </Style>076. </Image.Style>077. </Image>078. <Viewbox Margin="40">079. <TextBlock Text="{Binding Name}" FontFamily="Calibri" FontSize="12" HorizontalAlignment="Center" VerticalAlignment="Center">080. <TextBlock.Effect>081. <DropShadowEffect BlurRadius="4" Color="#FFF" Direction="-45" ShadowDepth=".5" />082. </TextBlock.Effect>083. </TextBlock>084. </Viewbox>085. </Grid>086. </ControlTemplate>087. </Button.Template>088. </telerik:RadButton>089. </telerik:RadFluidContentControl.Content>090. <telerik:RadFluidContentControl.LargeContent>091. <Grid>092. <Grid.Background>093. <ImageBrush ImageSource="{Binding SetupImage}" Opacity="0.35" Stretch="UniformToFill" TileMode="None"></ImageBrush>094. </Grid.Background>095. <Grid.RowDefinitions>096. <RowDefinition Height="Auto"></RowDefinition>097. <RowDefinition Height="*"></RowDefinition>098. <RowDefinition Height="Auto"></RowDefinition>099. </Grid.RowDefinitions>100. <TextBlock Grid.Row="0" Padding="10" Text="{Binding Version}" HorizontalAlignment="Right" VerticalAlignment="Top"></TextBlock>101. <TextBlock Grid.Row="0" Padding="10" FontFamily="Calibri" FontSize="20" FontWeight="Bold" Text="{Binding Name}" HorizontalAlignment="Left"></TextBlock>102. <telerik:RadButton Grid.Row="1" Command="tileView:TileViewCommands.ToggleTileState" OverridesDefaultStyle="False" Cursor="Hand">103. <Button.Template>104. <ControlTemplate TargetType="{x:Type Button}">105. <TextBlock Padding="10" TextWrapping="Wrap" Text="{Binding Description}" FontFamily="Calibri" Foreground="Black" FontSize="12pt">106. </TextBlock>107. </ControlTemplate>108. </Button.Template>109. </telerik:RadButton>110. <Border Grid.Row="2" BorderBrush="White" BorderThickness="2" CornerRadius="6" Cursor="Hand" Width="120" Height="60" Margin="0,0,0,10">111. <Border.Style>112. <Style>113. <Setter Property="Border.Background" Value="LightGray"></Setter>114. <Setter Property="UIElement.Opacity" Value="0.7"></Setter>115. <Style.Triggers>116. <Trigger Property="UIElement.IsMouseOver" Value="True">117. <Setter Property="UIElement.Opacity" Value="1"/>118. </Trigger>119. </Style.Triggers>120. </Style>121. </Border.Style>122. <Button Height="Auto" Width="Auto" OverridesDefaultStyle="False" ClickMode="Release" Command="{Binding DebugCommand}" CommandParameter="{Binding}">123. <Button.Template>124. <ControlTemplate TargetType="{x:Type Button}">125. <Viewbox>126. <TextBlock Text="Run"></TextBlock>127. </Viewbox>128. </ControlTemplate>129. </Button.Template>130. </Button>131. </Border>132. </Grid>133. </telerik:RadFluidContentControl.LargeContent>134. </telerik:RadFluidContentControl>135. </Border>136. </Border>137. </Grid>138. </ControlTemplate>139. </Setter.Value>140. </Setter>141.</Style>01.<telerik:RadTileView x:Name="taskTileList" Grid.Row="1" VerticalAlignment="Top" ColumnsCount="2" ColumnWidth=".5*" IsAutoScrollingEnabled="False" IsDockingEnabled="False" Padding="30"02. ItemsSource="{Binding Tasks}"03. ItemTemplate="{StaticResource taskHeaderTemplate}"04. ItemContainerStyle="{StaticResource RadTileViewItemStyle}"05. IsItemDraggingEnabled="False"06. MinimizedColumnWidth="210" 07. MinimizedRowHeight="140"08. MinimizedItemsPosition="Right"09. TileStateChangeTrigger="SingleClick"10. PreservePositionWhenMaximized="True">11.</telerik:RadTileView>
<Setter Property="RowStyleSelector" Value="{StaticResource DiffRowStyleSelector}" /><Setter Property="TreeLinesVisibility" Value="Hidden" />