hi
1. Add Page in SL5 Project
1. Add RadGridView control,
2. ViewModel binding
( binding object :
public class CTwitterStatus : INotifyPropertyChanged
{
DateTime created_at;
public DateTime Created_At
{
get { return created_at; }
set
{
if (created_at != value)
{
created_at = value;
OnPropertyChange("Created_At");
}
}
}
string id;
public string Id
{
get { return id; }
set
{
if (id != value)
{
id = value;
OnPropertyChange("Id");
}
}
}
string text;
public string Text
{
get { return text; }
set
{
if (text != value)
{
text = value;
OnPropertyChange("Text");
}
}
}
string source;
public string Source
{
get { return source; }
set
{
if (source != value)
{
source = value;
OnPropertyChange("Source");
}
}
}
bool truncated;
public bool Truncated
{
get { return truncated; }
set
{
if (truncated != value)
{
truncated = value;
OnPropertyChange("Truncated");
}
}
}
bool favorited;
public bool Favorited
{
get { return favorited; }
set
{
if (favorited != value)
{
favorited = value;
OnPropertyChange("Favorited");
}
}
}
string in_reply_to_status_id;
public string In_Reply_To_Status_Id
{
get { return in_reply_to_status_id; }
set
{
if (in_reply_to_status_id != value)
{
in_reply_to_status_id = value;
OnPropertyChange("In_Reply_To_Status_Id");
}
}
}
Nullable<int> in_reply_to_user_id;
public Nullable<int> In_Reply_To_User_Id
{
get { return in_reply_to_user_id; }
set
{
if (in_reply_to_user_id != value)
{
in_reply_to_user_id = value;
OnPropertyChange("In_Reply_To_User_Id");
}
}
}
string in_reply_to_screen_name;
public string In_Reply_To_Screen_Name
{
get { return in_reply_to_screen_name; }
set
{
if (in_reply_to_screen_name != value)
{
in_reply_to_screen_name = value;
OnPropertyChange("In_Reply_To_Screen_Name");
}
}
}
int retweet_count;
public int Retweet_Count
{
get { return retweet_count; }
set
{
if (retweet_count != value)
{
retweet_count = value;
OnPropertyChange("Retweet_Count");
}
}
}
bool retweeted;
public bool Retweeted
{
get { return retweeted; }
set
{
if (retweeted != value)
{
retweeted = value;
OnPropertyChange("Retweeted");
}
}
}
CTwitterUser user;
public CTwitterUser User
{
get { return user; }
set
{
if (user != value)
{
user = value;
OnPropertyChange("User");
}
}
}
CTwitterGeo geo;
public CTwitterGeo Geo
{
get { return geo; }
set
{
if (geo != value)
{
geo = value;
OnPropertyChange("Geo");
}
}
}
CTwitterCoordinates coordinates;
public CTwitterCoordinates Coordinates
{
get { return coordinates; }
set
{
if (coordinates != value)
{
coordinates = value;
OnPropertyChange("Coordinates");
}
}
}
CTwitterPlace place;
public CTwitterPlace Place
{
get { return place; }
set
{
if (place != value)
{
place = value;
OnPropertyChange("Place");
}
}
}
CTwitterContributors contributors;
public CTwitterContributors Contributors
{
get { return contributors; }
set
{
if (contributors != value)
{
contributors = value;
OnPropertyChange("Contributors");
}
}
}
#region PropertyChange
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChange(string PropertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(PropertyName));
}
}
#endregion
}
public class CTwitterSet : ObservableCollection<CTwitterStatus>
{
}
)
<sdk:Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:Devpia_ViewModel="clr-namespace:Devpia.ViewModel"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:Telerik_Windows_Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Data"
mc:Ignorable="d"
x:Class="Devpia.RadGridViewView"
Title="RadGridViewView Page"
d:DesignWidth="640" d:DesignHeight="480">
<d:DesignProperties.DataContext>
<Devpia_ViewModel:CTwitterViewModel/>
</d:DesignProperties.DataContext>
<!--런타임에서 Import를 해서 LayoutRoot.DataContext에 입력됨-->
<Grid x:Name="LayoutRoot" >
<telerik:RadGridView ItemsSource="{Binding TwitterSet}" />
</Grid>
</sdk:Page>
3. build
4. Design time error
System.TypeLoadException
Could not load type 'System.Collections.ObjectModel.ReadOnlyDictionary`2' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
at System.Linq.Expressions.Compiler.CompilerScope.ResolveVariable(ParameterExpression variable, HoistedLocals hoistedLocals)
at System.Linq.Expressions.Compiler.LambdaCompiler.EmitParameterExpression(Expression expr)
at System.Linq.Expressions.Compiler.LambdaCompiler.EmitExpression(Expression node, CompilationFlags flags)
at System.Linq.Expressions.Compiler.LambdaCompiler.EmitArguments(MethodBase method, IArgumentProvider args, Int32 skipParameters)
at System.Linq.Expressions.Compiler.LambdaCompiler.EmitMethodCall(MethodInfo mi, IArgumentProvider args, Type objectType, CompilationFlags flags)
at System.Linq.Expressions.Compiler.LambdaCompiler.EmitMethodCall(Expression obj, MethodInfo method, IArgumentProvider methodCallExpr, CompilationFlags flags)
at System.Linq.Expressions.Compiler.LambdaCompiler.EmitMethodCallExpression(Expression expr, CompilationFlags flags)
at System.Linq.Expressions.Compiler.LambdaCompiler.EmitExpression(Expression node, CompilationFlags flags)
at System.Linq.Expressions.Compiler.LambdaCompiler.EmitLambdaBody(CompilerScope parent, Boolean inlined, CompilationFlags flags)
at System.Linq.Expressions.Compiler.LambdaCompiler.EmitLambdaBody()
at System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpression lambda, DebugInfoGenerator debugInfoGenerator)
at Telerik.Windows.Data.BindingToExpressionHelper.CreateUntypedMemberAccessFunc(LambdaExpression memberAccessLambda)
at Telerik.Windows.Controls.GridViewBoundColumnBase.InitializeMemberAccessFunc() in c:\Builds\WPF_Scrum\Release_SL\Sources\Development\Controls\GridView\GridView\GridView\Columns\GridViewBoundColumnBase.cs:line 1349
at Telerik.Windows.Controls.GridViewBoundColumnBase.InitializeDisplayValueFunc() in c:\Builds\WPF_Scrum\Release_SL\Sources\Development\Controls\GridView\GridView\GridView\Columns\GridViewBoundColumnBase.cs:line 979
at Telerik.Windows.Controls.GridViewBoundColumnBase.GetCellContent(Object item) in c:\Builds\WPF_Scrum\Release_SL\Sources\Development\Controls\GridView\GridView\GridView\Columns\GridViewBoundColumnBase.cs:line 946
at Telerik.Windows.Controls.GridView.GridViewCell.UpdateValue() in c:\Builds\WPF_Scrum\Release_SL\Sources\Development\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 1382
at Telerik.Windows.Controls.GridView.GridViewCell.OnColumnChanged(GridViewColumn oldColumn, GridViewColumn newColumn) in c:\Builds\WPF_Scrum\Release_SL\Sources\Development\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 1377
at Telerik.Windows.Controls.GridView.GridViewCellsPanel.PrepareCell(GridViewCellBase cell, GridViewColumn column) in c:\Builds\WPF_Scrum\Release_SL\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.cs:line 400
at Telerik.Windows.Controls.GridView.GridViewCellsPanel.GetVirtualizedCell(GridViewColumn column, Boolean createIfNull) in c:\Builds\WPF_Scrum\Release_SL\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.Virtualization.cs:line 334
at Telerik.Windows.Controls.GridView.GridViewCellsPanel.RealizeAndMeasureCells(Int32 startIndex, Int32 predictedLastIndex, Func`2 calculateNextIndex) in c:\Builds\WPF_Scrum\Release_SL\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.Virtualization.cs:line 272
at Telerik.Windows.Controls.GridView.GridViewCellsPanel.UpdateVirtualizedCells() in c:\Builds\WPF_Scrum\Release_SL\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.Virtualization.cs:line 205
at Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureOverride(Size availableSize) in c:\Builds\WPF_Scrum\Release_SL\Sources\Development\Controls\GridView\GridView\GridView\Virtualization\GridViewCellsPanel.cs:line 293
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
Microsoft.Windows.Design.Platform.InvalidDesignerUpdateException
An unhandled exception was encountered while trying to render the current silverlight project on the design surface. To diagnose this failure, please try to run the project in a regular browser using the silverlight developer runtime.