Help please. I would like to add a chart to Tile and set (XamTileManager.ItemTemplate, ItemTemplateMinimized, ItemTemplateMinimizedExpanded) using С# code:
private void Button1_Click(object sender, RoutedEventArgs e)
{
XamTile addTile = new XamTile
Name= "test" + (this.xamTileManager1.Items.Count + 1),
Header = "Modul " + (this.xamTileManager1.Items.Count + 1),
IsMaximized = true
};
xamTileManager1.Items.Add(addTile);
}
Hello,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
I have been looking into your code and I modified the sample I sent you before, so now it has the functionality you want. Also I can say that when you add a new item in the XamTilesControl its DataContext is null and you should set it to a new instance of an object.
Hope this helps you.
Tile tile1 = this.xamTilesControl1.TileFromItem(this.xamTilesControl1.Items[0]);
if (tile1 != null)
XamDataChart Chart = Utilities.GetDescendantFromName(tile1, "xamChart1") as XamDataChart;
var data = Chart.DataContext as ObservableCollection<LiveViewDataPoint>;
var newPoint = new LiveViewDataPoint() { X = (int)10, Y = 10 };
data.Add(newPoint);
Generates an error.What am I doing wrong?
I have been looking into your requirement and is suggest you use the following code to achieve the functionality you want:
xamTileManager1.Items.Add(new object()); xamTileManager1.UpdateLayout(); XamTile tile1 = this.xamTileManager1.TileFromItem(this.xamTileManager1.Items[0]); if (tile1 != null) { TextBox tb = Utilities.GetDescendantFromName(tile1, "textssss") as TextBox; tb.Text = "New Text"; }
Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Good day!It works! Thank you!In the following I would like to deploy schage first created xamTile. Here is my code:
xamTileManager1.Items.Add(new object());
XamTile tile1 = this.xamTileManager1.TileFromItem(this.xamTileManager1.Items[0]);
Actions ???
TileFromItem returns Null. (http://community.infragistics.com/forums/p/45847/326685.aspx#326685)
And one more question.
How to change the values in TextBox, which is located on the xamTile in template?