or
Private
Sub
ShowChildScreen(
ByVal
param
As
ScreenActivateEventArgs)
If
Not
_screenregistry.ContainsKey(param.ScreenId)
Then
Throw
New
InvalidOperationException(
String
.Format(
"ScreenId {0} not registered."
,
param.ScreenId))
End
If
Dim
s
As
IScreen =
_container.TryResolve(_screenregistry.Item(param.ScreenId))
s.ScreenSubject =
param.ScreenSubject
Dim
reg
As
IRegion =
_regionManager.Regions(param.RegionName)
Dim
v
As
Object
=
reg.GetView(s.ScreenKey)
If
v
Is
Nothing
Then
reg.Add(s.View,
s.ScreenKey)
Else
reg.Activate(v)
End
If
End
Sub
My tab control XAML is as follows:
<
telerik:RadTabControl
cal:RegionManager.RegionName
=
"MainWorkspaceRegion"
Grid.Row
=
"1"
DropDownDisplayMode
=
"Visible"
>
<
telerik:RadTabControl.ItemContainerStyle
>
<
Style
TargetType
=
"{x:Type telerik:RadTabItem}"
>
<
Setter
Property
=
"Header"
Value
=
"{Binding DataContext}"
/>
<
Setter
Property
=
"HeaderTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
TextBlock
Grid.Column
=
"0"
Text
=
"{Binding DisplayName}"
/>
<
Button
Command
=
"{Binding CloseCommand}"
Grid.Column
=
"1"
Content="X"
Cursor="Hand"
Focusable="False"
FontFamily="Courier"
FontSize="9"
FontWeight="Bold"
Margin="4,1,0,0"
Padding="0"
VerticalContentAlignment="Bottom"
Width="16" Height="16"
/>
</
Grid
>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
<
Setter
Property
=
"Height"
Value
=
"25"
/>
<Setter Property="IsSelected" Value="True" />
</
Style
>
</
telerik:RadTabControl.ItemContainerStyle
>
</
telerik:RadTabControl
>
public class GridLine
{
public string Key { get; set; }
public List<
Year
> Years { get; set; }
}
public class Year
{
public string Code { get; set; }
public int TotalValue { get { return Months != null ? Months.Sum(m => m.Value) : 0; } }
public List<
Month
> Months { get; set; }
}
public class Month
{
public string Code { get; set; }
public int Value { get; set; }
}
private void TestGridDataLoaded(object sender, EventArgs e)
{
var items = (List<
GridLine
>)TestGrid.ItemsSource;
if (items == null || items.Count == 0) return;
// Generate columns for hierarchical years and months.
for (int yearCounter = 0; yearCounter <
FixedNumberOfYears
; yearCounter++)
{
var
year
=
items
[0].Years[yearCounter];
var
yearColumn
=
new
GridViewDataColumn
{
Tag
=
year
.Code,
DataMemberBinding
=
new
Binding(string.Format("Years[{0}].TotalValue", yearCounter)),
};
yearColumn.Header
=
CreateColumnHeaderLabel
(yearColumn, year.Code); // creates a double clickable header to toggle visibility
_gridColumns.Add(yearColumn, new List<GridViewDataColumn>());
TestGrid.Columns.Add(yearColumn);
for (var monthCounter = 0; monthCounter < FixedNumberOfMonths; monthCounter++)
{
var month = year.Months[monthCounter];
var monthColumn = new GridViewDataColumn
{
IsVisible = false,
Header = CreateColumnHeaderLabel(yearColumn, month.Code, true),
DataMemberBinding = new Binding(string.Format("Years[{0}].Months[{1}].Value", yearCounter, monthCounter))
};
_gridColumns[yearColumn].Add(monthColumn);
TestGrid.Columns.Add(monthColumn);
}
}
}
private System.Windows.Controls.Label CreateColumnHeaderLabel(GridViewDataColumn yearColumn, string content, bool isMonth = false)
{
var label = new System.Windows.Controls.Label
{
Content = content,
Tag = yearColumn, Foreground = new SolidColorBrush( isMonth ? Colors.Yellow : Colors.White)
};
label.MouseDoubleClick += ToggleColumnsVisibility;
return label;
}
<telerik:RadCartesianChart.Behaviors> <telerik:ChartTrackBallBehavior ShowIntersectionPoints="True" TrackInfoUpdated="ChartTrackBallBehavior_TrackInfoUpdated_1" /> </telerik:RadCartesianChart.Behaviors>If RadCartesianChart has a property like this is better.
Sorry My English is not very well, If you can understand what I say, I would be very grateful.<
telerik:RadChart
>
<
telerik:RadChart.SeriesMappings
>
<
telerik:SeriesMapping
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:LineSeriesDefinition
EmptyPointBehavior
=
"Gap"
/>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:RadPieChart
HorizontalAlignment
=
"Left"
Margin
=
"31,32,0,0"
VerticalAlignment
=
"Top"
>
<
telerik:PieSeries
x:Name
=
"TotalSalePercent"
ShowLabels
=
"True"
ItemsSource
=
"{Binding}"
ValueBinding
=
"__of_Total_Sales"
>
</
telerik:PieSeries
>
</
telerik:RadPieChart
>
List<spSalesPercentResult> spSalesPercentresult = (from s
in
conn.spSalesPercent()
select s).ToList();
TotalSalePercent.ItemsSource = spSalesPercentresult;