PsPropertyGrid1.SelectedObject = MachineConfig
I want to change Category name at runtime for localization
I can change Item name and description with ItemFormatting event as fallow but Categoty property is readonly ,
How can I change category attirubute name at runtime in radpropertygrid...
Private Sub PsPropertyGrid1_ItemFormatting(sender As Object, e As Telerik.WinControls.UI.PropertyGridItemFormattingEventArgs) Handles PsPropertyGrid1.ItemFormatting
Select Case e.Item.Name
Case Is = "MachineID"
'e.Item.Enabled = False
e.Item.Label = RM.GetString(7760)
e.Item.Description = RM.GetString(7761)
Case Is = "CompanyInfo"
.....
.....
End Select
Sub
Thanks for all helps...
<
UserControl
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
x:Class
=
"Bambi.Modules.Dashboards.Views.StrategySummaryView"
xmlns:local
=
"clr-namespace:Bambi.Modules.Dashboards"
xmlns:controls
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
xmlns:inf
=
"clr-namespace:Bambi.Infrastructure;assembly=Bambi.Infrastructure"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"300"
Name
=
"Strategy"
>
<
UserControl.Resources
>
<
inf:InvertBoolean
x:Key
=
"InvertBoolean"
/>
<
inf:BooleanToVisibility
x:Key
=
"BooleanToVisibility"
/>
<
inf:InvertBooleanToVisibility
x:Key
=
"InvertBooleanToVisibility"
/>
<
DataTemplate
x:Key
=
"HeaderTemplate"
>
<
TextBlock
Text
=
"{Binding StrategyName}"
FontFamily
=
"Helvetica Neue LT Com"
FontSize
=
"14"
/>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"DailyDataTemplate"
>
<
telerik:RadFluidContentControl
ContentChangeMode
=
"Manual"
TransitionDuration
=
"0:0:0.5"
>
<
telerik:RadFluidContentControl.LargeContent
>
<
ContentPresenter
Content
=
"{Binding StrategyDetail}"
/> <--This is the created view
</
telerik:RadFluidContentControl.LargeContent
>
<
telerik:RadFluidContentControl.SmallContent
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"150"
/>
<
ColumnDefinition
Width
=
"150"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"0.17*"
/>
<
RowDefinition
Height
=
"0.17*"
/>
<
RowDefinition
Height
=
"0.17*"
/>
<
RowDefinition
Height
=
"0.17*"
/>
<
RowDefinition
Height
=
"0.1*"
/>
<
RowDefinition
Height
=
"0.13*"
/>
</
Grid.RowDefinitions
>
<
TextBlock
FontFamily
=
"Helvetica Neue LT Com"
FontSize
=
"32"
Foreground
=
"#FFF39200"
VerticalAlignment
=
"Bottom"
Margin
=
"0,15,0,0"
HorizontalAlignment
=
"Right"
><
Run
Language
=
"en-au"
Text
=
"{Binding TradeCount }"
/></
TextBlock
>
<
TextBlock
Grid.Column
=
"1"
Margin
=
"8,0,32,0"
FontFamily
=
"Helvetica Neue LT Com"
Foreground
=
"Gray"
FontWeight
=
"Bold"
Height
=
"20"
VerticalAlignment
=
"Bottom"
FontSize
=
"12"
><
Run
Language
=
"en-au"
Text
=
"TRADES"
/></
TextBlock
>
<
TextBlock
FontFamily
=
"Helvetica Neue LT Com"
FontSize
=
"32"
VerticalAlignment
=
"Bottom"
Foreground
=
"#FFF39200"
Margin
=
"0,15,0,0"
HorizontalAlignment
=
"Right"
Grid.Row
=
"1"
><
Run
Language
=
"en-au"
Text
=
"{Binding Return, StringFormat={}{0:P} }"
/></
TextBlock
>
<
TextBlock
Grid.Column
=
"1"
Margin
=
"8,0,32,0"
TextWrapping
=
"Wrap"
FontFamily
=
"Helvetica Neue LT Com"
Foreground
=
"Gray"
FontWeight
=
"Bold"
Height
=
"20"
VerticalAlignment
=
"Bottom"
FontSize
=
"12"
Grid.Row
=
"1"
><
Run
Language
=
"en-au"
Text
=
"RETURN"
/></
TextBlock
>
<
TextBlock
FontFamily
=
"Helvetica Neue LT Com"
FontSize
=
"32"
VerticalAlignment
=
"Bottom"
Foreground
=
"#FFF39200"
Margin
=
"0,15,0,0"
HorizontalAlignment
=
"Right"
Grid.Row
=
"2"
><
Run
Language
=
"en-au"
Text
=
"{Binding Probability, StringFormat={}{0:P} }"
/></
TextBlock
>
<
TextBlock
Grid.Column
=
"1"
Margin
=
"8,0"
TextWrapping
=
"Wrap"
FontFamily
=
"Helvetica Neue LT Com"
Foreground
=
"Gray"
FontWeight
=
"Bold"
Height
=
"20"
VerticalAlignment
=
"Bottom"
FontSize
=
"12"
Grid.Row
=
"2"
><
Run
Language
=
"en-au"
Text
=
"PROBABILITY"
/></
TextBlock
>
<
TextBlock
FontFamily
=
"Helvetica Neue LT Com"
FontSize
=
"32"
VerticalAlignment
=
"Bottom"
Foreground
=
"#FFF39200"
Margin
=
"0,15,0,0"
HorizontalAlignment
=
"Right"
Grid.Row
=
"3"
><
Run
Language
=
"en-au"
Text
=
"{Binding WinLossRatio, StringFormat={}{0:P} }"
/></
TextBlock
>
<
TextBlock
Grid.Column
=
"1"
Margin
=
"8,0"
TextWrapping
=
"Wrap"
FontFamily
=
"Helvetica Neue LT Com"
Foreground
=
"Gray"
FontWeight
=
"Bold"
Height
=
"20"
VerticalAlignment
=
"Bottom"
FontSize
=
"12"
Grid.Row
=
"3"
><
Run
Language
=
"en-au"
Text
=
"WIN/LOSS"
/></
TextBlock
>
<
telerik:RadRating
IsReadOnly
=
"False"
NumberOfItemsToGenerate
=
"10"
Grid.ColumnSpan
=
"2"
HorizontalAlignment
=
"Center"
Grid.Row
=
"4"
Value
=
"{Binding Ranking}"
Margin
=
"0,0,5,5"
VerticalAlignment
=
"Bottom"
/>
<
telerik:RadButton
Visibility
=
"{Binding RetrievePressed, Converter={StaticResource InvertBooleanToVisibility}}"
Content
=
"Retrieve Details"
Grid.Row
=
"5"
Grid.ColumnSpan
=
"2"
telerik:StyleManager.Theme
=
"Expression_Dark"
VerticalAlignment
=
"Center"
Height
=
"24"
Width
=
"150"
Command
=
"{Binding DataContext.RetrieveStrategyDetailCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadTileView}} }"
CommandParameter
=
"{Binding TrackingID}"
/>
<
telerik:RadProgressBar
telerik:StyleManager.Theme
=
"Expression_Dark"
Grid.Row
=
"5"
Grid.Column
=
"0"
Grid.ColumnSpan
=
"2"
Height
=
"6"
Width
=
"150"
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Center"
IsIndeterminate
=
"True"
DataContext
=
"{Binding}"
Visibility
=
"{Binding VisibleProgressBar, Converter={StaticResource BooleanToVisibility}}"
/>
<
TextBlock
Visibility
=
"{Binding DataComplete, Converter={StaticResource BooleanToVisibility}}"
Grid.Row
=
"5"
Grid.Column
=
"0"
Grid.ColumnSpan
=
"2"
TextWrapping
=
"Wrap"
FontFamily
=
"Helvetica Neue LT Com"
Foreground
=
"Gray"
FontWeight
=
"Bold"
Height
=
"20"
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Center"
FontSize
=
"12"
IsVisibleChanged="TextBlock_IsVisibleChanged">
<
Run
Language
=
"en-au"
Text
=
"COMPLETE"
/>
</
TextBlock
>
</
Grid
>
</
telerik:RadFluidContentControl.SmallContent
>
</
telerik:RadFluidContentControl
>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"HourlyDataTemplate"
>
<
telerik:RadFluidContentControl
ContentChangeMode
=
"Manual"
TransitionDuration
=
"0:0:0.5"
>
<
telerik:RadFluidContentControl.LargeContent
>
<
Grid
Margin
=
"0"
>
<
Rectangle
Fill
=
"Aqua"
Margin
=
"0"
/>
<
TextBlock
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Center"
Foreground
=
"Black"
Text
=
"LargeContent"
FontSize
=
"24"
/>
</
Grid
>
</
telerik:RadFluidContentControl.LargeContent
>
<
telerik:RadFluidContentControl.SmallContent
>
<
Grid
Margin
=
"0"
>
<
Rectangle
Fill
=
"BlueViolet"
Margin
=
"0"
/>
<
TextBlock
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Center"
Foreground
=
"Yellow"
Text
=
"SmallContent"
FontSize
=
"24"
/>
</
Grid
>
</
telerik:RadFluidContentControl.SmallContent
>
</
telerik:RadFluidContentControl
>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"MinutelyDataTemplate"
>
<
telerik:RadFluidContentControl
ContentChangeMode
=
"Manual"
TransitionDuration
=
"0:0:0.5"
>
<
telerik:RadFluidContentControl.LargeContent
>
<
Grid
Margin
=
"0"
>
<
Rectangle
Fill
=
"Tomato"
Margin
=
"0"
/>
<
TextBlock
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Center"
Foreground
=
"SteelBlue"
Text
=
"LargeContent"
FontSize
=
"24"
/>
</
Grid
>
</
telerik:RadFluidContentControl.LargeContent
>
<
telerik:RadFluidContentControl.SmallContent
>
<
Grid
Margin
=
"0"
>
<
Rectangle
Fill
=
"Silver"
Margin
=
"0"
/>
<
TextBlock
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Center"
Foreground
=
"Sienna"
Text
=
"SmallContent"
FontSize
=
"24"
/>
</
Grid
>
</
telerik:RadFluidContentControl.SmallContent
>
</
telerik:RadFluidContentControl
>
</
DataTemplate
>
<
local:StrategyTemplateSelector
x:Key
=
"ContentDataTemplateSelector"
DailyDataTemplate
=
"{StaticResource DailyDataTemplate}"
HourlyDataTemplate
=
"{StaticResource HourlyDataTemplate}"
MinutelyDataTemplate
=
"{StaticResource MinutelyDataTemplate}"
/>
</
UserControl.Resources
>
<
Grid
Background
=
"#FF252929"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"30"
/>
<
RowDefinition
Height
=
"274*"
/>
</
Grid.RowDefinitions
>
<
controls:RadTileView
Name
=
"StrategiesTiles"
telerik:StyleManager.Theme
=
"Expression_Dark"
MinimizedColumnWidth
=
"300"
MinimizedRowHeight
=
"300"
MaximizeMode
=
"One"
PreservePositionWhenMaximized
=
"True"
ContentTemplateSelector
=
"{StaticResource ContentDataTemplateSelector}"
ItemsSource
=
"{Binding StrategyDetails}"
ItemTemplate
=
"{StaticResource HeaderTemplate}"
TileStateChanged
=
"RadTileView_TileStateChanged"
TileStateChangeTrigger
=
"SingleClick"
Loaded
=
"StrategiesTiles_Loaded"
Grid.Row
=
"0"
Grid.RowSpan
=
"2"
DataContext
=
"{Binding}"
>
</
controls:RadTileView
>
</
Grid
>
</
UserControl
>
/// <summary>
/// Interaction logic for DashboardView.xaml
/// </summary>
public
partial
class
StrategySummaryView
{
public
StrategySummaryView()
{
InitializeComponent();
}
public
StrategySummaryView(StrategySummaryViewModel viewModel)
:
this
()
{
DataContext = viewModel;
}
private
void
RadTileView_TileStateChanged(
object
sender, Telerik.Windows.RadRoutedEventArgs e)
{
var item = e.OriginalSource
as
RadTileViewItem;
if
(item !=
null
)
{
var fluid = item.ChildrenOfType<RadFluidContentControl>().FirstOrDefault();
if
(fluid !=
null
)
{
switch
(item.TileState)
{
case
TileViewItemState.Maximized:
fluid.State = FluidContentControlState.Large;
break
;
case
TileViewItemState.Minimized:
fluid.State = FluidContentControlState.Small;
break
;
}
}
}
}
private
void
StrategiesTiles_Loaded(
object
sender, RoutedEventArgs e)
{
foreach
(var tile
in
StrategiesTiles.ChildrenOfType<RadTileViewItem>())
{
var fluid = tile.ChildrenOfType<RadFluidContentControl>().FirstOrDefault();
if
(fluid !=
null
)
{
switch
(tile.TileState)
{
case
TileViewItemState.Maximized:
fluid.State = FluidContentControlState.Large;
break
;
case
TileViewItemState.Minimized:
fluid.State = FluidContentControlState.Small;
break
;
}
}
}
}
private
void
TextBlock_IsVisibleChanged(
object
sender, DependencyPropertyChangedEventArgs e)
{
if
((
bool
)e.NewValue !=
true
)
return
;
var textBlock = sender
as
FrameworkElement;
if
(textBlock ==
null
)
return
;
var container = textBlock.ParentOfType<RadTileViewItem>();
if
(container ==
null
)
return
;
container.TileState = TileViewItemState.Maximized;
}
}