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,
Thank you for your post. I have been looking into it and the sample you provided and I can say that the items you should add to the XamTilesManager’s Items collection shouldn’t be XamTile object, and collection of custom object which you can bind to the XamChart, which is defined as ItemTemplate. You can see a sample with an Image instead of Chart in the Feature Browser under xamTilesManager / Data / Data Binding and Item Template section. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
I do not understand the use of:
public class AddTilesToXamTileManager_Root : Infragistics.Samples.WPF.xamFeatureBrowser.Controls.LocalizationRoot
and
public partial class AddTilesToXamTileManager : Page
It is very difficult to move from example to a real project. I'm not a programmer andonly a weak learning WPF. Examples of some projects more visible.
I have been looking into your requirement and I modified the sample you have send me before, so you can now add tiles with XamChart, which uses the defined ItemTemplates. Please let me know if this helps you or you need further assistance on this matter.
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]);
if (tile1 != null)
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?
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]);
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.